bodycarcoo11
Mapper
So here's the rules. You need to reconfigure your config, then config.minPlayers players must stand in area of event and they'll be teleported to the battle arena. The last one that survives wins the prize (configurable). Enjoy.
/globalevents/scripts/arena.lua
Lua Code:
/globalevents/globalevents.xml
XML Code:
And This IS The Aena Of The Last Man Standing Enjoy
Example map:
http://speedy*****malware.localhost/FRpyc/DopeNiggah.otbm
If You Like REP++
After All Of That You Will NEeD The Script Of Talkaction
enter this in data/talkactions/talkactions/xml
XML Code:
And Put This In data/talkactions/scripts/lms on.lua
LUA Code:
EnJoy
/globalevents/scripts/arena.lua
Lua Code:
Code:
local config = {
temporaryArea = {
{x = 296, y = 298, z = 7}, -- northwest corner of area where players must stand in order to join the event
{x = 296, y = 297, z = 7} -- south east corner
},
arenaArea = {
{x = 139, y = 138, z = 6}, -- nw corner of arena
{x =137 , y = 140, z = 6}, -- se corner of arena
{x = 138, y = 140, z = 6} -- center of arena
},
minPlayers = 2, -- in players required to start the battle
prize = {2157, 5467} -- rewards
}
function onThink(interval, lastExecution, thinkInterval)
local players, arenaPlayers = {}, {}
for x = (config.temporaryArea)[1].x, (config.temporaryArea)[2].x do
for y = (config.temporaryArea)[1].y, (config.temporaryArea)[2].y do
for z = (config.temporaryArea)[1].z, (config.temporaryArea)[2].z do
if(isPlayer(getTopCreature({x = x, y = y, z = z}).uid)) then
table.insert(players, getTopCreature({x = x, y = y, z = z}).uid)
end
end
end
end
for x = (config.arenaArea)[1].x, (config.arenaArea)[2].x do
for y = (config.arenaArea)[1].y, (config.arenaArea)[2].y do
for z = (config.arenaArea)[1].z, (config.arenaArea)[2].z do
if(isPlayer(getTopCreature({x = x, y = y, z = z}).uid)) then
table.insert(arenaPlayers, getTopCreature({x = x, y = y, z = z}).uid)
end
end
end
end
if(table.maxn(arenaPlayers) == 1) then
doTeleportThing(arenaPlayers[1], getPlayerMasterPos(arenaPlayers[1]))
doSendMagicEffect(getPlayerMasterPos(arenaPlayers[1]), CONST_ME_TELEPORT)
doPlayerSendTextMessage(arenaPlayers[1], MESSAGE_STATUS_CONSOLE_BLUE, "You win a battle and recived your reward.")
doPlayerAddItem(arenaPlayers[1], (config.prize)[math.random(1, table.maxn(config.prize))], 1)
elseif(table.maxn(arenaPlayers) < 1) then
if(table.maxn(players) >= config.minPlayers) then
for i = 1, config.minPlayers do
doTeleportThing(players[i], (config.arenaArea)[3])
doSendMagicEffect((config.arenaArea)[3], CONST_ME_TELEPORT)
doPlayerSendTextMessage(players[i], MESSAGE_STATUS_WARNING, "The battle begins. Survive for glory!")
end
end
end
return true
end
XML Code:
Code:
<globalevent name="arena" interval="10" event="script" value="arena.lua"/>
Example map:
http://speedy*****malware.localhost/FRpyc/DopeNiggah.otbm
If You Like REP++
After All Of That You Will NEeD The Script Of Talkaction
enter this in data/talkactions/talkactions/xml
XML Code:
Code:
<talkaction log="yes" words="/lms start" access="6" event="script"
value="lms on.lua"/>
LUA Code:
Code:
function onSay(cid, words, param, channel)
if(getStorage(ZE_STATUS) ~= 2) then
local players_on_arena_count = #getLastmanstandingEventPlayers()
if(param == 'force') then
if(players_on_arena_count > 0) then
setlastmanstandingEventPlayersLimit(players_on_arena_count )
addlastmanstandingEventBlockEnterPosition()
doSetStorage(ZE_STATUS, 2)
doBroadcastMessage("lastmanstanding Event started.")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "lastmanstanding event started.")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Cannot start lastmanstanding event. There is no players on arena.")
end
else
if(param ~= '' and tonumber(param) > 0) then
setlastmanstandingEventPlayersLimit(tonumber(param))
end
removelastmanstandingEventBlockEnterPosition()
doSetStorage(ZE_STATUS, 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Event started.")
doPlayerBroadcastMessage(cid, "lastmanstanding Arena Event teleport is opened. We are waiting for " .. getlastmanstandingEventPlayersLimit() - players_on_arena_count .. " players to start.")
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "lastmanstanding event is already running.")
end
return true
end
Last edited: