Page 1 of 1

Pressure Plates

Posted: Sat Oct 27, 2012 9:17 am
by Ahmyo
Wishing there was a "Name:getPressurePlateState()"

So far I haven't found anything like that other than a trick with levers activated by plates, with the levers having their states recognized, which seems like something that shouldn't have to be done..

Is there a getState for plates?

Re: Pressure Plates

Posted: Sat Oct 27, 2012 9:20 am
by Wolfrug
But there is!

PressurePlate:isDown()

and

PressurePlate:isUp()

Return true when they're down/up. :)

- Wolfrug

Re: Pressure Plates

Posted: Sat Oct 27, 2012 11:30 am
by Ahmyo
Oooh okay so then I could write something like

function leverdoor()

if leverwest:getLeverState() == "activated" and
PressurePlate:isUp() == true then
Door:open()
else
Door:close()
end
end

?

Edit:

Huzzah! That worked! Thank you very much for the help. ;)

Re: Pressure Plates

Posted: Sat Oct 27, 2012 1:05 pm
by Komag
you can leave off the == true

Code: Select all

PressurePlate:isUp() then

Re: Pressure Plates

Posted: Sat Oct 27, 2012 2:15 pm
by Ahmyo
Oh thanks