help with pressure plate script
Posted: Wed Sep 19, 2012 11:27 am
So I am trying to use a script to open a door when 2 pressure plates are activated. I managed to use the script below to accomplish this, however it only works once. I want it so that if I remove the rocks from the pressure plate the door closes and if they are reaplied the door opens again. any help?
SpoilerShow
counter = 2
function activate()
counter = counter - 1
checkValue()
end
function deactivate()
counter = counter + 1
checkValue()
end
function checkValue()
if counter == 0 then
pressuredoor:open()
else
pressuredoor:close()
end
end
function activate()
counter = counter - 1
checkValue()
end
function deactivate()
counter = counter + 1
checkValue()
end
function checkValue()
if counter == 0 then
pressuredoor:open()
else
pressuredoor:close()
end
end