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

Solved Problem with function

therrax

Member
Joined
Jul 12, 2012
Messages
262
Solutions
1
Reaction score
11
Hi.
TFS 1.0

I have small problem with lastman event:
script:
Code:
local createpos = {x=778,y=996,z=7} -- Every 2h where will the Teleport Appear
local topos = {x=775,y=1006,z=8} -- Where will the Teleport take you
local msg = "Last man standing event TP has now been closed! It will open again in 2 hours! 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)
broadcastMessage("Teleport zamkniety!", MESSAGE_STATUS_WARNING)
end
end

function onTime(time)
doCreateTeleport(1387, topos, createpos)
broadcastMessage("Last man standing event TP is now open!\nCatch the teleport within "..timetoclose.." seconds! Teleport is Located in Boss area!", MESSAGE_STATUS_WARNING)
addEvent(remove,timetoclose*1000)
return true
end
console error:
Code:
Lua Script Error: [GlobalEvent Interface]
data/globalevents/scripts/LMS/lastman.lua:onTime
data/globalevents/scripts/LMS/lastman.lua:15: attempt to call global 'doCreateTe
leport' (a nil value)
stack traceback:
        [C]: in function 'doCreateTeleport'
        data/globalevents/scripts/LMS/lastman.lua:15: in function <data/globalev
ents/scripts/LMS/lastman.lua:14>
 
@Limos thanks but now:

I have it in my compat:
Code:
function broadcastMessage(message, messageType)
    Game.broadcastMessage(message, messageType)
    print("> Broadcasted message: \"" .. message .. "\".")
end
console error:
Code:
Lua Script Error: [GlobalEvent Interface]
data/globalevents/scripts/LMS/lastman.lua:onTime
data/compat.lua:798: attempt to call field 'broadcastMessage' (a nil value)
stack traceback:
        [C]: in function 'broadcastMessage'
        data/compat.lua:798: in function 'broadcastMessage'
        data/globalevents/scripts/LMS/lastman.lua:16: in function <data/globalev
ents/scripts/LMS/lastman.lua:14>
 
Back
Top