ID:149557
 
Ok heres the problem i created a npc who randomely walks around and if he sees a player he attacks that works but when you attack him he refusses to die just tell me what code is wrong and ill show it to you!
How can we tell you what code is wrong if we don't even know what codes are there? Programming is like painting, no two programs are ever alike.
Raiden2k2 wrote:
Ok heres the problem i created a npc who randomely walks around and if he sees a player he attacks that works but when you attack him he refusses to die just tell me what code is wrong and ill show it to you!

You already posted about this in another thread. Don't just repost like that. Wait for some people to respond to the other one.

Lummox JR
In response to Foomer
mob
NPC
Punk
name = "Punk"
icon = 'spy.dmi'
HP = 10
Max_HP = 10
strength = 2
give_exp = 5
var/mob/PC/P
New()
.=..()
spawn(1)
Wander()
proc/Wander()
while(src) .
if (P in oview(5))
step_towards(src,P)
else
step_rand(src)
for(P in view(src)) .
break
sleep(5)
spawn(40)
Wander()
Bump(mob/M)
if (istype(M,/mob/PC))
Attack(M)
proc/Attack(mob/M)
sleep(2)
var/damage = rand(1,strength)
M.HP -= damage
view(src) << "[src] attacks [M] with a crowbar!"
view(src) << "[damage] damage!"
M.PCDeathCheck()

ok this is my punks code who wont die is this the code to blame?
In response to Raiden2k2
make sure that your attack verb calls DeathCheck after each hit, so it can see if it is dead, and if it's a PC you just killed or not....if it is not a PC (such as that punk mob) it will delete it and give you exp
In response to Foomer
Foomer wrote:
How can we tell you what code is wrong if we don't even know what codes are there? Programming is like painting, no two programs are ever alike.

Hey your an artist not a programmer remember!? What are you doing reply in these forusm!? :P

LJR

...jest intended
In response to LordJR
I'm both :oP

I'm also a writer, web site layout designer, and many other odd things no one knows about...
In response to Foomer
I'm also a writer, web site layout designer, and many other odd things no one knows about...

I knew it! You're the one who has been stealing my garbage!
In response to Spuzzum
Uh...urr...just because I'm stalking you doesn't mean I go through your garbage!
In response to Foomer
Foomer wrote:
Uh...urr...just because I'm stalking you doesn't mean I go through your garbage!

Well, how do you explain this, then?! Every Wednesday morning, these people in overalls drive up to my house in a big green truck -- they grab my garbage cans and steal the bags from them, then toss the empty cans back! Then the truck makes a big whirring noise and it drives to the next house!

I'll uncover this conspiracy...!
In response to Spuzzum
Still a rat in a cage planning to take over the world I see? ;) ;)

LJR