Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Gui Button for toggling bool value not working?

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)

6 comments

0

Format your code correctly

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.

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.

0

Please do not downvote this, as this site is for questions. This is a question.

0

Hmm, r u sure that inside the sword there is "TestSword"?

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?

1 answer

Try moving the value to ReplicatedStorage. That may work.

1 comment

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.