xakalrox19
New Member
- Joined
- Dec 2, 2015
- Messages
- 3
- Reaction score
- 0
Guys I'm with the following problem , I added a lever system on my server this system teleports the players or " player " to a certain location where continued its mission ...
however this occurring the following error when I click on the lever the script directs the player to the desired location , however generates a sequence of errors "Annex"
How the script works ?
I do not want to have limit of players , for example if the team want to go and have missing members, they can not even keep up with players occupying positions 5 ... " I also realized that ERRORS ARE GENERATED WHEN NOT HAVE PLAYER OCCUPYING ALL POSITIONS "
Code:
local t = {
lvl = 30,
entrada = {
{x = 32238, y = 32225, z = 7}, -- pos players
{x = 32237, y = 32225, z = 7},
{x = 32236, y = 32225, z = 7},
{x = 32235, y = 32225, z = 7},
{x = 32234, y = 32225, z = 7}
},
saida = {
{x = 32136, y = 32147, z = 8}, -- pos para onde eles irão
{x = 32136, y = 32147, z = 8},
{x = 32136, y = 32147, z = 8},
{x = 32136, y = 32147, z = 8},
{x = 32136, y = 32147, z = 8}
}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local check = {}
for _, k in ipairs(t.entrada) do
local x = getTopCreature(k).uid
if(x == 0 or not isPlayer(x) or getPlayerLevel(x) < t.lvl) then
end
table.insert(check, x)
end
for i, tid in ipairs(check) do
doSendMagicEffect(t.entrada[i], CONST_ME_POFF)
doTeleportThing(tid, t.saida[i], false)
doSendMagicEffect(t.saida[i], CONST_ME_ENERGYAREA)
end
doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
return true
end