Ir para conteúdo
  • 0

[AJUDA] Alavanca anihi


UntFrc

Pergunta

Eu estou tentando fazer um action de alavanca para uma anihi nova com 6 players, mas não to conseguindo fazer funcionar. Eu só quero que funcione a alavanca quando puxa-la levar os players para a sala com os monstros.

Meu script ta assim:

 

local config = {
daily = "no",
level = 325,
storage = 2239
}
local playerPosition =
{
{x = 3988, y = 1840, z = 9},
{x = 3987, y = 1840, z = 9},
{x = 3986, y = 1840, z = 9},
{x = 3985, y = 1840, z = 9},
{x = 3984, y = 1840, z = 9},
{x = 3983, y = 1840, z = 9}
}
local newPosition =
{
{x = 3989, y = 1811, z = 9},
{x = 3988, y = 1811, z = 9},
{x = 3987, y = 1811, z = 9},
{x = 3986, y = 1811, z = 9},
{x = 3985, y = 1811, z = 9},
{x = 3984, y = 1811, z = 9}
}
-- Do not modify the declaration lines below.
local players = {}
local failed = true
config.daily = getBooleanFromString(config.daily)
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(item.itemid == 10029) then
if(config.daily) then
doPlayerSendCancel(cid, "Sorry, not possible.")
else
doTransformItem(item.uid, item.itemid - 1)
end
return true
end
if(item.itemid ~= 10030) then
return true
end
for i, pos in ipairs(playerPosition) do
pos.stackpos = STACKPOS_TOP_CREATURE
players = getThingFromPos(playerPosition).uid
if(players > 0 and
isPlayer(players) and
getPlayerStorageValue(players.uid, config.storage) == -1 and
getPlayerLevel(players.uid) >= config.level)
then
failed = false
end
if(failed) then
doPlayerSendCancel(cid, "Sorry, not possible.")
return true
end
failed = true
end
for i, pid in ipairs(players) do
doSendMagicEffect(playerPosition, CONST_ME_POFF)
doTeleportThing(pid, newPosition, false)
doSendMagicEffect(newPosition, CONST_ME_ENERGYAREA)
end
doTransformItem(item.uid, item.itemid + 1)
return true

end
Link para o comentário
Compartilhar em outros sites

1 resposta a esta questão

Posts Recomendados

×
×
  • Criar Novo...