At first I was using levers toggled by the correct shield going on the wall, but if someone put the right shield on the hook multiple times it screwed up the levers so you could have the right answer without the door opening. To fix this I went with counters, the idea was that the counters would reset if the shield was removed and increase only if the right shield was in place, heres my script
Code: Select all
function shieldrose()
if rose:getItemCount() ~= 0 then
for i in rose:containedItems() do
if i.name == "shield_rose" then
s2:increment()
end
end
else
s2:reset()
end
end
How can I fix this script?
Second is getting it so that all the active counters trigger a door to open, I'm using this
Code: Select all
function leveraction()
if s1:getValue() == 1 and
s2:getValue() == 1 and
s3:getValue() == 1 and
s4:getValue() == 1 and
s5:getValue() == 1 and
s6:getValue()== 1 then
script_entity_38:destroy()
helm_door:open()
playSound("level_up")
hudPrint("1000 EXP gained")
hudPrint("You Learnt the Sigils and Arms of the Knight Captains")
global_scripts.grantExp(1000)
secret_27:activate()
end
end