Donio
Banned User
I get this message when players pull the lever:
And this is the script:
Code:
[Error - Action Interface]
data/actions/scripts/other/arenalever.lua:onUse
Description:
(luaGetThingFromPos) Tile not found
And this is the script:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local firstPlayerPosition = {x = 776, y = 1305, z = 7, stackpos = STACKPOS_TOP_CREATURE}
local getFirstPlayer = getThingFromPos(firstPlayerPosition)
local secondPlayerPosition = {x = 777, y = 1306, z = 7, stackpos = STACKPOS_TOP_CREATURE}
local getSecondPlayer = getThingFromPos(secondPlayerPosition)
local thirdPlayerPosition = {x = 775, y = 1306, z = 7, stackpos = STACKPOS_TOP_CREATURE}
local getThirdPlayer = getThingFromPos(thirdPlayerPosition)
local fourthPlayerPosition = {x = 776, y = 1307, z = 7, stackpos = STACKPOS_TOP_CREATURE}
local getFourthPlayer = getThingFromPos(fourthPlayerPosition)
local arenaLevel = 25
local newFirstPlayerPosition = {x = 772, y = 1293, z = 7}
local newSecondPlayerPosition = {x = 767, y = 1297, z = 7}
local newThirdPlayerPosition = {x = 777, y = 1297, z = 7}
local newFourthPlayerPosition = {x = 772, y = 1302, z = 7}
if(item.uid == 7001) then
if(getFirstPlayer.itemid > 0 and getSecondPlayer.itemid > 0 and getThirdPlayer.itemid > 0 and getFourthPlayer.itemid > 0) then
if(getPlayerLevel(getFirstPlayer.uid) >= arenaLevel and getPlayerLevel(getSecondPlayer.uid) >= arenaLevel and getPlayerLevel(getThirdPlayer.uid) >= arenaLevel and getPlayerLevel(getFourthPlayer.uid) >= arenaLevel) then
for arenax = 764, 1290 do
for arenay = 779, 1304 do
local arenaPosition = {x=arenax, y=arenay, z=7, stackpos=253}
local arenaCreature = getThingFromPos(arenaPosition)
if(arenaCreature.itemid > 0 and isPlayer(arenaCreature.uid) == FALSE) then
if(isMonster(arenaCreature.uid) == TRUE) then
doRemoveCreature(arenaCreature.uid)
end
elseif(arenaCreature.itemid > 0 and isPlayer(arenaCreature.uid) == TRUE) then
doPlayerSendCancel(cid, "Wait for current duel to end.")
return TRUE
end
end
end
if(item.itemid == 9825) then
doTransformItem(item.uid, 9826)
elseif(item.itemid == 9826) then
doTransformItem(item.uid, 9825)
end
doSendMagicEffect(firstPlayerPosition, 2)
doSendMagicEffect(secondPlayerPosition, 2)
doSendMagicEffect(thirdPlayerPosition, 2)
doSendMagicEffect(fourthPlayerPosition, 2)
doTeleportThing(getFirstPlayer.uid, newFirstPlayerPosition)
doTeleportThing(getSecondPlayer.uid, newSecondPlayerPosition)
doTeleportThing(getThirdPlayer.uid, newThirdPlayerPosition)
doTeleportThing(getFourthPlayer.uid, newFourthPlayerPosition)
doSendMagicEffect(newFirstPlayerPosition, 10)
doSendMagicEffect(newSecondPlayerPosition, 10)
doSendMagicEffect(newThirdPlayerPosition, 10)
doSendMagicEffect(newFourthPlayerPosition, 10)
doPlayerSendTextMessage(getFirstPlayer.uid, 18, "FIGHT!")
doPlayerSendTextMessage(getSecondPlayer.uid, 18, "FIGHT!")
doPlayerSendTextMessage(getThirdPlayer.uid, 18, "FIGHT!")
doPlayerSendTextMessage(getFourthPlayer.uid, 18, "FIGHT!")
else
doPlayerSendCancel(cid, "Both fighters must have level 25.")
end
else
doPlayerSendCancel(cid, "You need 4 players for a duel.")
end
end
return TRUE
end