P1. So i am trying to make a leaderboard leveling system but when i add like 100 exp for it the level up the 100 exp stays, i want to the exp to reset or if they let say gain 10 more than the exp required to level up their exp would be 10 and their level would be the next level
player = game.Players.LocalPlayer
game.Players.PlayerAdded:connect(function(plr)
local ldrstats = Instance.new('Folder',plr)
ldrstats.Name = 'leaderstats'
local lvl = Instance.new('IntValue',ldrstats)
lvl.Name = 'Level'
lvl.Value = 0
local xp = Instance.new('IntValue',ldrstats)
xp.Name = 'Exp'
xp.Value = 0
local function update()
lvl.Value = math.floor(xp.Value/100)
end
xp.Changed:connect(update)
if player.leaderstats.Level.Value + 1 then
player.leaderstats. Exp.Value = 0
end
end)
P2. , How do i make it so that you require certain amounts of exp so level up so like at level 1 you need 100 to get to level 2 and u need 200 to get to level 3 (you wont have to answer p2)

2 comments
leader board doesnt even show up anymore but thanks for the help
Instead of Folder for Leaderstats when creating new Instance, Replace it with "Configuration". Hope I was helpful