obj
neutralpaintball
icon = 'Paintballs.dmi'
icon_state = "neutral"
density = 1
Bump(A)
if(ismob(A))
var/mob/M = A
if(M.name != src.owner)
M.hp -= 1
if(M.hp < 1)
Death(M, src)
del(src)
if(istype(A, /obj))
del(src)
del(A)
proc/Death(mob/M, obj/O)
M.hp = 3
M.WO += 1
for(var/mob/N in world)
if(N.name == O.owner)
N.KO += 1
Spawn(M)
Problem description:During run-time, when a user kills another player, instead of the killed player's WO var being upped by 1, the player that killed's WO var goes up, as well as their KO var.
What have I done wrong?
EDIT - I'd aslo like to add that this is all i need to sort before packaging my Isometric Lego Paintball Game! :D
Taken generally - plenty. In terms of maintainability (and readability, a little), flexibility and robustness, your implementation is bad. For a good way to go about implementing a "battle system", follow this post: [link]
Of course, if you're just starting out and don't quite know what you're doing yet, you could forget about this until you're better.
Just fixing your logical error should be easy. Just make sure that you DON'T identify objects by name (it's a silly method) - just pass a reference instead (this also means owner should store a mob reference rather than a text string), and then make sure you're passing the right arguments to your proc.
Also, note that when a proc's src is deleted, it stops. So trying to do anything after a del src will always fail.