**Hello fellow robloxians, Please can you answer this question? :)
How do I make it so that it will change a BoolValue to true if a button is pressed?
Thanks!
Best regards, Nathan.**
I had to choose 1 random tag since there was no "BoolValue"
**Hello fellow robloxians, Please can you answer this question? :)
How do I make it so that it will change a BoolValue to true if a button is pressed?
Thanks!
Best regards, Nathan.**
I had to choose 1 random tag since there was no "BoolValue"
What kind of button? I'll do GUI and physical:
EDITED: With the location of the value etc
BoolValue = script.Parent.Parent.Parent.Toggle
function onClick()
if BoolValue.Value == false then
BoolValue.Value = true
else BoolValue.Value = false
end
end
script.Parent.ClickDetector.MouseClick:connect(onClick)
Hope this helped, and I hope it worked :p
This discussion is preserved as it was. New answers, comments, and votes are closed.
7 comments
Okay, I tryed working it and I can't figure it out. I will post images to show what I am trying to do. http://oi61.tinypic.com/2j5nnn4.jpg -- Is that what I am trying to change? http://oi58.tinypic.com/a0gh8p.jpg -- That is my button. http://oi62.tinypic.com/wgt37n.jpg -- That is the BoolValue I am trying to change. Please reply asap :) Thanks!
If the part with the script is in that model then BoolValue = script.Parent.Parent.Toggle. You don't need script.Parent.MouseButton1Click:connect(onClick) then either
I've edited my post above to show the script that should work now
Still not working ;/ This is right isn't it? http://oi57.tinypic.com/qq1pfs.jpg
The script above should work if you copy it exactly
Please can you come on this? http://www.roblox.com/LavaBlast-Nuclear-Research-Facility-place?id=126056777. I will show you what I mean.
Perfect answer. Thank you! :)