Hello I have this script for issavi, the new update, and I want to see if there is any way to make it so that even if one player pulls the lever it works to the boss, here is my issavi.lua
Any help? pls ty,
Lua:
local config = {
requiredLevel = 300,
timeToUseAgain = .17, -- time in days
daily = false,
centerDemonRoomPosition = Position(34208, 31774, 8),
playerPositions = {
Position(34207, 31754, 8),
Position(34208, 31754, 8),
Position(34209, 31754, 8),
Position(34210, 31754, 8),
Position(34211, 31754, 8)
},
newPositions = {
Position(34206, 31773, 8),
Position(34207, 31773, 8),
Position(34208, 31773, 8),
Position(34209, 31773, 8),
Position(342010, 31773, 8)
},
demonPositions = {
Position(34208, 31776, 8)
}
}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if item.itemid == 9825 then
local storePlayers, playerTile = {}
for i = 1, #config.playerPositions do
playerTile = Tile(config.playerPositions[i]):getTopCreature()
if not playerTile or not playerTile:isPlayer() then
player:sendTextMessage(MESSAGE_STATUS_SMALL, "You need 5 players.")
return true
end
if playerTile:getLevel() < config.requiredLevel then
player:sendTextMessage(MESSAGE_STATUS_SMALL, "All the players need to be level ".. config.requiredLevel .." or higher.")
return true
end
if playerTile:getExhaustion(171717) > 0 then
player:sendTextMessage(MESSAGE_STATUS_SMALL, "".. playerTile:getName() .." need to wait for ".. player:getExhaustion(171717)/60 .." minutes.")
return true
end
storePlayers[#storePlayers + 1] = playerTile
end
local specs, spec = Game.getSpectators(config.centerDemonRoomPosition, false, false, 3, 3, 2, 2)
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
for i = 1, #config.demonPositions do
Game.createMonster("Urmahlullu the Immaculate", config.demonPositions[i])
end
local players
for i = 1, #storePlayers do
players = storePlayers[i]
config.playerPositions[i]:sendMagicEffect(CONST_ME_POFF)
players:teleportTo(config.newPositions[i])
config.newPositions[i]:sendMagicEffect(CONST_ME_ENERGYAREA)
players:setDirection(DIRECTION_EAST)
players:setExhaustion(171717, config.timeToUseAgain*60*1*4)
end
elseif item.itemid == 9826 then
if config.daily then
player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_NOTPOSSIBLE))
return true
end
end
item:transform(item.itemid == 9825 and 9826 or 9825)
return true
end
Any help? pls ty,