• 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!

TFS 1.X+ team battel event work100% need to convert to revscript

abdala ragab

Veteran OT User
Joined
Aug 18, 2018
Messages
595
Solutions
17
Reaction score
442
Location
gamelaots.online
Hi, as stated in the title, I want to convert this event to revscript. If anyone can do that, I would be grateful.
creaturescripts

XML:
     <!-- Battlefield Event -->
    <event type="healthchange" name="BattlefieldEventHealthChange" script="BattlefieldEventHealthChange.lua"/>
    <event type="manachange" name="BattlefieldEventManaChange" script="BattlefieldEventManaChange.lua"/>
BattlefieldEventHealthChange
Lua:
function onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
    local damage = primaryDamage + secondaryDamage
    local check = battleFieldEvent:canDealDamage(creature, attacker, damage, primaryType)
    if (check) then
        return primaryDamage, primaryType, secondaryDamage, secondaryType
    else
        return 0, COMBAT_NONE, 0, COMBAT_NONE
    end
end

function onManaChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
print(1)
    local damage = primaryDamage + secondaryDamage
    local check = battleFieldEvent:canDealDamage(creature, attacker, damage)
    if (check) then
        return primaryDamage, primaryType, secondaryDamage, secondaryType
    else
        return 0, COMBAT_NONE, 0, COMBAT_NONE
    end
end
BattlefieldEventManaChange
Lua:
function onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
    --player from same team can't deal damage to team-mates
    --player from different team can't heal to oposite team
        --summons must respect that

    --kill player quit from event
    --there is not attacker? Check damage to kick member if required

    local myHealth = creature:getHealth()

    if (not attacker) then
        --kill player
    --    totalDamage = primaryDamage + secondaryDamage

    --    if (totalDamage >= myHealth) then
            
    --        battleFieldEvent:removeMember(creature, true)
            return 0, primaryType, 0, secondaryType
    --    end     
    --    return primaryDamage, primaryType, secondaryDamage, secondaryType
    end


    local sameTeam = false
    local myTeam = battleFieldEvent:getTeam(creature)
    local totalDamage = 0


    if (attacker:isMonster()) then
        local monster = attacker
        local team = battleFieldEvent:getOwnerTeam(monster)
        if (not team) then
            return primaryDamage, primaryType, secondaryDamage, secondaryType
        end
        attacker = attacker:getMaster()

        if (team == myTeam) then
            sameTeam = true
        end

    else
        local team = battleFieldEvent:getTeam(attacker)
        if (team == myTeam) then
            sameTeam = true
        end
    end

    if (sameTeam) then
        if (primaryType ~= COMBAT_HEALING or secondaryType ~= COMBAT_HEALING) then
            return 0, primaryType, 0, secondaryType
        end
    else
        if (primaryType == COMBAT_HEALING or secondaryType == COMBAT_HEALING) then
            return 0, primaryType, 0, secondaryType
        end

        --kill player
        totalDamage = primaryDamage + secondaryDamage
        totalDamage = math.abs(totalDamage)
        if (totalDamage >= myHealth) then
            
            battleFieldEvent:removeMember(creature, attacker)
            return 0, primaryType, 0, secondaryType
        end

    end
    
    return primaryDamage, primaryType, secondaryDamage, secondaryType
end

function onManaChange(creature, attacker, manaChange, origin)
    if (not attacker) then return manaChange end
    local myHealth = creature:getHealth()

    local sameTeam = false
    local myTeam = battleFieldEvent:getTeam(creature)
    local myHealth = creature:getMana() + creature:getHealth()


    if (attacker:isMonster()) then
        local monster = attacker
        local team = battleFieldEvent:getOwnerTeam(monster)
        if (not team) then
            return manaChange
        end

        if (team == myTeam) then
            sameTeam = true
        end

    else
        local team = battleFieldEvent:getTeam(attacker)
        if (team == myTeam) then
            sameTeam = true
        end
    end

    if (sameTeam) then
        return 0
    end
    

    return manaChange
end
globalevents
XML:
 <globalevent name="battlefield" time="01:08:00" script="battlefield.lua" />
Lua:
    local minutesToStart = 5
    function onTime(interval)
        announcebattleFieldEvent(minutesToStart, 0)
        return true
    end
data/battleFieldEvent
Lua:
BFE_Storage = 35000

battleFieldEvent =
{
    goal = 25,--goal to reach (kills)
    teamNames =
    {
        [1] = "BlueTeam",
        [2] = "RedTeam",

    },

    eventNames =
    {
        "BattlefieldEventHealthChange",
        "BattlefieldEventManaChange"
    }, --used for healthchange events

    name = "[Battlefield Event]",
    command = "!joinbf",
    storages =
    {
        players =
        {
            status = BFE_Storage,
            team = BFE_Storage + 1
        },

        globals =
        {
            status = BFE_Storage + 2,
            teamScore =
            {
                BFE_Storage + 3,
                BFE_Storage + 4,
            }
        }
    },

    status =
    {
        ["STATUS_INACTIVE"] = 0,
        ["STATUS_WAITING"] = 1,
        ["STATUS_ACTIVE"] = 2
    },

    config =
    {
        prize =
        {
            itemId = 2638,
            count = 50
        },
        outfits =
        {
            genders = {269, 268},
            colors = {88, 94}
        },
        minPlayers = 2,
        minLevel = 400,
        times =
        {
            ["start"] = 0.3,
            ["close"] = 2,
        },

        positions =
        {
            ["waitArea"] = {x = 2828, y = 3063, z = 6}, --wait position

            battleArea =
            {
                --positions where teams will be teleported
                {x = 1349, y = 2677, z = 9}, --first team               
                {x = 1333, y = 2661, z = 7} --second team
            },

            teleportPosition = {x = 2998, y = 3117, z = 7} --position where teleport will be created
        },

        messages =
        {
            players =
            {
                ["enterWaitArea"] = "You have entered to wait area",
                ["eventStarted"] = "Event has started, you are in %s team!",
                ["killed"] = "You have been killed!",
            },

            global =
            {
                ["waitMessage"] = "Event will start in %d minutes, go to teleport in events room to join",
                ["startedMessage"] = "Event has started.",
                ["finishedMessage"] = "Event has finished.",
                ["killedPlayerMessage"] = "%s has killed %s from %s team!"
            }
        }
    }
}

