Jump to content

Delay Comandos


Recommended Posts

Em se tratar de delay para comandos, eu trabalharia dessa forma:

local Tempo = {}

addCommandHandler('comando', 
	function (player)
		if not (Tempo[player] and isTimer(Tempo[player])) then
			print('Timer começando')
			Tempo[player] = setTimer(
				function (p)
					print('Timer terminado')
					Tempo[p] = nil
				end
			, 10000, 1, player)
		else
			print('Aguarde 10 segundos para executar o comando novamente')
		end
	end
)

 

Edited by KronoS Lettify
  • Thanks 2
Link to comment
3 hours ago, KronoS Lettify said:

Em se tratar de delay para comandos, eu trabalharia dessa forma:


local Tempo = {}

addCommandHandler('comando', 
	function (player)
		if not (Tempo[player] and isTimer(Tempo[player])) then
			print('Timer começando')
			Tempo[player] = setTimer(
				function (p)
					print('Timer terminado')
					Tempo[p] = nil
				end
			, 10000, 1, player)
		else
			print('Aguarde 10 segundos para executar o comando novamente')
		end
	end
)

 

Obrigado

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...