• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

SNOWBALL WARR EVENT

Ichito123

New Member
Joined
Nov 25, 2013
Messages
36
Reaction score
3
Hello i have error and i dont know how i fix it ... ;/ Little help ?
error.jpg

And there is my code:

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]: Wydarzenie zostalo odwolane z powodu braku co najmniej ".. SnowBall_Configurations.Event_MinPlayers.." graczy.")
        else
            for _, players in ipairs(CACHE_GAMEPLAYERS) do
                Player(players):setStorageValue(8004, 0)
                Player(players):setStorageValue(8003, SnowBall_Configurations.Ammo_Configurations.Ammo_Start)
                Player(players):teleportTo(CACHE_GAMEAREAPOSITIONS[math.random(1, #CACHE_GAMEAREAPOSITIONS)])
            end
            broadcastMessage("[Snowball Event]: Wydarzenie zostalo zamkniete. Gra sie rozpoczela.")
            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]: Zostaly ".. rounds .. " minut " .. SnowBall_Configurations.Event_MinPlayers - #CACHE_GAMEPLAYERS .." do rozpoczecia eventu.")
    else
        broadcastMessage("[Snowball Event]: Zostala ".. rounds .. " minuta do rozpoczecia eventu.")
    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(8000)

    local ExitWaitRoom = Game.createItem(1387, 1, SnowBall_Configurations.Area_Configurations.Position_ExitWaitRoom)
    ExitWaitRoom:setActionId(8001)

    broadcastMessage("[Snowball Event]: Wydarzenie rozpocznie sie za 3 minuty udaj sie do poczekalni.")
    addEvent(startGame, 60 * 1000, SnowBall_Configurations.Event_WaitGame)
    return true
end
 
I accidentally clicked that the topic was resolved; / link to a new topic.
 
Back
Top