Pacheco465 Posted July 27, 2020 Share Posted July 27, 2020 Olá, queria saber como eu poderia colocar um delay para um comando. EX: A cada 5 segundos poder utilizar o bind. Link to comment
KronoS Lettify Posted July 27, 2020 Share Posted July 27, 2020 (edited) 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 July 27, 2020 by KronoS Lettify 2 Link to comment
Pacheco465 Posted July 27, 2020 Author Share Posted July 27, 2020 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now