• Sleep Command
    7 replies, posted
Is there a sleep command or pause command? I am trying to make a script that after 5 seconds of typing something, the script does something. I have everything done... all I need is a sleep command. Thanks!
Look at the [url=http://wiki.garrysmod.com/?title=Timer]timer[/url] methods, timer.Simple is probably the one to use in this situation.
[QUOTE=MakeR;15995272]Look at the [url=http://wiki.garrysmod.com/?title=Timer]timer[/url] methods, timer.Simple is probably the one to use in this situation.[/QUOTE] He has the timer. He needs the sleep command. Sorry, bro. I don't know of any sleep command. What exactly does this sleep command do?
[QUOTE=TomatoSoup;16023813]He has the timer. He needs the sleep command. Sorry, bro. I don't know of any sleep command. What exactly does this sleep command do?[/QUOTE] What? With a timer you can do exactly what the OP wants.
timer.Simple( number:delayinseconds, function:callback, vararg:arguments ... ) So timer.Simple( 5, cleanupfunction, "anything I need to send it", "here", 354 )
I don't want to piss on your parade, but sleep functions online don't really work. In singleplayer, you sleep for say 5 hours, but it skips it, so it's only 10 seconds, but online, it wouldn't work properly.
[QUOTE=avwos;16039907]I don't want to piss on your parade, but sleep functions online don't really work. In singleplayer, you sleep for say 5 hours, but it skips it, so it's only 10 seconds, but online, it wouldn't work properly.[/QUOTE] I don't think you understand what the OP is talking about.
[lua]timer.Simple( 5, function() --do shit end )[/lua]
Sorry, you need to Log In to post a reply to this thread.