• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

[MOD] Rush Event / Team Battle with scores

I don't understand what's the problem lol
mm there are many problems not one :D
1-the player who die on this event he tp to temple pos not event pos
2-system isn't counting the deaths
3-event got unlimited time
4-and there are many problems like these people said
5-that's all i remember till now ;D btw ur photo is amazing :)
 
mm there are many problems not one :D
1-the player who die on this event he tp to temple pos not event pos
2-system isn't counting the deaths
3-event got unlimited time
4-and there are many problems like these people said
5-that's all i remember till now ;D btw ur photo is amazing :)
 

Attachments

will re-script it when I've time I guess

EDIT: whoever wrote this event PM me, I give 5$ for you to STOP SCRIPTING.

The place is A TOTAL MESS! What was he drinking before he started writing lol, only 1 member gets reward etc... I will fix it but I don't think ima make it as a mod :P
 
Last edited:
will re-script it when I've time I guess

EDIT: whoever wrote this event PM me, I give 5$ for you to STOP SCRIPTING.

The place is A TOTAL MESS! What was he drinking before he started writing lol, only 1 member gets reward etc... I will fix it but I don't think ima make it as a mod :p
First I would like to thank you that you the only one who wants to help us, and thank you also for you aren't cocky like some people and want to help the beginners ,does not matter if it is mod or anything else important to have good-to-use
Thank you again
 
I don't have one for 0.3.6, if someone wants to hire me to do one for 0.3.6 / 0.4 I would.
I can also make these to 1.0, have done 2 before, so just send me a pm if you are looking for a working one.
 
If u change ur outfit color in event ur team can kill u loolzz how to solv this problem any aswers plss??
 
If u change ur outfit color in event ur team can kill u loolzz how to solv this problem any aswers plss??

I think the MOD already have a creaturescript "onchangeoutfit" (something like this), just type to code "return false", to cancel the action. Its easy.

EDIT: Ops, and dont forget to check player storage (set in event) to don't cancel every player in the server trying to change outfit.
 
I think the MOD already have a creaturescript "onchangeoutfit" (something like this), just type to code "return false", to cancel the action. Its easy.

EDIT: Ops, and dont forget to check player storage (set in event) to don't cancel every player in the server trying to change outfit.


I dont know how to use storage in rush event any examples pls.
 
On the off chance anyone is still using this garbage, I had someone ask me for help with a problem they were having with it and in the process of trying to figure out just what the fuck this spaghetti is up to, I refactored the everloving shit out of it.

It's available here.

It's still garbage code, and the original authors should feel ashamed and have a lot to answer for, but it's better than it was.
 
Last edited:
Hello, i give the RUSH EVENT in revscript, tested on tfs 1.5 and works fine.

Here we go:

Code:
-- ==========================================================
-- RUSH EVENT - ARENA SCANNER & FRAGS EDITION
-- Correct score counting, team protection, and kick to temple
-- ==========================================================

local RushEvent = {
    storage = {
        active = 32145,       -- Global: is registration open
        joinCount = 32146,    -- Global: registered players counter
        redFrags = 32147,     -- Global: red team frags
        blueFrags = 32148,    -- Global: blue team frags
        started = 32149,      -- Global: has the arena battle started
        
        teamStorage = 32150,  -- Player: 1 = RED, 2 = BLUE
        playerJoined = 32151  -- Player: 1 = registered, -1 = not registered
    },
    
    msgStart = "Rush Event has been started! Enjoy and have fun!",
    msgNoPlayers = "Event won't start because too few people were willing to participate.",
    msgRedWin = "Event was completed, RED TEAM has won Rush Event!",
    msgBlueWin = "Event was completed, BLUE TEAM has won Rush Event!",
    
    posRedTemple = Position(2580, 2356, 7),
    posBlueTemple = Position(2637, 2324, 7),
    posWaitingRoom = Position(2610, 2402, 7),
    
    -- ARENA AREA EDGES
    arenaFromPos = Position(2576, 2320, 7),  -- Top-left corner of the arena
    arenaToPos = Position(2647, 2369, 7),    -- Bottom-right corner of the arena
    
    minLevel = 100,
    requiredFrags = 2, -- How many frags are needed to win
    minPlayers = 2,
    maxPlayers = 40,
    
    rewardId = 2160, -- Crystal Coin
    rewardCount = 10,
    
    timeToStart = 1, -- in minutes (registration time)
    timeToResults = 1, -- how often to display score results (in minutes)
    maxFightTime = 15 -- maximum battle time in minutes (safety switch)
}