-- Creates the teleport to the waiting room
function battleFieldEvent:createTeleport()
    local tp = Game.createItem(1387, 1, self.config.positions.teleportPosition)
    tp:setActionId(16282)

    return true
end
 
 
-- Removes the teleport to the waiting room
function battleFieldEvent:removeTeleport()
 
    local tile = Tile(self.config.positions.teleportPosition)
    local findTp = tile:getItemById(1387)
    if (findTp) then
        findTp:remove()
        return true
    end
end


function battleFieldEvent:sendScore(teamId)
    --[[
        score teams
    ]]--


    local msg = string.format("%s %s (%d kills) | %s (%d kills)", self.name, self.teamNames[1], self:getTeamScore(1), self.teamNames[2], self:getTeamScore(2))
    local receivers = self:getMembers(self.status.STATUS_ACTIVE)
    
    if (teamId > 0 and teamId <= 2) then
        receivers = self:getTeamMembers(receivers, teamId)
    end

    self:sendMessageToPlayerList(receivers, msg)

end

function battleFieldEvent:getTeamScore(teamId)
    local value = Game.getStorageValue(self.storages.globals.teamScore[teamId])
    return value and math.max(value, 0) or 0
end

function battleFieldEvent:setTeamScore(teamId, score)
    Game.setStorageValue(self.storages.globals.teamScore[teamId], score)
end

function battleFieldEvent:addTeamScore(teamId, score)
    local actualScore = self:getTeamScore(teamId)
    actualScore = actualScore + score

    self:setTeamScore(teamId, actualScore)

    --print(string.format("Team %d has %d score", teamId, actualScore))
end

