Erro :
[22/07/2011 17:23:36] [Error - Action Interface] [22/07/2011 17:23:36] data/actions/scripts/quests/newquestanihi.lua:onUse [22/07/2011 17:23:36] Description: [22/07/2011 17:23:36] data/actions/scripts/quests/newquestanihi.lua:54: attempt to index global 'playerPosition' (a nil value) [22/07/2011 17:23:36] stack traceback: [22/07/2011 17:23:36] data/actions/scripts/quests/newquestanihi.lua:54: in function <data/actions/scripts/quests/newquestanihi.lua:46>
Script :
local players_pos = { {x = 278, y =569, z = 14, stackpos = 253}, {x = 279, y =569, z = 14, stackpos = 253}, {x = 280, y =569, z = 14, stackpos = 253}, {x = 278, y =570, z = 14, stackpos = 253}, {x = 279, y =570, z = 14, stackpos = 253}, {x = 280, y =570, z = 14, stackpos = 253} } local newPosition = { {x=215, y=601, z=14}, {x=216, y=601, z=14}, {x=217, y=601, z=14}, {x=215, y=602, z=14}, {x=216, y=602, z=14}, {x=217, y=602, z=14} } local snakeweaverPosition = { {x=215, y=598, z=14}, {x=216, y=598, z=14}, {x=217, y=598, z=14}, {x=215, y=604, z=14}, {x=216, y=604, z=14}, {x=217, y=604, z=14}, {x=212, y=601, z=14}, {x=212, y=602, z=14} } local eliteweaverPosition = { {x=217, y=605, z=14}, {x=212, y=605, z=14}, {x=213, y=605, z=14}, {x=218, y=599, z=14}, {x=219, y=599, z=14} } local elitetraperPosition = { {x=218, y=601, z=14}, {x=219, y=601, z=14}, {x=220, y=601, z=14}, {x=218, y=602, z=14}, {x=219, y=602, z=14}, {x=220, y=602, z=14} } function onUse(cid, item, fromPosition, itemEx, toPosition) local player = {0, 0, 0, 0} local failed = TRUE local count = 0 item.new = 1946 if(item.itemid == 1945) then if(os.time(t) >= (getGlobalStorageValue(9000) + 3600)) then for i = 1, 4 do player[i] = getThingfromPos(playerPosition[i]) if(player[i].itemid > 0) then if(isPlayer(player[i].uid) == TRUE) then if(getPlayerStorageValue(player[i].uid, 9000) < 1) then if(getPlayerLevel(player[i].uid) >= 100 or getPlayerAccess(player[i].uid) >= 3) then failed = FALSE count = count + 1 end end end end if(failed == TRUE) then doTransformItem(item.uid, 1946) return TRUE end end if(count == 4) then for i = 1, 9 do doSummonCreature("Snake Weaver", snakeweaverPosition[i]) end for i = 1, 5 do doSummonCreature("Elite Weaver", snakeweaverPosition[i]) end for i = 1, 5 do doSummonCreature("Elite Traper", snakeweaverPosition[i]) end for i = 1, 4 do doSendMagicEffect(playerPosition[i], CONST_ME_POFF) doTeleportThing(player[i].uid, newPosition[i], FALSE) doSendMagicEffect(newPosition[i], CONST_ME_ENERGYAREA) setPlayerStorageValue(player[i].uid, 9000, 1) end setGlobalStorageValue(9000, os.time(t)) end end else item.new = 1945 end doTransformItem(item.uid, item.new) return TRUE end