Snowball Event is giving an error at globalevents when it starts, can someone help me?
I'm using this snowball event
Lua Script Error: [Main Interface]
in a timer event called from:
(Unknown scriptfile)
data/globalevents/scripts/SnowBall_Event.lua:12: bad argument #2 to 'random' (interval is empty)
stack traceback:
[C]: in ?
[C]: in function 'random'
data/globalevents/scripts/SnowBall_Event.lua:12: in function
globalevents/scripts/SnowBall_Event.lua
Can I change this "math.random" for some other code?
I'm using this snowball event
GlobalEvent - Snowball War Event (TFS 1.X)
Good morning, Otland's friends! I bring today a very fun and different event for your server that is the snowball event, the event consists of a battle of snowballs and the player that more kill wins. Command: !snowball atirar - Shoot the snowball straight to hit the target Exemple: Note...
otland.net
Lua Script Error: [Main Interface]
in a timer event called from:
(Unknown scriptfile)
data/globalevents/scripts/SnowBall_Event.lua:12: bad argument #2 to 'random' (interval is empty)
stack traceback:
[C]: in ?
[C]: in function 'random'
data/globalevents/scripts/SnowBall_Event.lua:12: in function
globalevents/scripts/SnowBall_Event.lua
Lua:
function startGame(rounds)
if rounds == 0 then
if #CACHE_GAMEPLAYERS < SnowBall_Configurations.Event_MinPlayers then
for _, players in ipairs(CACHE_GAMEPLAYERS) do
Player(players):teleportTo(Player(players):getTown():getTemplePosition())
end
broadcastMessage("[Snowball Event]: O evento foi cancelado por conta de não ter no minimo ".. SnowBall_Configurations.Event_MinPlayers.." jogadores.", MESSAGE_EVENT_ADVANCE)
else
for _, players in ipairs(CACHE_GAMEPLAYERS) do
Player(players):setStorageValue(10109, 0)
Player(players):setStorageValue(10108, SnowBall_Configurations.Ammo_Configurations.Ammo_Start)
Player(players):teleportTo(CACHE_GAMEAREAPOSITIONS[math.random(1, #CACHE_GAMEAREAPOSITIONS)])
end
broadcastMessage("[Snowball Event]: O evento foi fechado. O jogo começou.", MESSAGE_EVENT_ADVANCE)
addEvent(Event_endGame, SnowBall_Configurations.Event_Duration * 60 * 1000)
end
Item(getTileItemById(SnowBall_Configurations.Area_Configurations.Position_EventTeleport, 1387).uid):remove(1)
Item(getTileItemById(SnowBall_Configurations.Area_Configurations.Position_ExitWaitRoom, 1387).uid):remove(1)
return true
end
if #CACHE_GAMEPLAYERS < SnowBall_Configurations.Event_MinPlayers then
broadcastMessage("[Snowball Event]: Faltam ".. rounds .. " minuto(s) e " .. SnowBall_Configurations.Event_MinPlayers - #CACHE_GAMEPLAYERS .." jogador(es) para o jogo começar.", MESSAGE_EVENT_ADVANCE)
else
broadcastMessage("[Snowball Event]: Faltam ".. rounds .. " minuto(s) para o jogo começar.", MESSAGE_EVENT_ADVANCE)
end
return addEvent(startGame, 60 * 1000, rounds - 1)
end
function onTime(interval)
if not SnowBall_Configurations.Event_Days[os.date("%w") + 1] then
return true
end
CACHE_GAMEPLAYERS = {}
local EventTeleport = Game.createItem(1387, 1, SnowBall_Configurations.Area_Configurations.Position_EventTeleport)
EventTeleport:setActionId(10101)
local ExitWaitRoom = Game.createItem(1387, 1, SnowBall_Configurations.Area_Configurations.Position_ExitWaitRoom)
ExitWaitRoom:setActionId(10102)
broadcastMessage("[Snowball Event]: O evento foi aberto, vá até o EVENT ROOM no Dp de Thais para participar.", MESSAGE_EVENT_ADVANCE)
addEvent(startGame, 60 * 1000, SnowBall_Configurations.Event_WaitGame)
return true
end
Can I change this "math.random" for some other code?