I want the gui to change when the numbervalue is changed. But it’s not firing “Changed”. Neither prints (i have those for bug testing) fire. I have seen if it is a problem with the changing script, but it definitely isn’t because I have manually changed AmountOfSandInBucket myself on the Server side, so it is a problem with Changed.
script.Parent.Parent.AmountOfSandInBucket.Changed:Connect(function()
print("yes so")
local amountofsand = script.Parent.Parent.AmountOfSandInBucket
if amountofsand.Value >= script.Parent.Parent.MaxSandInBucket.Value then
print("ok thats good")
amountofsand.Value = script.Parent.Parent.MaxSandInBucket.Value
end
script.Parent.Parent.Bucket.SurfaceGui.TextLabel.Text = amountofsand.Value
end)
I recommend you to use local variables instead of using script.parent.parent sometimes it doesn’t find the variable you want, so use “local” to give your variable a name and I recommend again to use “Wait for child:()”
Perhaps I’m way off but it looks like you’re waiting for the changed event to happen and then setting the values inside it causing the changed event to happen. Could cause issues I think.