LuisPro
World War <3
- Joined
- May 10, 2009
- Messages
- 425
- Solutions
- 1
- Reaction score
- 53
from my bigfootBurdenQuestWarzones.lua:
from my global.lua:
And now! remove boss event works well, tp players event make this error:
Thx for any help!
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:
Thx for any help!