Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Gui Button for toggling bool value not working?

Asked by 6 years ago

I have a sword with multiple bool value under it. These bool values have corresponding re-skin textures. I am trying to make a button that will function as an equip button for the different values depending on what the player has and if they have clicked the gui button to enable that bool value.
I have the following code but it is not doing anything. No errors. Also how could I make it so they can only set true to one at a time when i intend to have multiple button with this script just calling on a different value.

This script is a local script under the button itself. I have a master script but wasn't sure how to incorporate it into that. My game is filtering enabled.


~~~~~~~~~~~~~~~~~`` local testswordvalue = game.ServerStorage.Sword:FindFirstChild("TestSword") script.parent.MouseButton1Down:connect(function() if testswordvalue.Value then testswordvalue.Value = true else testswordvalue.Value = false end end) ~~~~~~~~~~~~~~~~~``
0
Format your code correctly Goulstem 8144 — 6y
0
I have tried but it keeps turning into regular text when I paste it here that is the best I could get it. If you click for the raw code text it shows it all and just ignore the ~~~ lines. Zeustice 41 — 6y
0
I have provided all information I can. Complied with the rules of this forum and make a great effort to understand the code. The downvote is not appropriate or necessary. Zeustice 41 — 6y
0
Please do not downvote this, as this site is for questions. This is a question. hiimgoodpack 2009 — 6y
View all comments (2 more)
0
Hmm, r u sure that inside the sword there is "TestSword"? greatneil80 2647 — 6y
0
After further reading I have been made aware that you can't use a local script to call on a change in server storage. I am now looking into using tables in replicated storage with a remote event to call on the changed event in the server storage. Does that sound about right for how I should now go about this? Zeustice 41 — 6y

1 answer

Log in to vote
0
Answered by
znepb 17
6 years ago

Try moving the value to ReplicatedStorage. That may work.

0
That definetly sounds like what I need to do. I have also read about tables and I believe that is what I need to use if Intend to have multiple values. Zeustice 41 — 6y
Ad

Answer this question