Page 1 of 2
Pressure Plates question
Posted: Wed Sep 12, 2012 10:33 pm
by DrTeflon
Hello everyone, I have a question regarding pressure plates. I was wondering if its possible to create a puzzle using several pressure plates. Something like there are 10 pressure plates in the room, if I place three items on specific pressure plates then the door opens. I looked through the scripting documentation and didnt find anything regarding getstate or something like that.
Btw, it's my first time working with scripts so

Re: Pressure Plates question
Posted: Wed Sep 12, 2012 10:51 pm
by Lmaoboat
Well I'm also new, but I think you could set a counter with an initial value of 3 to open a door, then make it so the three specific pressure plates decease the counter by 1 when pressed, and increase when released.
Re: Pressure Plates question
Posted: Wed Sep 12, 2012 10:52 pm
by DrTeflon
Lmaoboat wrote:Well I'm also new, but I think you could set a counter with an initial value of 3 to open a door, then make it so the three specific pressure plates decease the counter by 1 when pressed, and increase when released.
Hmm, thanks, I'm gonna try that!
Re: Pressure Plates question
Posted: Wed Sep 12, 2012 11:12 pm
by DrTeflon
Hmm, I wonder what I'm doing wrong
---opendoor
function open()
if counter_1:getValue() == "1" then
door_2:open()
end
end
I targeted a pressure plate to increment the counter value to one but still doesnt work
Re: Pressure Plates question
Posted: Wed Sep 12, 2012 11:17 pm
by antti
DrTeflon wrote:Hmm, I wonder what I'm doing wrong
---opendoor
function open()
if counter_1:getValue() == "1" then
door_2:open()
end
end
I targeted a pressure plate to increment the counter value to one but still doesnt work
Try removing the quotation marks around 1. Things inside quotes are strings (like pieces of text). So in this case you weren't trying to compare the counter's value with the number of one but with a text that reads "1". Hope this clears it up a bit.
Re: Pressure Plates question
Posted: Wed Sep 12, 2012 11:26 pm
by DrTeflon
antti wrote:DrTeflon wrote:Hmm, I wonder what I'm doing wrong
---opendoor
function open()
if counter_1:getValue() == "1" then
door_2:open()
end
end
I targeted a pressure plate to increment the counter value to one but still doesnt work
Try removing the quotation marks around 1. Things inside quotes are strings (like pieces of text). So in this case you weren't trying to compare the counter's value with the number of one but with a text that reads "1". Hope this clears it up a bit.
Thanks! as I said, its like my first time working with code
Tried it and it still doesnt work, maybe i'm doing something stupid, gotta run more tests
Re: Pressure Plates question
Posted: Wed Sep 12, 2012 11:31 pm
by Lmaoboat
I don't think you need a script for this one, thought it's probably good to get practice.
Re: Pressure Plates question
Posted: Thu Sep 13, 2012 12:39 am
by DrTeflon
Lmaoboat wrote:I don't think you need a script for this one, thought it's probably good to get practice.
I'm doing this a test and adding more pressure plates

Re: Pressure Plates question
Posted: Thu Sep 13, 2012 12:41 am
by pulpum
you can do it with pressure plates properties "item", and activate the thing with a connector to your item... I dit it to open doors today...

Re: Pressure Plates question
Posted: Thu Sep 13, 2012 2:04 am
by Komag
You can read some ideas relating to this in this thread:
viewtopic.php?f=14&t=3032