Jump to content

Why not working setTimer?


Turbe$Z

Recommended Posts

local countdown = 120
		G3 = guiCreateLabel(0.49, 0.67, 0.03, 0.02, tostring(countdown).." mp", true)
        guiSetFont(G3, "default-bold-small")    
		guiSetVisible(G3,false)

addEventHandler("onClientGUIClick",root,
	function ()
	if source == buttonGuest then
	removeEventHandler("onClientRender",root,a123)
	addEventHandler("onClientRender", root, dxhavendeg)
	guiSetVisible(buttonLogin,false)
	guiSetVisible(buttonRegister,false)
	guiSetVisible(buttonGuest,false)
	guiSetVisible(editPassword,false)
	guiSetVisible(editUsername,false)
setTimer(function () 
	countdown = countdown - 1 
	if countdown >= 0 then 
		guiSetText(G3, tostring(countdown)) 
	else 
		outputChatBox("asd")
	end 
end, 120000, 1000) 
	end
end
)

what wrong? :'( 

Edited by Turbo777
Link to comment
1 minute ago, #BrosS said:

setTimer(function () 
	countdown = countdown - 1 
	if countdown >= 0 then 
		guiSetText(G3, tostring(countdown)) 
	else 
		outputChatBox("asd")
	end 
end, 1000, 0) 

 

the counter does not countdown :S 

sorry for my bad English:c

Link to comment
local countdown = 120
		G3 = guiCreateLabel(0.49, 0.67, 0.03, 0.02, tostring(countdown).." mp", true)
        guiSetFont(G3, "default-bold-small")    
		guiSetVisible(G3,false)

addEventHandler("onClientGUIClick",root,
	function (button, state)
	if button == "left"and state=="up" and source == buttonGuest then
	removeEventHandler("onClientRender",root,a123)
	addEventHandler("onClientRender", root, dxhavendeg)
	guiSetVisible(buttonLogin,false)
	guiSetVisible(buttonRegister,false)
	guiSetVisible(buttonGuest,false)
	guiSetVisible(editPassword,false)
	guiSetVisible(editUsername,false)
setTimer(function () 
	countdown = countdown - 1 
	if countdown >= 0 then 
		guiSetText(G3, tostring(countdown)) 
	else 
		outputChatBox("asd")
	end 
end, 1000, 0) 
	end
end
)

try see if that work

  • Like 1
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...