ID:1918487
 
(See the best response by Kaiochao.)
Code:
mob
verb
Return_To_Spawn()
usr<<"<font color=#FF0000>You will be returned to your spawn in 1 minute!"
sleep(6000)
loc=locate(1,1,1)


Problem description:
Is there any way that I can make the verb only function once at a time, & not work continuously every time it's used.? (Issue here: It functions correctly, but the only issue is, if I press it 4 times, it'll return me 4 times.) How do I activate a 'cooldown' system?
Best response
Basically, you need a variable attached to the object. Here's an example:
mob
var tmp/spawn_time
var spawn_delay = 6000

verb/Return_To_Spawn()
if(world.time >= spawn_time)
spawn_time = world.time + spawn_delay
src << "<font color=#FF0000>You will be returned to your spawn in 1 minute!"
sleep spawn_delay
loc = locate(1, 1, 1)
else src << "[(spawn_time - world.time)/10]s before you spawn!"
Also, for the sake of keeping you nice and smart so you will know how to do everything spick and span: The Difference between usr and src.
src should be preferred on any verb where the src setting is "src = usr", which is the default for all mob verbs.

The reason that src should be preferred is because usr is typecast to /mob, while src is typecast to the current path.

Here's why you should always use src instead of usr in mob verbs:

mob
combatant
var
blocking = 0
verb
block()
usr.blocking = !usr.blocking //compiler error!
block2()
blocking = !blocking //this works (src is implied)


Not only can using usr in mob verbs result in nasty compiler errors, but it adds unneeded overhead in the form of a pointer lookup that doesn't need to be done. Since usr = src, and src can be implied, the VM doesn't have to traverse the usr pointer to figure out what object to access.