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

GlobalEvent Last man Standing Event 100% Working

Like Cykotitan said, The globalevents executes every 36 seconds

Change that in globalevents.xml
<globalevent name="LastMan" interval="36000" event="script" value="lms/lastman.lua"/>
<globalevent name="arena" interval="36120" event="script" value="lms/arena.lua"/>

try it, it might work.
 
when i fight in the last man i have injustfied on the player i killed
and he lose lvl and bp falls from him

i dont have any error and

if it can be in the map just tell me
 
there is no creaturescript so when you get killed in the (Arena) it tp'd people back to temple or where ever you want it to go that is why people are losing level's and there bp's i would suggest you make a creaturescript.lua
 
Hey, Trying to get this thing work. But it doesn't work that well, I think it's something with my arena.lua that buggs. My character doesn't teleports into the arena when it's suppoused to.


Lua:
local t = { 
 tmp = { 
 {x = 916, y = 946, z = 7}, -- North west corner of Area where players must stand in order to join the event 
 {x = 919, y = 949, z = 7} -- South east corner of Area
 }, 
 arena = { 
 {x = 908, y = 931, z = 7}, -- North west Corner of Arena 
 {x = 927, y = 944, z = 7}, -- South East corner of Arena 
 {x = 917, y = 937, z = 7} -- Center of Arena 
 }, 

 from = {x = 908, y = 931, z = 6}, -- Top left cornor of the playground (random players teleportation) 
 to = {x = 925, y = 943, z = 6}, -- Bottom right cornor of the playground (random players teleportation) 

 minPlayers = 1, -- min players required to start the battle 
 noPlayers = 1, -- Leave it as it is 
 prize = {2160} -- Reward that player recives 
 } 
 local kick = 0 

 function onThink() 
 local arenaPlayers = {} 

 for x = t.arena[1].x, t.arena[2].x do 
 for y = t.arena[1].y, t.arena[2].y do 
 for z = t.arena[1].z, t.arena[2].z do 
 local pos = {x = x, y = y, z = z} 
 local n = getTileInfo(pos).creatures 
 if n ~= 0 then 
 pos.stackpos = 1 
 local c = getThingfromPos(pos) 
 while c.uid ~= 0 do 
 if c.itemid == 1 and c.type == 1 then 
 table.insert(arenaPlayers, c.uid) 
 if #arenaPlayers == n then 
 break 
 end 
 end 
 pos.stackpos = pos.stackpos + 1 
 c = getThingfromPos(pos) 
 end 
 end 
 end 
 end 
 end 

 if #arenaPlayers == 1 then 
 local p = getPlayerMasterPos(arenaPlayers[1]) 
 doTeleportThing(arenaPlayers[1], p) 
 doSendMagicEffect(p, CONST_ME_TELEPORT) 
 doPlayerSendTextMessage(arenaPlayers[1], MESSAGE_STATUS_CONSOLE_BLUE, "You have won the event and received your reward.") 
 doBroadcastMessage(getCreatureName(arenaPlayers[1]) .." won a Last Man Standing Event.") 
 doPlayerAddItem(arenaPlayers[1], t.prize[math.random(#t.prize)], 10) 
 kick = 0 
 elseif #arenaPlayers > 1 then 
 if kick == 0 then 
 kick = os.time() 
 else 
 if os.time() - kick >= 840 then 
 kick = 0 
 for i = 1, #arenaPlayers do 
 doTeleportThing(arenaPlayers[i], {x=32345, y=32225, z=7}) 
 doPlayerSendTextMessage(arenaPlayers[i], MESSAGE_STATUS_WARNING, "Too even, try harder next time.") 
 end 
 end 
 end 
 elseif #arenaPlayers == 0 then 
 kick = 0 

 local players = {} 
 for x = t.tmp[1].x, t.tmp[2].x do 
 for y = t.tmp[1].y, t.tmp[2].y do 
 for z = t.tmp[1].z, t.tmp[2].z do 
 local c = getTopCreature({x = x, y = y, z = z}) 
 if c.type == 1 then 
 table.insert(players, c.uid) 
 end 
 end 
 end 
 end 

 if #players >= t.minPlayers then 
 for i = 1, #players do 
 local p = {x = math.random(t.from.x, t.to.x), y = math.random(t.from.y, t.to.y), z = math.random(t.from.z, t.to.z)} 
 doTeleportThing(players[i], p) 
 doSendMagicEffect(p, CONST_ME_TELEPORT) 
 doPlayerSendTextMessage(players[i], MESSAGE_STATUS_WARNING, "The battle begins. Survive for glory!") 
 end 
else 
 for i = 1, #players do 
 doTeleportThing(players[i], {x=876, y=1025, z=7}) 
 doPlayerSendTextMessage(players[i], MESSAGE_STATUS_WARNING, "The event didn't start because there isn't enough players in area!") 
 end 
 end 
 end 
 return true 
 end
 
Hey, Trying to get this thing work. But it doesn't work that well, I think it's something with my arena.lua that buggs. My character doesn't teleports into the arena when it's suppoused to.


Lua:
local t = { 
 tmp = { 
 {x = 916, y = 946, z = 7}, -- North west corner of Area where players must stand in order to join the event 
 {x = 919, y = 949, z = 7} -- South east corner of Area
 }, 
 arena = { 
 {x = 908, y = 931, z = 7}, -- North west Corner of Arena 
 {x = 927, y = 944, z = 7}, -- South East corner of Arena 
 {x = 917, y = 937, z = 7} -- Center of Arena 
 }, 

 from = {x = 908, y = 931, z = 6}, -- Top left cornor of the playground (random players teleportation) 
 to = {x = 925, y = 943, z = 6}, -- Bottom right cornor of the playground (random players teleportation) 

 minPlayers = 1, -- min players required to start the battle 
 noPlayers = 1, -- Leave it as it is 
 prize = {2160} -- Reward that player recives 
 } 
 local kick = 0 

 function onThink() 
 local arenaPlayers = {} 

 for x = t.arena[1].x, t.arena[2].x do 
 for y = t.arena[1].y, t.arena[2].y do 
 for z = t.arena[1].z, t.arena[2].z do 
 local pos = {x = x, y = y, z = z} 
 local n = getTileInfo(pos).creatures 
 if n ~= 0 then 
 pos.stackpos = 1 
 local c = getThingfromPos(pos) 
 while c.uid ~= 0 do 
 if c.itemid == 1 and c.type == 1 then 
 table.insert(arenaPlayers, c.uid) 
 if #arenaPlayers == n then 
 break 
 end 
 end 
 pos.stackpos = pos.stackpos + 1 
 c = getThingfromPos(pos) 
 end 
 end 
 end 
 end 
 end 

 if #arenaPlayers == 1 then 
 local p = getPlayerMasterPos(arenaPlayers[1]) 
 doTeleportThing(arenaPlayers[1], p) 
 doSendMagicEffect(p, CONST_ME_TELEPORT) 
 doPlayerSendTextMessage(arenaPlayers[1], MESSAGE_STATUS_CONSOLE_BLUE, "You have won the event and received your reward.") 
 doBroadcastMessage(getCreatureName(arenaPlayers[1]) .." won a Last Man Standing Event.") 
 doPlayerAddItem(arenaPlayers[1], t.prize[math.random(#t.prize)], 10) 
 kick = 0 
 elseif #arenaPlayers > 1 then 
 if kick == 0 then 
 kick = os.time() 
 else 
 if os.time() - kick >= 840 then 
 kick = 0 
 for i = 1, #arenaPlayers do 
 doTeleportThing(arenaPlayers[i], {x=32345, y=32225, z=7}) 
 doPlayerSendTextMessage(arenaPlayers[i], MESSAGE_STATUS_WARNING, "Too even, try harder next time.") 
 end 
 end 
 end 
 elseif #arenaPlayers == 0 then 
 kick = 0 

 local players = {} 
 for x = t.tmp[1].x, t.tmp[2].x do 
 for y = t.tmp[1].y, t.tmp[2].y do 
 for z = t.tmp[1].z, t.tmp[2].z do 
 local c = getTopCreature({x = x, y = y, z = z}) 
 if c.type == 1 then 
 table.insert(players, c.uid) 
 end 
 end 
 end 
 end 

 if #players >= t.minPlayers then 
 for i = 1, #players do 
 local p = {x = math.random(t.from.x, t.to.x), y = math.random(t.from.y, t.to.y), z = math.random(t.from.z, t.to.z)} 
 doTeleportThing(players[i], p) 
 doSendMagicEffect(p, CONST_ME_TELEPORT) 
 doPlayerSendTextMessage(players[i], MESSAGE_STATUS_WARNING, "The battle begins. Survive for glory!") 
 end 
else 
 for i = 1, #players do 
 doTeleportThing(players[i], {x=876, y=1025, z=7}) 
 doPlayerSendTextMessage(players[i], MESSAGE_STATUS_WARNING, "The event didn't start because there isn't enough players in area!") 
 end 
 end 
 end 
 return true 
 end


Same Problem here!
 
you should say which distro/rev , that you tested on it the event ;(

- - - Updated - - -

you should say which distro/rev , that you tested on it the event ;(
 
map map map map, we all need map!! or at least let us know how we can do it with an image?

we will all be thankful for this info. thanks
 
Back
Top