• 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 callback parameter should be a function

LuisPro

World War <3
Joined
May 10, 2009
Messages
425
Solutions
1
Reaction score
53
from my bigfootBurdenQuestWarzones.lua:
Code:
            addEvent(teleportAllPlayersFromArea, 6 * 20 * 1000 + 30 * 60 * 1000, {
                {x = 33089, y = 31946, z = 10},
                {x = 33124, y = 31983, z = 10}
            }, {x = 33002, y = 31918, z = 10})
            addEvent(removeBoss, 6 * 20 * 1000 + 1 * 60 * 1000, {
                {x = 33089, y = 31946, z = 10},
                {x = 33124, y = 31983, z = 10}
            }, "deathstrike")

from my global.lua:
Code:
local function teleportAllPlayersFromArea(fromArea, toPos)
    for x = fromArea[1].x, fromArea[2].x do
        for y = fromArea[1].y, fromArea[2].y do
            for z = fromArea[1].z, fromArea[2].z do
                if(getThingfromPos({x = x, y = y, z = z, stackpos = 255}).uid > 0) then
                    if(isPlayer(getThingfromPos({x = x, y = y, z = z, stackpos = 255}).uid)) then
                        doTeleportThing(getThingfromPos({x = x, y = y, z = z, stackpos = 255}).uid, toPos)
                        doSendMagicEffect(toPos, CONST_ME_TELEPORT)
                        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You were teleported out by the gnomish emergency device.")
                    end
                end
            end
        end
    end
    return true
end

function removeBoss(fromArea, bossName)
    for x = fromArea[1].x, fromArea[2].x do
        for y = fromArea[1].y, fromArea[2].y do
            for z = fromArea[1].z, fromArea[2].z do
                if(getThingfromPos({x = x, y = y, z = z, stackpos = 255}).uid > 0) then
                    if(isMonster(getThingfromPos({x = x, y = y, z = z, stackpos = 255}).uid)) then
                        if(string.lower(getCreatureName(getThingfromPos({x = x, y = y, z = z, stackpos = 255}).uid)) == bossName) then
                            doRemoveCreature(getThingfromPos({x = x, y = y, z = z, stackpos = 255}).uid)
                        end
                    end
                end
            end
        end
    end
    return true
end


And now! remove boss event works well, tp players event make this error:

b51t.jpg


Thx for any help! :D
 
Back
Top