mob
Bump(mob/M)
if(/mob/NPC/Monster)
usr.loc =locate(1,1,1)
M.loc =locate(1,2,1)
else
return
ID:261422
Mar 10 2002, 12:53 pm
|
|
I can't seem to get this to work. The bump teleports you when you bump any mob. Help Please
|
In response to Dreq
|
|
Thank you the way you did it didi't work right but I came up with a way useing vars but you gave me the idea. Thank you ;P
|
In response to Little Sally
|
|
Yeah basically saying if(/mob/NPC/Monster) is the same as saying if(1) which is ALWAYS true. mob/M in your proc's () is given the value of the mob thats calling it (usuially), so you use that to check. But to learn good practice early, ALWAYS say:
if (M) yourcode Because BYOND has a habbit of calling procs with M as null, in which case you'll be slammed with ugly runtime errors :) Edit: That if(M==whatever) will work too, just as long as your checking for ~something~ :) |
Dreq's code isn't the best way of doing this:
mob/Bump(mob/M as mob) |
In response to Nadrew
|
|
I simply added 'M =' to her code ;)
|
That should work...