ghettobird
LUA newbie
I don't understand what's the problem lol
mm there are many problems not oneI don't understand what's the problem lol
mm there are many problems not one
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![]()
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-usewill 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![]()
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.
So post the script please....
[string "loadBuffer"]:10: attempt to concatenate field 't' (a nil value)
stack traceback:
[string "loadBuffer"]:10: in function <[string "loadBuffer"]:2>
-- ==========================================================
-- 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