Since my route has almost 20 hidden pressure plate to be pressed in a certain order (I have to say this clearly, WITHOUT passing twice on a same spot, otherwise this script won't work), and doing them with
if pressupreplate0:isUp and counter:getvalue() == 0 then increment
if pressupreplate1:isUp and counter:getvalue() == 1 then increment, I used a index.
You need to call your plates like plate0, plate1, plate2 and so on. Place a counter, which I'll call counterRoute, and connect all the plates to the script to the function route().
The script is written in this way.
SpoilerShow
function route()
i = counterRoute:getValue()
if findEntity("plate"..i):isUp() then
counterRoute:reset()
else
counterRoute:increment()
end
end
function reset()
counterRoute:reset()
end
i = counterRoute:getValue()
if findEntity("plate"..i):isUp() then
counterRoute:reset()
else
counterRoute:increment()
end
end
function reset()
counterRoute:reset()
end
I've omitted the check script (for my puzzle the player must press a button at the end of the route and see if it was done right), but I'm sure it's not a problem for you
Oh, the hard part is... naming correctly the plate (the first time I forgot to rename a plate... and I could not figure out why the script wasn't working
