If anyone knows how i can make this turf code attack mobs when they walk on it unless they have a certain object.
turf/security_system
icon = 'security.dmi'
turf/security_system
proc/shock(mob/m)
Entered(atom/movable/m)
shock(m)
var/damage = 5
please help me fix this code!!!
ID:149606
Mar 27 2002, 6:13 pm
|
|
In response to Richter
|
|
Gads. Don't post in reply to a topic like this unless you can actually help; if you don't know what you're doing, then it's a case of the blind leading the blind. Or in this case, the blind leading the slightly disoriented, since your code is actually considerably worse than the code that was posted by Nobody--his was pretty close to what he needs, except for the key check. And your method of key checking is, as I explaiend in response to your post in Newbie Central last night, very very bad.
Enter() is absolutely the wrong thing to be using here (Entered() is correct), and usr is absolutely the wrong var to use in it, since the proc is given a reference to the obj or mob that's entering. Again, the remedial version:
Lummox JR |
Nobody wrote:
If anyone knows how i can make this turf code attack mobs when they walk on it unless they have a certain object. Well, you're pretty close here. Ther's a slight indent problem, but we can take care of that. What you basically need is something like this: obj/key That ought to be enough to get you started, if you want to make it more complex than that. Lummox JR |
In response to Lummox JR
|
|
thank you Lummox JR I have been trying to get a code for that and you are the only person that actually knows how to make those
|
In response to Nobody
|
|
Nobody wrote:
thank you Lummox JR I have been trying to get a code for that and you are the only person that actually knows how to make those That's not true -- lots of us know how. It's just a matter of how arrogant, stuck-up, or rude some of us are. ;-) |
In response to Spuzzum
|
|
Spuzzum wrote:
Nobody wrote: Hey don't forget those of us lurking, too busy, or too late. ;) |
turf
Hurtspot
Enter()
if(usr.whateve var you want here>=1)
var/damage=5
usr.HP-=damage.
else
usr<<""
return ..()
Now when the character picks up the object that makes it so he gets hurt on the turf give him a var and make sure it goes in the if(usr.whateve var you want here>=1)
part
if you still need help just ask
i hope this helps
~Richter