-- RAM auxiliary variables
local fightStartTime = 0
local lastMinutesAnnounced = 0
local playersInArenaLastScan = {} -- Used to detect who died/left

-- Forward declarations
local arenaScanner
local broadcastResultsLoop

-- ==========================================
-- 2. AUXILIARY FUNCTIONS AND CLEANUP
-- ==========================================
function RushEvent.clear()
    Game.setStorageValue(RushEvent.storage.active, 0)
    Game.setStorageValue(RushEvent.storage.joinCount, 0)
    Game.setStorageValue(RushEvent.storage.redFrags, 0)
    Game.setStorageValue(RushEvent.storage.blueFrags, 0)
    Game.setStorageValue(RushEvent.storage.started, 0)
    fightStartTime = 0
    lastMinutesAnnounced = 0
    playersInArenaLastScan = {}
    
    for _, player in ipairs(Game.getPlayers()) do
        if player:getStorageValue(RushEvent.storage.playerJoined) == 1 then
            player:setStorageValue(RushEvent.storage.playerJoined, -1)
            player:setStorageValue(RushEvent.storage.teamStorage, -1)
            player:unregisterEvent("RushCombat")
            player:unregisterEvent("RushOutfit")
        end
    end
end

function RushEvent.endEvent(winnerTeam)
    if winnerTeam == 1 then
        Game.broadcastMessage(RushEvent.msgRedWin, MESSAGE_STATUS_WARNING)
    elseif winnerTeam == 2 then
        Game.broadcastMessage(RushEvent.msgBlueWin, MESSAGE_STATUS_WARNING)
    else
        Game.broadcastMessage("Rush Event ended in a draw!", MESSAGE_STATUS_WARNING)
    end
    
    for _, player in ipairs(Game.getPlayers()) do
        if player:getStorageValue(RushEvent.storage.playerJoined) == 1 then
            if winnerTeam ~= 0 and player:getStorageValue(RushEvent.storage.teamStorage) == winnerTeam then
                player:addItem(RushEvent.rewardId, RushEvent.rewardCount)
                player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Congratulations! Your team won the event. You received your reward.")
            end
            
            player:teleportTo(player:getTown():getTemplePosition())
            player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
            player:addHealth(player:getMaxHealth() - player:getHealth())
            player:addMana(player:getMaxMana() - player:getMana())
            player:removeCondition(CONDITION_INFIGHT)
        end
    end
    RushEvent.clear()
end

broadcastResultsLoop = function()
    if Game.getStorageValue(RushEvent.storage.started) ~= 1 then return end
    
    local red = Game.getStorageValue(RushEvent.storage.redFrags) or 0
    local blue = Game.getStorageValue(RushEvent.storage.blueFrags) or 0
    
    Game.broadcastMessage("Rush Events, results:\nRed Team scored: " .. red .. " frags.\nBlue Team scored: " .. blue .. " frags.\nMatch is under way to " .. RushEvent.requiredFrags .. " frags.", MESSAGE_STATUS_WARNING)
    addEvent(broadcastResultsLoop, RushEvent.timeToResults * 60 * 1000)
end

-- ==========================================================
-- 3. ARENA AREA SCANNER (Score Counting & Battle Control)
-- ==========================================================
arenaScanner = function()
    if Game.getStorageValue(RushEvent.storage.started) ~= 1 then return end

    -- 1. Time safety switch
    local timePassed = os.time() - fightStartTime
    local maxSeconds = RushEvent.maxFightTime * 60
    if timePassed >= maxSeconds then
        RushEvent.endEvent(0) -- Draw, time out
        return
    end

    -- 2. Fetch players currently standing in the arena
    local currentPlayersInArena = {}

    for x = RushEvent.arenaFromPos.x, RushEvent.arenaToPos.x do
        for y = RushEvent.arenaFromPos.y, RushEvent.arenaToPos.y do
            local tile = Tile(Position(x, y, RushEvent.arenaFromPos.z))
            if tile then
                local creatures = tile:getCreatures()
                if creatures then
                    for _, creature in ipairs(creatures) do
                        if creature:isPlayer() and creature:getStorageValue(RushEvent.storage.playerJoined) == 1 then
                            local guid = creature:getGuid()
                            currentPlayersInArena[guid] = creature
                        end
                    end
                end
            end
        end
    end

    -- 3. Detect who disappeared (was
 
Back
Top