I'm using a LocalScript to change a Player's GUI if an IntValue in a Player equals a number.
The point of the script is to make a GUI visible if a player has more than 0 of an item. My script is:
player = game.Players.LocalPlayer watermelonvalue = player.Inventory.Seeds.Watermelon.Value if watermelonvalue >= 1 then print("Watermelonvalue was true") script.Parent.Visible = true elseif watermelonvalue == 0 then script.Parent.Visible = false
The script shows the GUI if the IntValue is 1 or greater but if I change the value in the server the GUI doesn't change when the value is 0.
You'll need to detect when the Value is changed. You can use the GetPropertyChangedSignal event to detect when the Value is changed.
Player = game.Players.LocalPlayer Watermelon = Player.Inventory.Seeds.Watermelon Watermelon:GetPropertyChangedSignal("Value"):Connect(function() if Watermelon.Value >= 1 then print("Watermelonvalue was true") script.Parent.Visible = true elseif Watermelon.Value == 0 then script.Parent.Visible = false end end)