local Progress = script.Parent local Player = game.Players.LocalPlayer Player.EXP.Value.Changed:connect(function() Progress.Size = Progress.Size + Progress.UDim2.new(0,40,0,0) end) Player.Level.Value.Changed:connect(function() Progress.Size = Progress.UDim2.new(0,40,0,0) script.Parent.Text = Player.Level.Value end)
Output 16:21:51.904 - Players.Player1.PlayerGui.Level Up Bar.Holding Bar.Frame.LocalScript:6: attempt to index field 'Value' (a number value)
.Changed is on the IntValue itself, not on its Value property
valueObj.Changed:connect(function(val) print(val) --will print the new value end)
Not that .Changed on values work differently than on other Instances. On values, it only triggers when Value changes and it'll be the new value. On all other instance types, its the property name that was changed.
local Progress = script.Parent local Player = game.Players.LocalPlayer Player.EXP.Changed:connect(function() Progress.Size = Progress.Size + Progress.UDim2.new(0,40,0,0) end) Player.Level.Changed:connect(function() Progress.Size = Progress.UDim2.new(0,40,0,0) script.Parent.Text = Player.Level.Value end)