Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Xp progress bar is not working?

My script is;

local player = game.Players.LocalPlayer
local leaderboard = player:WaitForChild("leaderstats")
local bar = script.Parent
leaderboard:WaitForChild("xp")
leaderboard:WaitForChild("maxXp")
local maxXp = leaderboard.maxXp.Value
local xp = leaderboard.xp.Value

leaderboard.xp.Changed:Connect()
 bar.Size = UDim2.new((0.165/xp),0,0,25)

2 comments

0

You want one for an obey?

0

Obby*

1 answer

The size of the bar should be a fraction between the XP and the maximum XP. If 0.165 is the size of the whole bar, then it'd be:

bar.Size = UDim2.new((0.165*(xp/maxXp),0,0,25)

This discussion is preserved as it was. New answers, comments, and votes are closed.