Hello, im trying to do poi like RL i did almost everything now but im having problems with the levers,i dont want to do 15 scripts for the 15 levers...
This is what the script does:
Push the lever, check if the lever was pulled in order if not it doesnt move , then a message ( doCreatureSay(cid, "Hurry up and get to the next lever!", TALKTYPE_ORANGE_1)...
Seemed quite easy when i tried to do it but found some ways of the bug getting screwed plus i couldnt get it to work, if you put any item on the lever the script would detect the gps and not the lever, now i though about using =~ so i would detect if the lever wasnt to the left, but people could abuse it putting gps not being in the correct order and jump just to the last lever that open the stones
So anyone could help me "melting" the 16 scripts in one (16 levers, 15 do the same and the last one opens a stone
Got all the positions of every lever already
This is what the script does:
Push the lever, check if the lever was pulled in order if not it doesnt move , then a message ( doCreatureSay(cid, "Hurry up and get to the next lever!", TALKTYPE_ORANGE_1)...
Seemed quite easy when i tried to do it but found some ways of the bug getting screwed plus i couldnt get it to work, if you put any item on the lever the script would detect the gps and not the lever, now i though about using =~ so i would detect if the lever wasnt to the left, but people could abuse it putting gps not being in the correct order and jump just to the last lever that open the stones
So anyone could help me "melting" the 16 scripts in one (16 levers, 15 do the same and the last one opens a stone
Got all the positions of every lever already
Lua:
local gatepos = {x=459, y=1386, z=11, stackpos=1}
local lever1 = {x=453, y=1371, z=11, stackpos=1} --change tilepos
local lever2 = {x=454, y=1385, z=12, stackpos=1} --change tilepos
local lever3 = {x=496, y=1402, z=14, stackpos=1} --change tilepos
local lever4 = {x=450, y=1412, z=11, stackpos=1} --change tilepos
local lever5 = {x=457, y=1419, z=12, stackpos=1} --change tilepos
local lever6 = {x=450, y=1405, z=13, stackpos=1} --change tilepos
local lever7 = {x=460, y=1412, z=13, stackpos=1} --change tilepos
local lever8 = {x=498, y=1381, z=13, stackpos=1} --change tilepos
local lever9 = {x=481, y=1407, z=13, stackpos=1} --change tilepos
local lever10 = {x=467, y=1417, z=12, stackpos=1} --change tilepos
local lever11 = {x=481, y=1418, z=12, stackpos=1} --change tilepos
local lever12 = {x=494, y=1408, z=12, stackpos=1} --change tilepos
local lever13 = {x=450, y=1405, z=13, stackpos=1} --change tilepos
local lever14 = {x=460, y=1412, z=13, stackpos=1} --change tilepos
function onUse(cid, item, frompos, item2, topos)
local getlever1 = getThingfromPos(lever1)
local getlever2 = getThingfromPos(lever2)
local getlever3 = getThingfromPos(lever3)
local getlever4 = getThingfromPos(lever4)
local getlever5 = getThingfromPos(lever5)
local getlever6 = getThingfromPos(lever6)
local getlever7 = getThingfromPos(lever7)
local getlever8 = getThingfromPos(lever8)
local getlever9 = getThingfromPos(lever9)
local getlever10 = getThingfromPos(lever10)
local getlever11 = getThingfromPos(lever11)
local getlever12 = getThingfromPos(lever12)
local getlever13 = getThingfromPos(lever13)
local getlever14 = getThingfromPos(lever14)
local getgate = getThingfromPos(gatepos)