Hi, I have look around the forum but canot find the answer to this.
What I wanna do is close a door when you step on a hidden pressure plate but only if you have stepped on a previous pressure plate before.
This part works fine, the problem is that I have a button that would put the variable to false and open the door so that it could be done again.
But after i press the button it seems the variable plate01 become false but will never become true again.
The door does not close after I press the button and stepped on those 2 plate.
Thank you for your help.
function plate01()
plate01 = true
end
function door01()
if plate01 == true then
prison_door_portcullis_67:close()
end
end
function resetlabyrinth()
plate01 = false
end
boolean variable question ( SOLVED )
-
bigbrodeur
- Posts: 3
- Joined: Fri Jul 04, 2014 3:13 pm
- Location: Montreal, Canada
boolean variable question ( SOLVED )
Last edited by bigbrodeur on Mon Jul 07, 2014 1:08 pm, edited 1 time in total.
- Dr.Disaster
- Posts: 2876
- Joined: Wed Aug 15, 2012 11:48 am
Re: boolean variable question
Did you set "activate once" for those plates?
-
bigbrodeur
- Posts: 3
- Joined: Fri Jul 04, 2014 3:13 pm
- Location: Montreal, Canada
Re: boolean variable question
No, thats the first thing I checked.
Even if I press the button first, it wont work.
But if i step on those plate and dont press the button it work, its that button that is problematic.
Even if I press the button first, it wont work.
But if i step on those plate and dont press the button it work, its that button that is problematic.
Re: boolean variable question
I noticed that you have the function and the variable with the same name, change the name of one or the other and it should work. Be sure to include the door:open statement in the resetlabyrinth function. Good luck.bigbrodeur wrote:Hi, I have look around the forum but canot find the answer to this.
What I wanna do is close a door when you step on a hidden pressure plate but only if you have stepped on a previous pressure plate before.
This part works fine, the problem is that I have a button that would put the variable to false and open the door so that it could be done again.
But after i press the button it seems the variable plate01 become false but will never become true again.
The door does not close after I press the button and stepped on those 2 plate.
Thank you for your help.
function plate01()
plate01 = true
end
function door01()
if plate01 == true then
prison_door_portcullis_67:close()
end
end
function resetlabyrinth()
plate01 = false
end
-
bigbrodeur
- Posts: 3
- Joined: Fri Jul 04, 2014 3:13 pm
- Location: Montreal, Canada
Re: boolean variable question
Yes it worked !!!!!!
Wow I didnt know function could not share the same name as variable.
Thank you allanius.
How can I changed the name of the topic to add SOLVED ?
Wow I didnt know function could not share the same name as variable.
Thank you allanius.
How can I changed the name of the topic to add SOLVED ?
Re: boolean variable question
Nicebigbrodeur wrote:Yes it worked !!!!!!
Wow I didnt know function could not share the same name as variable.
Thank you allanius.
How can I changed the name of the topic to add SOLVED ?
You can change the topic by pressing "edit" on your original post.
Steven Seagal of gaming industry