I have begun setting up a shop in my game. I have a sword in server storage with multiple bool values under it. Each value has a corosponding texture so when one is set true it changes the swords texture. Issue I am having is creating a system where players have multiple values for them to be able to go through them and switch them on or off or an "equip" function basically. I have tried creating a GUI button to toggle one of the values but it has not been working. It is a local script under the text button itself. After further reading I have come to undderstand that I can't use a local script to call on things in server storage so what else would be the solution?
My main focus right now is creating a GUI inventory so after you buy the sword value from the shop (I have this working already) it will then go to the inventory that has buttons along with the image of what they bought and they can then toggle true or false on the value.
Here is the script:
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)
I appreciate any help with this. I am also welcome to any suggestions for what I could be doing differently. |