[DiscordArchive] I've seen your code for the buffs and find it interesting, but is there a way to add a timer to reus
[DiscordArchive] I've seen your code for the buffs and find it interesting, but is there a way to add a timer to reus
Archived author: Rintaro Tsumugi • Posted: 2023-09-11T15:53:15.569000+00:00
Original source
I've seen your code for the buffs and find it interesting, but is there a way to add a timer to reuse the command every 5 hours?
Archived author: Roboto • Posted: 2023-09-11T15:58:09.315000+00:00
Original source
<https://www.azerothcore.org/pages/eluna/Global/GetCurrTime.html>
Archived author: Roboto • Posted: 2023-09-11T16:00:05.399000+00:00
Original source
Create a table and store the current time after using the command. When a player uses the command, check if the current time minus their last use time is bigger than 5 hours
Archived author: Rintaro Tsumugi • Posted: 2023-09-11T16:08:43.408000+00:00
Original source
function Buffcommand(event, player, cmd, chatHandler)
if cmd:lower() == "buff" then
player:AddAura(48074, player)
player:AddAura(48170, player)
player:AddAura(43223, player)
player:AddAura(36880, player)
player:AddAura(467, player)
player:AddAura(48469, player)
player:AddAura(48162, player)
player:SendBroadcastMessage("Vous avez été buffer, profitez-en !")
currTime = GetCurrTime(300, player)
return false
end
end
local PLAYER_EVENT_ON_COMMAND = 42
RegisterPlayerEvent(PLAYER_EVENT_ON_COMMAND, Buffcommand) its okey no?