What I'm trying to do is make it so when your xp is over your xp required to level up, you level up. The xp is reset to 0 after leveling up, and the xp required to level up again is also increased, however it is not increasing my level by 1.
wait(3)
xp = script:findFirstAncestor("PlayerGui").Parent.leaderstats.Exp.Value
xpn = script:findFirstAncestor("PlayerGui").Parent.leaderstats.ExpNeeded.Value
level = script:findFirstAncestor("PlayerGui").Parent.leaderstats.Level.Value
while wait()do
script.Parent.Text = xp .. "/" .. xpn
if xp >= xpn then
level = level + 1
xpn = xpn * 1.25
xp = 0
end
end
-- This makes you level up, and your experience needed to level again is increased. --

1 comment
i just edited it into code blocks