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

Solved Neeeed heelp with events!!!!

matti450

Member
Joined
Apr 13, 2008
Messages
507
Reaction score
24
Hello as the title says i need help! i have tried all LMS events on otland and they simple wont work need one with autocastboarding and i am looking for a zombie event that also are automatic!!!!!!!!
Using tfs 0.3.6
 
If you have problems with scripts, you can post them with the errors and explain what happens and what should be different.
 
If you have problems with scripts, you can post them with the errors and explain what happens and what should be different.
its not like that i do not know how to use them! i do all the steps but it wont work so i am trying to find someone that maybe can pull some hair and fix it to me...
 
You still have to post the scripts then, post the errors, explain what happens and what should be different.
well when it comes to pos north west and pos south east and where the players teleports, i will try to create one and i will tell you about my errors
 
add this in your globalevents
Code:
<globalevent name="LastMan" interval="600000" event="script" value="lastman.lua"/>
    <globalevent name="arena" interval="60000" event="script" value="arena.lua"/>

and now make a file in scripts called lastman.lua and paste this code
Code:
local createpos = {x=32342,y=32220,z=7} -- Every 15min where will the Teleport Appear
local topos = {x=32402,y=32203,z=7} -- Where will the Teleport take you
local msg = "Last man standing event TP has now been closed! It will open again in 10 minutes! All participants get Ready for a Fight!"
local timetoclose = 60 -- in second

local function remove()
local tp = getTileItemById(createpos,1387).uid
if tp ~= 0 then
doRemoveItem(tp)
doBroadcastMessage(msg)
end
end

function onThink(interval)
doCreateTeleport(1387, topos, createpos)
doBroadcastMessage("Last man standing event TP is now open!\nCatch the teleport within "..timetoclose.." seconds! Teleport is Located in Events Room.")
addEvent(remove,timetoclose*1000)
return true
end

and know create other file call arena.lua also in the scripts and paste this code
Code:
local t = {
tmp = {
{x = 32397, y = 32202, z = 7}, -- North west corner of Area where players must stand in order to join the event
{x = 32402, y = 32205, z = 7} -- South east corner of Area
},
arena = {
{x = 32389, y = 32188, z = 7}, -- North west Corner of Arena
{x = 32402, y = 32200, z = 7}, -- South East corner of Arena
{x = 32396, y = 32194, z = 7} -- Center of Arena
},

from = {x = 32389, y = 32188, z = 7}, -- Top left cornor of the playground (random players teleportation)
to = {x = 32402, y = 32200, z = 7}, -- Bottom right cornor of the playground (random players teleportation)

minPlayers = 2, -- min players required to start the battle
noPlayers = 1, -- Leave it as it is
prize = {6527} -- 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)], 25)
kick = 0
elseif #arenaPlayers > 1 then
if kick == 0 then
kick = os.time()
else
if os.time() - kick >= 0 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=32369, y=32241, 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

set you coordination where the events should be taking place

rep+++
 
post your position here and i will help you out :p

otherwise the code i gave you really explain with green text what diffrent code mean so it's won't be any problem there :)
well i did do what you told me to do about the cordinate i do not know really if i did it right but when i started the ot i had no error on my screen :) where can i change the time to that event starts? so i can test it
 
well i did do what you told me to do about the cordinate i do not know really if i did it right but when i started the ot i had no error on my screen :) where can i change the time to that event starts? so i can test it

you do change it's in the globalevents interval i have set it on 15min but you can change its or if you using complie server. you maybe can force starting it?..

but remember you need to set arena.lua abit higher interval than lastman.lua because it's cant be starting at the same time for exempel if you set its the same interval which mean the lastman will create a teleport and the arena start....
 
Back
Top