Ir para conteúdo
  • 0
Mystiq

Scripting Snowball war a nil value

Pergunta

Mystiq    0
Mystiq

Antes de fazer a sua pergunta, tenha certeza de ter lido as regras da seção e o guia abaixo:

https://forums.otserv.com.br/index.php?/forums/topic/168583-regras-da-seção/

https://forums.otserv.com.br/index.php?/forums/topic/165121-como-fazer-uma-pergunta-ou-o-grande-guia-do-usuário-com-dúvidas/

Descreva em algumas palavras a base utilizada. (Nome do servidor / Nome do cliente / Nome do website / etc.).

OTBR-Global

Base:

Not sure what you mean with base?

Qual é a sua pergunta?

Everything works fine, teleport opens, people get inside and they get teleported to the waiting room. When the event should start im getting this error. And people in the waiting room do not get teleported.

 

Você tem o código disponível? Se tiver poste-o na caixa de código que está dentro do spoiler abaixo:

Spoiler

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]: Not enough players to start Last man Standing event! Minimum: ".. SnowBall_Configurations.Event_MinPlayers.." players.")
        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]: event portal closed and event started!.")
            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]: will be closed in ".. rounds .. " minutes and " .. SnowBall_Configurations.Event_MinPlayers - #CACHE_GAMEPLAYERS .." players for start.")
    else
        broadcastMessage("[Snowball Event]: was opened and will be closed in ".. rounds .. " minutes.")
    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]: was opened, entrance through Temple of Thais!")
    addEvent(startGame, 60 * 1000, SnowBall_Configurations.Event_WaitGame)
    return true
end 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]: Not enough players to start Last man Standing event! Minimum: ".. SnowBall_Configurations.Event_MinPlayers.." players.")
        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]: event portal closed and event started!.")
            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]: will be closed in ".. rounds .. " minutes and " .. SnowBall_Configurations.Event_MinPlayers - #CACHE_GAMEPLAYERS .." players for start.")
    else
        broadcastMessage("[Snowball Event]: was opened and will be closed in ".. rounds .. " minutes.")
    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]: was opened, entrance through Temple of Thais!")
    addEvent(startGame, 60 * 1000, SnowBall_Configurations.Event_WaitGame)
    return true
end

 

 

Você tem alguma imagem que possa auxiliar no problema? Se sim, anexe-a dentro do spoiler abaixo:

Spoiler

image.png.44feaaa72d0823a09b5e380af9eb3b86.png

 

Compartilhar este post


Link para o post
Compartilhar em outros sites

1 resposta a esta questão

Recommended Posts

Visitante
Este tópico está impedido de receber novos posts.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×