Forum
CS2D Scripts how to creat a delay.how to creat a delay.
9 replies 1
1
2
3
4
5
6
2
3
4
5
6
delay = 3 -- delay time in seconds start = os.clock() while (os.clock() ~= start+delay) do 	-- leave this empty, or comment like me. :P end add_newball_function()
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
function delay_to_new_ball() 	delay = 3 -- delay time in seconds 	start = os.clock() 	while (os.clock() ~= start+delay) do 		-- leave this empty, or comment like me. :P 	end 	add_newball_function() end
CS2D has built-in timers to make your life easier:
see timer - use them instead.
DC has written
What DannyDeth said is very dangerous!
you are not the first person to say that about my code before. But, yes, DC is very right. Didn't really think about the fact that it will pause EVERYTHING in CS2D.. lolz. It's like the ultimate malfunction.
That script was too complicated for me.
1