Xarly
Member
- Joined
- Mar 9, 2015
- Messages
- 360
- Reaction score
- 20
Hello guys, we have a little problem we have a script for prison keys, but got a little problem with the golden key so when i try to use it, only 1 player get teleported, and the rest of players stay on the same place, too another thing its if someone try to use the key when he is alone it says u need 5 players so its ok but it remove the key so if someone can help me for fix will be great^^ , thanks in advance guys!
There is the script:
There is the script:
Code:
local config = {
playerPositions = {
Position(33607, 32362, 11),
Position(33608, 32362, 11),
Position(33609, 32362, 11),
Position(33610, 32362, 11),
Position(33611, 32362, 11)
},
newPositions = {
Position(33533, 32414, 12),
Position(33533, 32414, 12),
Position(33533, 32414, 12),
Position(33533, 32414, 12)
}
}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if target.itemid == 22641 then
local storePlayers, playerTile = {}
item:remove(22607)
for i = 1, #config.playerPositions do
playerTile = Tile(config.playerPositions):getTopCreature()
if not playerTile or not playerTile:isPlayer() then
player:sendTextMessage(MESSAGE_STATUS_SMALL, "You need 5 players.")
return true
end
end
player:teleportTo(Position(33533, 32414, 12), false)
end
return true
end
Last edited by a moderator: