Hi, just making a simple script but came to a point were i need to pause. I googled but there was no Gmod specific so how would i do a quick wait like 1/2 a second?
[QUOTE=??????;21477477]Hi, just making a simple script but came to a point were i need to pause. I googled but there was no Gmod specific so how would i do a quick wait like 1/2 a second?[/QUOTE]
Don't google...
[url]http://wiki.garrysmod.com/[/url]
Lua doesn't have a pause function.
[QUOTE=??????;21477477]Hi, just making a simple script but came to a point were i need to pause. I googled but there was no Gmod specific so how would i do a quick wait like 1/2 a second?[/QUOTE]
There is no concept of pause in the game, unless you really want to freeze the player's game for half a second.
What do you want to do anyway?
sv_pausable 1
pause
this is something else but it works
[url]http://misc.diamondbuild.info/C++/gm_sleep.zip[/url]
[editline]10:46AM[/editline]
An example is included.
I'm using it to have a slight [pause in between each bullet in a burst round. the 1/2 a second was just an example.
Oh, you don't want gm_sleep then.
Use a timer.Simple.
How would i use that in SWEP:PrimaryAttack to delay each when each bullet is shot?
[code]self.Weapon:SetNextPrimaryFire(CurTime() + 1)[/code]
1 is delay in seconds
thats in between bursts. i have a for loop that shoots 3 bullets in the PrimaryFire function and i just need a little pause before the loop redoes the code.
Sorry, you need to Log In to post a reply to this thread.