function battleFieldEvent:givePrize(players)
    local prize = self.config.prize
    if (#players > 1) then
        --.itemId.count
        local player
        for i = 1, #players do
            player = players[i]
            if (player) then
                player:addItem(prize.itemId, prize.count)
            end
        end
    else
        players[1]:addItem(prize.itemId, prize.count)
    end

end

function battleFieldEvent:setOutfit(player, teamId)
    if (player) then
        local gender = player:getSex()
        local outfit = player:getOutfit()
        local color = self.config.outfits.colors[teamId]

        outfit.lookHead = color
        outfit.lookBody = color
        outfit.lookLegs = color
        outfit.lookFeet = color
        outfit.lookType = self.config.outfits.genders[gender + 1]

        local condition = Condition(CONDITION_OUTFIT)
        condition:setTicks(-1)
        condition:setOutfit(outfit)
        
        player:addCondition(condition)

        --player:setOutfit(outfit)
    end
    -- body
end

function battleFieldEvent:setStatus(status)
    Game.setStorageValue(self.storages.globals.status, status)
end

function battleFieldEvent:getStatus()
    local value = Game.getStorageValue(self.storages.globals.status)
    return value and math.max(value, 0) or 0
end

function announcebattleFieldEvent(times, done)
    if (done == 0) then
        battleFieldEvent:createTeleport()
    end
    if (battleFieldEvent:getStatus() > battleFieldEvent.status.STATUS_WAITING) then
        return true
    end

    if (battleFieldEvent:getStatus() ~= battleFieldEvent.status.STATUS_WAITING) then
        battleFieldEvent:setStatus(battleFieldEvent.status.STATUS_WAITING)
    end

    if (times == done) then
        battleFieldEvent:startEvent()
        battleFieldEvent:removeTeleport()
        return true
    end

    local msg = string.format(battleFieldEvent.config.messages.global.waitMessage, times - done, battleFieldEvent.command)
    msg = battleFieldEvent.name.." "..msg
    Game.broadcastMessage(msg)
    addEvent(announcebattleFieldEvent, 1 * 60 * 1000, times, done + 1)   
end

function battleFieldEvent:tryToBalance()
   local members = self:getMembers(self.status.STATUS_WAITING)

   if (#members >= 3) then
      local player = members[#members]
      if (player) then
          self:removeMember(player, false)
          return true
      end
   end

   return false
end

function battleFieldEvent:assignTeams()
    local members = self:getMembers(self.status.STATUS_WAITING)

    local cupos = #members / 2
    local first = {}
    local second = {}

    local val
    
    for i = 1, #members do
       val = math.random(2)
       if (val == 1 ) then
          if (#first == cupos) then
             second[#second + 1] = members[i]
          else
             first[#first + 1] = members[i]
          end
       else
          if (#second == cupos) then
             first[#first + 1] = members[i]
          else
             second[#second + 1] = members[i]
          end
       end
    end

    for i = 1, #first do
        self:addMember(first[i], 1)
    end

    for i = 1, #second do
        self:addMember(second[i], 2)
    end

end

function battleFieldEvent:checkBalance()
    local members = self:getMembers(self.status.STATUS_WAITING)
    if (#members % 2 == 0) then
       return true
    else
        return false
    end
end

function battleFieldEvent:kickMembers(status)
    local members = self:getMembers(status)
    if (#members > 0) then
        local player
        for i = 1, #members do
            player = members[i]
            self:kickMember(player)
        end
    end
end

function battleFieldEvent:kickMember(player)
    if (player) then
        self:setMemberStatus(player, self.status.STATUS_INACTIVE)
        player:unregisterEvent(self.eventNames[1])
        player:unregisterEvent(self.eventNames[2])
        
        player:setSkull(SKULL_NONE)
        player:addHealth(player:getMaxHealth())
        player:addMana(player:getMaxMana())

        player:removeCondition(CONDITION_OUTFIT)

        local town = player:getTown()
        if (town) then
            player:teleportTo(town:getTemplePosition())
        end
    end
    -- body
end

function battleFieldEvent:close(winnerTeam)

    self:setStatus(self.status.STATUS_INACTIVE)
    local message

    if (winnerTeam) then
        local allMembers = self:getMembers(self.status.STATUS_ACTIVE)
        local winnerMembers = self:getTeamMembers(allMembers, winnerTeam)
        local teamName = winnerTeam == 1 and "BlueTeam" or "RedTeam"
        message = string.format("%s Event finished, %s won.", self.name, teamName)
        --give prize to them
        self:givePrize(winnerMembers)
    else
        message = self.name.." Event finished, anyone won."
    end

    --kick players
    self:kickMembers(self.status.STATUS_ACTIVE)
    Game.broadcastMessage(message)

    --reset scores
    self:setTeamScore(1, 0)
    self:setTeamScore(2, 0)
end

function battleFieldEvent:kickWinner(player)
    if (player) then
         self:setMemberStatus(cid, self.status.STATUS_INACTIVE)
        self:kickMember(player)
        --give prize

    end
end

function battleFieldEvent:startEvent()
    
    if (not self:checkBalance()) then
        self:tryToBalance()
    end

    if (not self:checkBalance()) then
        local msg = string.format("%s Could not start event. Could not balance players.", self.name)
        Game.broadcastMessage(msg)
        battleFieldEvent:kickMembers(self.status.STATUS_WAITING)
        -- TODO kick all players
        return true       
    end

    if (#self:getMembers(self.status.STATUS_WAITING) < self.config.minPlayers) then
        Game.broadcastMessage(string.format("%s Not enough members to start event.", self.name))
        battleFieldEvent:kickMembers(self.status.STATUS_WAITING)   
        battleFieldEvent:setStatus(self.status.STATUS_INACTIVE)
        return true
    end
    --assignTeams   
    self:assignTeams()

    --check if number waiting players are balanced
        --if not then remove (if can)
    battleFieldEvent:setStatus(self.status.STATUS_ACTIVE)

end

function battleFieldEvent:closeEvent()
    battleFieldEvent:setStatus(status)
end

function battleFieldEvent:setTeam(player, team)
    player:setStorageValue(self.storages.players.team, team)
end

function battleFieldEvent:getTeam(player)
    if (player) then
        local team = player:getStorageValue(self.storages.players.team)
        return team and math.max(team, 0) or 0
    end
end

function battleFieldEvent:setMemberStatus(player, status)
    player:setStorageValue(self.storages.players.status, status)
end

function battleFieldEvent:getMemberStatus(player)
    if (player) then
        local status = player:getStorageValue(self.storages.players.status)
        return status and math.max(status, 0) or 0
    end
end

function battleFieldEvent:getMembers(type)
    local players = {}
    local onlinePlayers = Game.getPlayers()
    
    local player

    for i = 1, #onlinePlayers do
        player = onlinePlayers[i]
        if (player) then
            if (self:getMemberStatus(player) == type) then
                players[#players + 1] = player
            end
        end
    end

    return players
end

function battleFieldEvent:getTeamMembers(members, team)
    local teamMembers = {}

    if (#members > 0) then
        local player
        if (#members > 1) then
            for i = 1, #members do
                player = members[i]
                if (player) then
                    if (self:getTeam(player) == team) then
                        teamMembers[#teamMembers + 1] = player
                    end
                end
            end
        else
            player = members[1]
            if (player) then
                if (self:getTeam(player) == team) then
                    teamMembers[#teamMembers + 1] = player
                end
            end
        end
    end

    return teamMembers
end

function battleFieldEvent:addMemberToWait(player)
    if (player) then
        self:setMemberStatus(player, self.status.STATUS_WAITING)
        player:teleportTo(self.config.positions.waitArea)
    end
end

function battleFieldEvent:isWaiting(player)
    if (player) then
        local status = self:setMemberStatus(player)
        return status and status == self.status.STATUS_WAITING
    end
end

function battleFieldEvent:addMember(player, teamId)
    if (player) then
        self:setOutfit(player, teamId)
        self:setMemberStatus(player, self.status.STATUS_ACTIVE)
        player:teleportTo(self.config.positions.battleArea[teamId])
        self:setTeam(player, teamId)
        local msg = string.format(self.config.messages.players.eventStarted, teamId == 1 and "first" or "second")
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, msg)
        player:registerEvent(self.eventNames[1])
        player:registerEvent(self.eventNames[2])

    end
end

function battleFieldEvent:respawnMember(player, teamId)
    if (player) then

        player:teleportTo(self.config.positions.battleArea[teamId])
        player:addHealth(player:getMaxHealth())
        player:addMana(player:getMaxMana())
    end
    --[[
        tp to enter area
        give full mana
        give full health
    ]]--
end

function battleFieldEvent:killMember(player, killer)
    local teamId = self:getTeam(player)
    local enemyTeamId = teamId == 1 and 2 or 1
    local enemyScore = self:getTeamScore(enemyTeamId)
    local myScore = self:getTeamScore(teamId)


    enemyScore = enemyScore + 1

    self:addTeamScore(enemyTeamId, 1)
    self:sendScore(3) --1 is for first

    if (enemyScore == self.goal) then
        self:close(enemyTeamId)
    end

    if (self:getStatus() == battleFieldEvent.status.STATUS_ACTIVE) then
        self:respawnMember(player, teamId)
    end     
end

function battleFieldEvent:removeMember(player, killer)
    self:setMemberStatus(player, self.status.STATUS_INACTIVE)
    player:unregisterEvent(self.eventNames[1])
    player:unregisterEvent(self.eventNames[2])

    if (killer) then
        --check num players --to close
        local players = self:getMembers(self.status.STATUS_ACTIVE)
        
        local RedTeam = self:getTeamMembers(players, 1)
        local BlueTeam = self:getTeamMembers(players, 2)

        local needToClose = false

        if (#firstTeam == 0 or #secondTeam == 0) then
            needToClose = true
        end

        if (needToClose) then
            if (#firstTeam <= 0 and #secondTeam <= 0) then
                --anyone won
                self:close()
            elseif(#firstTeam <= 0) then
                self:close(2)
            elseif(#secondTeam <= 0) then
                self:close(1)
            end
        end

        local msg = string.format(self.config.messages.global.killedPlayerMessage, self.name, killer:getName(), player:getName())
        self:sendMessageToPlayers(self.status.STATUS_ACTIVE, msg)

        player:sendTextMessage(MESSAGE_STATUS_SMALL, self.name.." You have been killed.")
    end

    local town = player:getTown()
    if (town) then
        player:teleportTo(town:getTemplePosition())
    end

end

function battleFieldEvent:sendMessageToPlayerList(players, message)
    if (#players > 0) then
        local player
        for i = 1, #players do
            player = players[i]
            if (player) then
                player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, message)       
            end
        end
    end
end

function battleFieldEvent:sendMessageToPlayers(typePlayers, message)
    local players = self:getMembers(typePlayers)
    if (#players > 0) then
        local player
        for i = 1, #players do
            player = players[i]
            if (player) then
                player:sendTextMessage(MESSAGE_STATUS_DEFAULT, message)       
            end
        end
    end
end


---summons related
function battleFieldEvent:getOwnerTeam(monster)
    if (monster) then
        if (monster:getMaster()) then
            local player = monster:getMaster()
            return self:getTeam(player)
        end
    end
end

function battleFieldEvent:canDealDamage(creature, attacker, damage, primaryType)
    if (not attacker) then
        return false
    end   

    if (not attacker:isPlayer()) then
        if (attacker:getMaster() and attacker:getMaster():isPlayer()) then
            attacker = creature:getMaster()
        end
    end

    local checkSame = false
    if (creature ~= attacker) then
        local myTeam = battleFieldEvent:getTeam(creature)
        local enemyTeam = battleFieldEvent:getTeam(attacker)

        if (myTeam == enemyTeam) then
            checkSame = true
        else
            local myHealth = creature:getHealth()
            local totalDamage = math.abs(damage)
            if (totalDamage >= myHealth) then
                battleFieldEvent:killMember(creature, attacker)
                return false
            end
        end

    else
        checkSame = true
    end

    if (checkSame) then
        if (primaryType) then
            if (primaryType ~= COMBAT_HEALING) then
                return false
            end
        else
            return false
        end
    end

    return true
end
global.lua
Lua:
dofile('data/battleFieldEvent.lua')
movements
XML:
<movevent event="StepIn" actionid="16282" script="battleFieldJoin.lua" />
Lua:
function onStepIn(creature, item, position, fromPosition)
    if (creature:isPlayer()) then
        local player = creature
        local tpBack = false

        if (battleFieldEvent:getStatus() == battleFieldEvent.status.STATUS_WAITING) then
            if (battleFieldEvent:getMemberStatus(player) == battleFieldEvent.status.STATUS_INACTIVE) then
                if (player:getLevel() < battleFieldEvent.config.minLevel) then
                    msg = battleFieldEvent.name.." Sorry, you don't have enough level to enter to event"
                    tpBack = true
                else
                    msg = battleFieldEvent.name.." You have entered to wait area"
                    battleFieldEvent:addMemberToWait(player)
                end
            end
        else
            msg = "Event is not available yet."
            tpBack = true
        end

        if (msg ~= "") then
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, msg)
        end
        if (tpBack) then
            player:teleportTo(fromPosition)
        end
    end

    return true
end
That's it
Thank you in advance whoever helps
 
I tried to create a team battle war event revescript
But I am facing problems. The first problem is when the player goes to the waiting room, if he moves from the specified tile in the event, he will not go to the battlefield. The second problem is when players enter the arena, one team can attack each other, and the last problem is when you kill players in the event, you will not be sent to the temple to another. The specified event time and you will not get the prize. I have completed a large part of the event. I hope someone can help me
my script
Lua:
local TeamBattleEvent = {
    isActive = false,
    teams = {
        red = {},
        blue = {}
    },
    eventStartTime = 0,
    eventDuration = 10 * 60 * 1000, -- 10 minutes in milliseconds
    waitingRoomPosition = {x = 2828, y = 3063, z = 6}, -- change to your waiting room position
    battlePositions = {
        red = {x = 1349, y = 2677, z = 9}, -- change to your red team battle position
        blue = {x = 1333, y = 2661, z = 7} -- change to your blue team battle position
    },
    teleportPosition = {x = 2995, y = 3113, z = 7}, -- change to your teleport creation position
    templePosition = {x = 2993, y = 3113, z = 7}, -- change to your temple position
    waitingTime = 5 * 60 * 1000, -- 5 minutes in milliseconds
    minPlayers = 2,
    maxPlayers = 100,
    scheduledTimes = {
        {hour = 16, minute = 52},
        {hour = 12, minute = 58},
        {hour = 1, minute = 0}
    },

    rewards = {
        {itemID = 2160, count = 3}, -- ID and count of the first reward item
        {itemID = 2152, count = 2}, -- ID and count of the second reward item
        {itemID = 2148, count = 1}, -- ID and count of the third reward item
    },
    lastAttemptTime = 0,
    attemptCooldown = 60 * 1000, -- Cooldown period in milliseconds (1 minute)
}

function TeamBattleEvent:createWaitingRoomTeleport()
    -- Create teleport to waiting room
    local teleport = Game.createItem(1387, 1, self.teleportPosition)
    teleport:setDestination(self.waitingRoomPosition)
    Game.broadcastMessage("[TeamBattleEvent] The event has been opened and awaits players. You have 5 minute(s) to enter.", MESSAGE_EVENT_ADVANCE)

    -- Schedule checking the waiting room
    addEvent(function()
        Game.broadcastMessage("[TeamBattleEvent] The event has been opened and awaits players. You have 3 minute(s) to enter.", MESSAGE_EVENT_ADVANCE)
    end, 2 * 60 * 1000) -- 2 minutes

    addEvent(function()
        Game.broadcastMessage("[TeamBattleEvent] The event has been opened and awaits players. You have 1 minute(s) to enter.", MESSAGE_EVENT_ADVANCE)
    end, 4 * 60 * 1000) -- 4 minutes

    addEvent(function()
        self:checkWaitingRoom()
    end, self.waitingTime)
end

function TeamBattleEvent:checkWaitingRoom()
    local waitingRoomPlayers = {}
    for _, player in ipairs(Game.getPlayers()) do
        if player:getPosition().x == self.waitingRoomPosition.x and player:getPosition().y == self.waitingRoomPosition.y and player:getPosition().z == self.waitingRoomPosition.z then
            table.insert(waitingRoomPlayers, player)
        end
    end

    local totalPlayers = #waitingRoomPlayers
    if totalPlayers < self.minPlayers then
        Game.broadcastMessage("Not enough players to start the event. Moving players to the temple.", MESSAGE_STATUS_WARNING)
        for _, player in ipairs(waitingRoomPlayers) do
            player:teleportTo(self.templePosition)
        end
        self:endEvent(true)
        return
    end

    self.isActive = true
    self.eventStartTime = os.time() * 1000

    -- Divide players into teams
    for i, player in ipairs(waitingRoomPlayers) do
        if i % 2 == 0 then
            table.insert(self.teams.red, player)
        else
            table.insert(self.teams.blue, player)
        end
    end

    -- Broadcast players who joined
    local playerNames = {}
    for _, player in ipairs(waitingRoomPlayers) do
        table.insert(playerNames, player:getName())
    end
    Game.broadcastMessage("[TeamBattleEvent] Players who joined: " .. table.concat(playerNames, ", "), MESSAGE_EVENT_ADVANCE)

    -- Move players to the battlefield
    self:movePlayersToBattlefield()
end

function TeamBattleEvent:movePlayersToBattlefield()
    -- Remove teleport to waiting room
    local teleport = Tile(self.teleportPosition):getItemById(1387)
    if teleport then
        teleport:remove()
    end

    -- Move players to battlefield
    for _, player in ipairs(self.teams.red) do
        player:teleportTo(self.battlePositions.red)
    end
    for _, player in ipairs(self.teams.blue) do
        player:teleportTo(self.battlePositions.blue)
    end
    Game.broadcastMessage("The Team Battle event has started! Good luck to both teams!", MESSAGE_EVENT_ADVANCE)
end

function TeamBattleEvent:endEvent(insufficientPlayers)
    if not self.isActive then
        Game.broadcastMessage("No active team battle event to end.", MESSAGE_STATUS_WARNING)
        return
    end

    self.isActive = false
    local redTeamCount = #self.teams.red
    local blueTeamCount = #self.teams.blue

    -- Broadcast event result
    local eventResultMessage = "Team battle event has ended! "
    if insufficientPlayers then
        eventResultMessage = eventResultMessage .. "Not enough players to start the event. "
    else
        if redTeamCount > blueTeamCount then
            eventResultMessage = eventResultMessage .. "Red Team wins!"
            for _, player in ipairs(self.teams.red) do
                player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Congratulations! Your team won the Team Battle event!")
            end
            self:giveRewards(self.teams.red)
        elseif blueTeamCount > redTeamCount then
            eventResultMessage = eventResultMessage .. "Blue Team wins!"
            for _, player in ipairs(self.teams.blue) do
                player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Congratulations! Your team won the Team Battle event!")
            end
            self:giveRewards(self.teams.blue)
        else
            eventResultMessage = eventResultMessage .. "It's a draw!"
        end
    end
    Game.broadcastMessage(eventResultMessage, MESSAGE_EVENT_ADVANCE)

    -- Clear teams
    self.teams.red = {}
    self.teams.blue = {}

    -- Teleport players to temple
    for _, player in ipairs(Game.getPlayers()) do
        player:teleportTo(self.templePosition)
    end
end

function TeamBattleEvent:giveRewards(team)
    for _, player in ipairs(team) do
        for _, reward in ipairs(self.rewards) do
            player:addItem(reward.itemID, reward.count)
        end
    end
end

local function onThink()
    local currentTime = os.time() * 1000
    if TeamBattleEvent.isActive and (currentTime - TeamBattleEvent.eventStartTime) >= TeamBattleEvent.eventDuration then
        TeamBattleEvent:endEvent()
    end

    -- Check for scheduled event start times
    local currentTimeTable = os.date("*t")
    for _, scheduledTime in ipairs(TeamBattleEvent.scheduledTimes) do
        if currentTimeTable.hour == scheduledTime.hour and currentTimeTable.min == scheduledTime.minute and not TeamBattleEvent.isActive then
            -- Check if cooldown has passed since the last attempt
            if (currentTime - TeamBattleEvent.lastAttemptTime) >= TeamBattleEvent.attemptCooldown then
                TeamBattleEvent:createWaitingRoomTeleport()
                TeamBattleEvent.lastAttemptTime = currentTime
            end
        end
    end

    return true
end

local function createGlobalEvent(eventName, callback, interval)
    local eventId = nil

    local function onGlobalEvent()
        if callback then
            callback()
        end
        if interval then
            eventId = addEvent(onGlobalEvent, interval)
        end
    end

    eventId = addEvent(onGlobalEvent, interval)

    return eventId
end

if not createGlobalEvent("TeamBattle", onThink, 1000) then
    print("Failed to start the team battle event global event.")
end

function onPrepareDeath(player, killer)
    if TeamBattleEvent.isActive then
        local isRedTeam = table.contains(TeamBattleEvent.teams.red, player)
        local isBlueTeam = table.contains(TeamBattleEvent.teams.blue, player)

        if isRedTeam or isBlueTeam then
            player:teleportTo(TeamBattleEvent.templePosition)
            player:setHealth(player:getMaxHealth())
            player:setMana(player:getMaxMana())
            doCreatureAddHealth(player, player:getMaxHealth())
            doPlayerAddMana(player, player:getMaxMana())

            if isRedTeam then
                table.removeValue(TeamBattleEvent.teams.red, player)
            else
                table.removeValue(TeamBattleEvent.teams.blue, player)
            end

            local redTeamCount = #TeamBattleEvent.teams.red
            local blueTeamCount = #TeamBattleEvent.teams.blue

            if redTeamCount == 0 or blueTeamCount == 0 then
                if redTeamCount > 0 then
                    for _, redPlayer in ipairs(TeamBattleEvent.teams.red) do
                        redPlayer:teleportTo(TeamBattleEvent.templePosition)
                    end
                    Game.broadcastMessage("[TeamBattleEvent] Red Team wins!", MESSAGE_EVENT_ADVANCE)
                    TeamBattleEvent:giveRewards(TeamBattleEvent.teams.red)
                else
                    for _, bluePlayer in ipairs(TeamBattleEvent.teams.blue) do
                        bluePlayer:teleportTo(TeamBattleEvent.templePosition)
                    end
                    Game.broadcastMessage("[TeamBattleEvent] Blue Team wins!", MESSAGE_EVENT_ADVANCE)
                    TeamBattleEvent:giveRewards(TeamBattleEvent.teams.blue)
                end
                TeamBattleEvent:endEvent()
            end

            return false -- prevent the player from actually dying
        end
    end
    return true
end

function table.contains(table, element)
    for _, value in pairs(table) do
        if value == element then
            return true
        end
    end
    return false
end

function table.removeValue(table, value)
    for i, v in ipairs(table) do
        if v == value then
            table.remove(table, i)
            break
        end
    end
end
    -- Check for scheduled event start times
    local currentTimeTable = os.date("*t")
    for _, scheduledTime in ipairs(TeamBattleEvent.scheduledTimes) do
        if currentTimeTable.hour == scheduledTime.hour and currentTimeTable.min == scheduledTime.minute and not TeamBattleEvent.isActive then
            -- Check if cooldown has passed since the last attempt
            if (currentTime - TeamBattleEvent.lastAttemptTime) >= TeamBattleEvent.attemptCooldown then
                TeamBattleEvent:createWaitingRoomTeleport()
                TeamBattleEvent.lastAttemptTime = currentTime
            end
        end
         return true
    end

local function createGlobalEvent(eventName, callback, interval)
    local eventId = nil

    local function onGlobalEvent()
        if callback then
            callback()
        end
        if interval then
            eventId = addEvent(onGlobalEvent, interval)
        end
    end

    eventId = addEvent(onGlobalEvent, interval)

    return eventId
end

if not createGlobalEvent("TeamBattle", onThink, 1000) then
    print("Failed to start the team battle event global event.")
end

local function onPlayerEnterGame(player)
    if TeamBattleEvent.isActive then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "A Team Battle event is currently active! Join the fun by typing !join red or !join blue.")
    else
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "No active Team Battle event at the moment.")
    end
end

function onTalk(player, words, param)
    local action = talkActions[words:lower()]
    if action then
        action(player, param)
    else
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Unknown command. Available commands: !join, !start, !end.")
    end
    return false
end

registerCreatureEvent(CREATURE_EVENT_ON_TALK, "onTalk")
registerCreatureEvent(CREATURE_EVENT_ON_LOGIN, "onPlayerEnterGame")
 
And then, the data/battleFieldEvent.lua file should be moved to data/lib/battleFieldEvent.lua. It's better this way, as the event system will pull directly from this path and execute the event. Adjust the temple, rewards, and everything else just within the 'lib', ok?
dofile('data/battleFieldEvent.lua')
global.lua or data/lib/lib.lua
Lua:
dofile('data/lib/battleFieldEvent.lua')

data/script revscript.
Lua:
-- Configuration
local config = {
    eventTime = "15:00",
    minutesToStart = 5,
    actionid = 16282
}

-- Global Event
local globalevent = GlobalEvent("battlefield")

local function announceBattleFieldEvent(minutesToStart, otherParameter)
    print("Event will start in " .. minutesToStart .. " minutes.")
end

function globalevent.onTime(interval)
    announceBattleFieldEvent(config.minutesToStart, 0)
    return true
end

globalevent:time(config.eventTime)
globalevent:register()

-- Health Change Event 1
local battlefield_onHealthChange1 = CreatureEvent("battlefield_onHealthChange1")

function battlefield_onHealthChange1.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
    local damage = primaryDamage + secondaryDamage
    local check = battleFieldEvent:canDealDamage(creature, attacker, damage, primaryType)
    if check then
        return primaryDamage, primaryType, secondaryDamage, secondaryType
    else
        return 0, COMBAT_NONE, 0, COMBAT_NONE
    end
end
battlefield_onHealthChange1:register()

-- Mana Change Event 1
local battlefield_onManaChange1 = CreatureEvent("battlefield_onManaChange1")

function battlefield_onManaChange1.onManaChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
    local damage = primaryDamage + secondaryDamage
    local check = battleFieldEvent:canDealDamage(creature, attacker, damage)
    if check then
        return primaryDamage, primaryType, secondaryDamage, secondaryType
    else
        return 0, COMBAT_NONE, 0, COMBAT_NONE
    end
end
battlefield_onManaChange1:register()

-- Health Change Event 2
local battlefield_onHealthChange2 = CreatureEvent("battlefield_onHealthChange2")

function battlefield_onHealthChange2.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
    local myHealth = creature:getHealth()

    if not attacker then
        return 0, primaryType, 0, secondaryType
    end

    local sameTeam = false
    local myTeam = battleFieldEvent:getTeam(creature)
    local totalDamage = primaryDamage + secondaryDamage

    if attacker:isMonster() then
        local team = battleFieldEvent:getOwnerTeam(attacker)
        if not team then
            return primaryDamage, primaryType, secondaryDamage, secondaryType
        end
        attacker = attacker:getMaster()
        if team == myTeam then
            sameTeam = true
        end
    else
        local team = battleFieldEvent:getTeam(attacker)
        if team == myTeam then
            sameTeam = true
        end
    end

    if sameTeam then
        if primaryType ~= COMBAT_HEALING and secondaryType ~= COMBAT_HEALING then
            return 0, primaryType, 0, secondaryType
        end
    else
        if primaryType == COMBAT_HEALING or secondaryType == COMBAT_HEALING then
            return 0, primaryType, 0, secondaryType
        end

        if totalDamage >= myHealth then
            battleFieldEvent:removeMember(creature, attacker)
            return 0, primaryType, 0, secondaryType
        end
    end

    return primaryDamage, primaryType, secondaryDamage, secondaryType
end
battlefield_onHealthChange2:register()

-- Mana Change Event 2
local battlefield_onManaChange2 = CreatureEvent("battlefield_onManaChange2")

function battlefield_onManaChange2.onManaChange(creature, attacker, manaChange, origin)
    if not attacker then return manaChange end

    local sameTeam = false
    local myTeam = battleFieldEvent:getTeam(creature)
    local attackerTeam

    if attacker:isMonster() then
        attackerTeam = battleFieldEvent:getOwnerTeam(attacker)
        if not attackerTeam then
            return manaChange
        end
    else
        attackerTeam = battleFieldEvent:getTeam(attacker)
    end

    if attackerTeam == myTeam then
        sameTeam = true
    end

    if sameTeam then
        return 0
    end

    return manaChange
end
battlefield_onManaChange2:register()

-- Battlefield Join Event
local battleFieldJoin = MoveEvent()

function battleFieldJoin.onStepIn(creature, item, position, fromPosition)
    if creature:isPlayer() then
        local player = creature
        local tpBack = false
        local msg = ""

        if battleFieldEvent:getStatus() == battleFieldEvent.status.STATUS_WAITING then
            if battleFieldEvent:getMemberStatus(player) == battleFieldEvent.status.STATUS_INACTIVE then
                if player:getLevel() < battleFieldEvent.config.minLevel then
                    msg = battleFieldEvent.name .. " Sorry, you don't have enough level to enter the event."
                    tpBack = true
                else
                    msg = battleFieldEvent.name .. " You have entered the waiting area."
                    battleFieldEvent:addMemberToWait(player)
                end
            end
        else
            msg = "Event is not available yet."
            tpBack = true
        end

        if msg ~= "" then
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, msg)
        end

        if tpBack then
            player:teleportTo(fromPosition)
        end
    end
    return true
end

battleFieldJoin:aid(config.actionid)
battleFieldJoin:register()
 
Last edited:
I'm trying to create an event but I'm having two problems. The first is that the team can attack each other
Second: The winning team does not receive the prize and is not sent to the temple until after the event ends. This is my Revscript
Lua:
local GamelaOts860 = {
    config = {
        totalPlayers = 50,
        waitAreaPos = Position(2828, 3063, 6),
        started = false,
        msg = 0,
        timeToStart = 1,
        minutesToEnd = 3,
        messageColor = 210
    },

    functions = {
        queueEvent = function(time, self)
            time = time - 1
            if time > 0 then
                Game.broadcastMessage('Battle Field Event is starting in ' .. time .. (time > 1 and " minutes!" or " minute!"), MESSAGE_STATUS_CONSOLE_ORANGE, msg)
                addEvent(self.functions.queueEvent, 1 * 60 * 1000, time, self)
            else
                local red, blue = self.functions.aux.getTotalTeamPlayers(self)
                if red + blue >= 2 then
                    self.functions.startBattlefield(self)
                else
                    self.functions.stopEvent(self, true)
                end
            end
        end,
        startEvent = function(self)
            self.eventtp = Game.createItem(1387, 1, Position(2995, 3111, 7))
            self.eventtp:setActionId(17555)
            Game.broadcastMessage('The portal to Battle Field Event was opened inside Gamelaots temple.', MESSAGE_STATUS_CONSOLE_ORANGE, msg)
            self.functions.queueEvent(self.config.timeToStart + 1, self)
        end,
        stopEvent = function(self, npe)
            local winner
            if self.eventtp then
                self.eventtp:remove()
                self.eventtp = nil
            end
            if npe then
                Game.broadcastMessage('The Battle Field Event was canceled due not enough players.', MESSAGE_STATUS_CONSOLE_ORANGE, msg)
            else
                Game.broadcastMessage('The Battle Field Event was finished.', MESSAGE_STATUS_CONSOLE_ORANGE, msg)
                self.config.started = false
                local red, blue = self.functions.aux.getTotalTeamPlayers(self)
                if red == blue then
                    Game.broadcastMessage('We have a DRAW. No one won this event.', MESSAGE_STATUS_CONSOLE_ORANGE, msg)
                elseif red > blue then
                    winner = 'red'
                    Game.broadcastMessage('Congratulations to the Red Team for winning this event! +15 Tournament coins!', MESSAGE_STATUS_CONSOLE_ORANGE, msg)
                else
                    winner = 'blue'
                    Game.broadcastMessage('Congratulations to the Blue Team for winning this event! +15 Tournament coins!', MESSAGE_STATUS_CONSOLE_ORANGE, msg)
                end
            end
            
            for k, player in pairs(self.teams.players) do
                local playerObject = Player(player.pid)
                if playerObject then
                    playerObject:setHealth(playerObject:getMaxHealth())
                    playerObject:teleportTo(Position(2993, 3113, 7))
                    playerObject:setOutfit(player.outfit)
                    if not npe and player.team == winner then
                        playerObject:addEventCoins(15)
                    end
                end
            end
            self.teams.players = {}
            self.config.started = false
        end,
        enterEvent = function(self, pid, fromPosition)
    local player = Player(pid)
    if not player then return true end

    if #self.teams.players >= self.config.totalPlayers then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The event reached the maximum number of players.")
        return true
    end

    if self.functions.aux.checkIfPlayerIsAlreadyInEvent(self, pid) then
        player:teleportTo(fromPosition)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "MC's are not allowed.")
        return true
    end

    self.functions.aux.selectTeamToPlayer(self, player)
end,

        startBattlefield = function(self)
    self.eventtp:remove()
    self.eventtp = nil
    for k, player in pairs(self.teams.players) do
        local playerObject = Player(player.pid)
        if playerObject then
            playerObject:teleportTo(self.teams[player.team].safePos)
        end
    end

    self.config.started = true
    self.config.time = os.time() + self.config.minutesToEnd * 60
    Game.broadcastMessage('Battle Field Event has started!', MESSAGE_STATUS_CONSOLE_ORANGE, msg)

    local red, blue = self.functions.aux.getTotalTeamPlayers(self)
    if red == 0 then
        Game.broadcastMessage('Congratulations to the Blue Team for winning this event! +15 Tournament coins!', MESSAGE_STATUS_CONSOLE_ORANGE, msg)
    elseif blue == 0 then
        Game.broadcastMessage('Congratulations to the Red Team for winning this event! +15 Tournament coins!', MESSAGE_STATUS_CONSOLE_ORANGE, msg)
    end
end,

        aux = {
            removePlayerFromEvent = function(self, pid)
                local newPlayers = {}
                for k, player in pairs(self.teams.players) do
                    if player.pid ~= pid then
                        table.insert(newPlayers, player)
                    end
                end
                self.teams.players = newPlayers
                return true
            end,
            checkIfPlayerIsAlreadyInEvent = function(self, pid)
    for k, player in pairs(self.teams.players) do
        if player.pid == pid then
            return player
        end
    end
    return false
end,
            getTotalTeamPlayers = function(self)
                local red = 0
                local blue = 0
                for k, player in pairs(self.teams.players) do
                    red = player.team == 'red' and red + 1 or red
                    blue = player.team == 'blue' and blue + 1 or blue
                end
                return red, blue
            end,
            selectTeamToPlayer = function(self, player)
                local red, blue = self.functions.aux.getTotalTeamPlayers(self)
                
                if red == 0 and blue == 0 then
                    table.insert(self.teams.players, {
                        pid = player:getId(),
                        team = 'red',
                        outfit = player:getOutfit()
                    })
                    player:setOutfit({lookType = self.teams.red.outfit.lookType, lookFeet = self.teams.red.outfit.lookFeet, lookBody = self.teams.red.outfit.lookBody, lookLegs = self.teams.red.outfit.lookLegs, lookHead = self.teams.red.outfit.lookHead, lookAddons = 0})
                elseif red > blue then
                    table.insert(self.teams.players, {
                        pid = player:getId(),
                        team = 'blue',
                        outfit = player:getOutfit()
                    })
                    player:setOutfit({lookType = self.teams.blue.outfit.lookType, lookFeet = self.teams.blue.outfit.lookFeet, lookBody = self.teams.blue.outfit.lookBody, lookLegs = self.teams.blue.outfit.lookLegs, lookHead = self.teams.blue.outfit.lookHead, lookAddons = 0})
                else
                    table.insert(self.teams.players, {
                        pid = player:getId(),
                        team = 'red',
                        outfit = player:getOutfit()
                    })
                    player:setOutfit({lookType = self.teams.red.outfit.lookType, lookFeet = self.teams.red.outfit.lookFeet, lookBody = self.teams.red.outfit.lookBody, lookLegs = self.teams.red.outfit.lookLegs, lookHead = self.teams.red.outfit.lookHead, lookAddons = 0})
                end
                
                player:teleportTo(self.config.waitAreaPos)
                Position:sendMagicEffect(CONST_ME_TELEPORT)
                Game.broadcastMessage('The player ' .. player:getName() .. ' entered the Battle Field Event.', MESSAGE_STATUS_CONSOLE_ORANGE, msg)
            end
        }
    },

    teams = {
        players = {},
        ['red'] = {
            outfit = {
                lookType = 157,
                lookHead = 88,
                lookBody = 88,
                lookLegs = 88,
                lookFeet = 88,
                lookAddons = 1,
                lookMount = 0
            },
            safePos = Position(1349, 2677, 9)
        },
        ['blue'] = {
            outfit = {
                lookType = 157,
                lookHead = 94,
                lookBody = 94,
                lookLegs = 94,
                lookFeet = 94,
                lookAddons = 1,
                lookMount = 0
            },
            safePos = Position(1333, 2661, 7)
        }
    }
}

local bGamelaOts860 = GamelaOts860

-- Move events
local battleFieldEventEnter = MoveEvent()

function battleFieldEventEnter.onStepIn(creature, item, position, fromPosition)
    if not creature:isPlayer() then
        return false
    end
    
    GamelaOts860.functions.enterEvent(GamelaOts860, creature:getId(), fromPosition)
    Position:sendMagicEffect(CONST_ME_TELEPORT)
    return true
end

battleFieldEventEnter:aid(17555)
battleFieldEventEnter:register()

-- Start
-- Talk Actions
local BattleFieldEvent = TalkAction("!battlefield")
function BattleFieldEvent.onSay(player, words, param)
    if not player:getGroup():getAccess() then
        return true
    end
    
    if player:getAccountType() < ACCOUNT_TYPE_GOD then
        return false
    end
    
    GamelaOts860.functions.startEvent(GamelaOts860)

    return false
end
BattleFieldEvent:register()

-- Cancel
local BattleFieldEventCancel = TalkAction("!battlefieldc")
function BattleFieldEventCancel.onSay(player, words, param)
    if not player:getGroup():getAccess() then
        return true
    end
    
    if player:getAccountType() < ACCOUNT_TYPE_GOD then
        return false
    end
    
    GamelaOts860.functions.stopEvent(GamelaOts860)

    return false
end
BattleFieldEventCancel:register()

-- OnPrepareDeath
local battleFieldDeath = CreatureEvent("battlefield_PrepareDeath")
function battleFieldDeath.onPrepareDeath(player, killer)
    if player then
        local playerInEvent = GamelaOts860.functions.aux.checkIfPlayerIsAlreadyInEvent(GamelaOts860, player:getId())
        if playerInEvent then
            GamelaOts860.functions.aux.removePlayerFromEvent(GamelaOts860, player:getId())
            player:teleportTo(Position(2993, 3113, 7))
            Position:sendMagicEffect(CONST_ME_TELEPORT)
            player:setOutfit(playerInEvent.outfit)
            player:setHealth(player:getMaxHealth())
            if killer then
                player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You were killed by " .. killer:getName() .. " in Battle Field Event.")
            else
                player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You were killed in Battle Field Event.")
            end
            return false
        end
    end
    return true
end
battleFieldDeath:register()

-- OnLogout
local battlefieldLogout = CreatureEvent("battlefield_Logout")
function battlefieldLogout.onLogout(player)
    if GamelaOts860.config.started then
        if player then
            player:teleportTo(Position(2993, 3113, 7))
            GamelaOts860.functions.aux.removePlayerFromEvent(GamelaOts860, player:getId())
        end
    end
    return true
end

battlefieldLogout:register()

-- Global Event
local battleFieldGlobalEvent = GlobalEvent("battleFieldGlobalEvent")

function battleFieldGlobalEvent.onThink(interval)
    if GamelaOts860.config.started then
        local red, blue = GamelaOts860.functions.aux.getTotalTeamPlayers(GamelaOts860)
        if red == 0 or blue == 0 then
            GamelaOts860.functions.stopEvent(GamelaOts860)
        elseif GamelaOts860.config.time <= os.time() then
            GamelaOts860.functions.stopEvent(GamelaOts860)
        end
    end
    return true
end

battleFieldGlobalEvent:interval(3000)
battleFieldGlobalEvent:register()
 
Back
Top