myalitth
New Member
- Joined
- Jan 13, 2013
- Messages
- 69
- Reaction score
- 3
This script (Attach) teleport players from teleport tiles to boss room
So i need, to edit this script to teleport players from boss rom to out of room.
I've tryied a lot types...
Some players stuck noob chars on boss room, to block boss...
Script:
So i need, to edit this script to teleport players from boss rom to out of room.
I've tryied a lot types...
Some players stuck noob chars on boss room, to block boss...
Script:
Lua:
local function removeBosst(fromArea1, fromArea2, bossName)
for x = fromArea1.x, fromArea2.x do
for y = fromArea1.y, fromArea2.y do
for z = fromArea1.z, fromArea2.z do
if(getTopCreature({x = x, y = y, z = z, stackpos = 255}).uid > 0) then
if(isMonster(getTopCreature({x = x, y = y, z = z, stackpos = 255}).uid)) then
if(string.lower(getCreatureName(getTopCreature({x = x, y = y, z = z, stackpos = 255}).uid)) == bossName) then
doRemoveCreature(getTopCreature({x = x, y = y, z = z, stackpos = 255}).uid)
end
end
end
end
end
end
return true
end
local function teleportAllPlayersFromAreat(fromArea1, fromArea2, toPos)
for x = fromArea1.x, fromArea2.x do
for y = fromArea1.y, fromArea2.y do
for z = fromArea1.z, fromArea2.z do
if(getTopCreature({x = x, y = y, z = z, stackpos = 255}).uid > 0) then
if(isPlayer(getTopCreature({x = x, y = y, z = z, stackpos = 255}).uid)) then
doTeleportThing(getTopCreature({x = x, y = y, z = z, stackpos = 255}).uid, toPos)
doSendMagicEffect(toPos, CONST_ME_TELEPORT)
end
end
end
end
end
return true
end
local function PrepareEnter()
removeBosst({x=33470,y=31430,z=15}, {x=33495,y=31450,z=15}, "Brokul")
teleportAllPlayersFromAreat({x =33520,y =31465,z=15},{x=33524,y=31465,z=15},{x=33483,y=31446,z=15})
Game.createMonster("Brokul", {x=33483,y=31443,z=15})
end
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if item.itemid == 1945 then
if getGlobalStorageValue(8640) >= os.time() then
doPlayerSendTextMessage(player, 19, "You need to wait 5 minutes to use again.")
return true
end
local specs, spec = Game.getSpectators({x=33484,y=31442,z=15}, false, false, 13, 13, 13, 13)
for i = 1, #specs do
spec = specs[i]
if spec:isPlayer() then
player:sendTextMessage(MESSAGE_STATUS_SMALL, "A team is already inside the quest room.")
return true
end
spec:remove()
end
setGlobalStorageValue(8640, os.time()+5*60)
player:say("Brokul Has Summoned!", TALKTYPE_MONSTER_SAY)
addEvent(PrepareEnter,1*2)
end
item:transform(item.itemid == 1945 and 1945 or 1945)
return true
end
Last edited: