ID:176336
![]() Jan 23 2003, 1:03 pm
|
|
how can i make it so that when you go up 6 or less tiles to a mob you start to here sound and when you step away from the mob it stops playing
|
![]() Jan 23 2003, 9:42 pm
|
|
Siientx wrote:
mob.Move()//When they move Problem: This'll start a new sound every time. You really should use a var to keep track of whether a sound is already playing, so you don't end up constantly replaying it. Lummox JR |
Siientx wrote:
mob.Move()//When they movefor(var/mob/M in view(5)) //for every player in the view.if(!M) //if there is no mob in view.src <<sound(null) //make them hear nothing.return ..() //move and do everything like normalelse //if there is a mob!src <<sound("Sound",1) //play the soundreturn ..() //move and do everything like normal!M will never evaluate to true if you're looping on mobs, and assigning them to M! If there are no mobs, the loops simply doesn't execute. |