The script is supposed to make the X axis move based on the value of my IntValue
-- [Player Related Variables] -- local player = game.Players.LocalPlayer local level = player:WaitForChild("Level") local current = level:WaitForChild("Current") local max = level:WaitForChild("Max") -- [UI Related Variables] -- local gui = script.Parent local LevelFrame = gui:WaitForChild("Level Frame") local label = LevelFrame:WaitForChild("LVL") local exp = LevelFrame:WaitForChild("Exp Number") local bar = LevelFrame:WaitForChild("Frame") --[Changing Player Stats]-- label.Text = "Level "..level.Value exp.Text = current.Value.."/"..max.Value.." EXP" bar.Size = UDim2.new(current.Value/max.Value, 0, 1, 0) level.Changed:Connect(function(val) label.Text = "Level "..level.Value exp.Text = current.Value.."/"..max.Value.." EXP" bar.Size = UDim2.new(current.Value/max.Value, 0, 1, 0) end) level.Changed:Connect(function(val) exp.Text = current.Value.."/"..max.Value.." EXP" bar.Size = UDim2.new(current.Value/max.Value, 0, 0, 0) end)
I might be wrong but you can try this.
I am also confused as to why you have 2 .changed events for the level...
-- [Player Related Variables] -- local player = game.Players.LocalPlayer local level = player:WaitForChild("Level") local current = level:WaitForChild("Current") local max = level:WaitForChild("Max") -- [UI Related Variables] -- local gui = script.Parent local LevelFrame = gui:WaitForChild("Level Frame") local label = LevelFrame:WaitForChild("LVL") local exp = LevelFrame:WaitForChild("Exp Number") local bar = LevelFrame:WaitForChild("Frame") -- [Changing Player Stats] -- local formula = current.Value / max.Value label.Text = "Level " .. level.Value exp.Text = current.Value .. "/" .. max.Value .. " EXP" bar:TweenSize(UDim2.new(formula, 0, 1, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0, true) level.Changed:Connect(function(val) local formulaNew = current.Value / max.Value label.Text = "Level " .. level.Value exp.Text = current.Value .. "/" .. max.Value .. " EXP" bar:TweenSize(UDim2.new(formulaNew, 0, 1, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.5, true) end)
Let me know if there are any issues, will try to fix immediately!