My problem is small and simple.
I was working on an accessory shop where i wanted to make it so that when the boolValue inside of an image button is set to true, the image button will be visible.
This is the code that changes the value
I know that this directory is perfect and there are no mistakes there.
When i see the value when the script is run, it does not change.
I would really appreciate help.
Have you done any debugging? Such as adding print() functions in places to log what parts are working correctly and what are not? Another issue could be when you are viewing the boolean value during run-time. You need to make sure you are viewing it client-side, not server-side (due to filteringEnabled).
Like why that second long line when you can just do this
--Basically the same script except it has less characters and has a higher chance for it to work
script.Parent.MouseButton1Click:Connect(function()
script.Bought.Value = true
script.Parent.Parent.Visible = false
end)
You need to change the AttributeChanged to a GetPropertyChangedSignal("Value") so that it will fire when the value is changed.
Edit: For future reference and anyone revisiting this post, the Value of an instance variable is a property, not and attribute - hence why AttributeChanged didn’t work. You also have to specify what property it is using to trigger the event, so in this case the "Value" string was added to the arguments.
Glad this helped you, and good luck with your future endeavours.