Dying

Krusher I was messing around with the tutorial and was trying to figure out how to make the ego die if he touches a certain person walking randomly around. Does anyone know how to do this?
cloudee1 Follow the tutorial and instead of putting the dying stuff in the handleevent method, put it under the doit method and then to activate it add something to check the distance to the other actor, similar to talking to them.

If this doesn't help, let me know and I'll post some code to illustrate what I mean. ;)
Krusher Sorry I'm so dumb, but I'm new to this. I would appreciate it if you could illustrate it with some code.
cloudee1 here you go:

(instance RoomScript of Script(properties)
(method(doit) // constantly checks
(var dyingScript) // add variable
(super:doit())
(if(<(send gEgo:distanceTo(badMan))20) //if closer than 20
(send gEgo:view(822)setCycle(Fwd)) //an ego dying view
= dyingScript ScriptID(DYING_SCRIPT)
(send dyingScript:caller(832)
register("You would do better to avoid that bad man! "))
(send gGame:setScript(dyingScript))
) // ends if
) // ends method
) // ends instance

;)
Krusher thanks, cloudee! I got it to work.