My level system doesn't carry over XP if you get more than you need. If you need 1000 XP to level up, but get 1500 then it won't make the 500 count towards the next level. I was thinking maybe if the XP value is greater than what you need to level up it can store it as a value and then add the value to the player's XP after they level up? Not really sure how to do this though. Here's my level system:
XP.Changed:Connect(function()
if XP.Value >= Level.Value * 20 then
Stats.XP.Value = 0
Player.Character.Humanoid.Health = Player.Character.Humanoid.Health + 100000
Stats.Level.Value = Stats.Level.Value + 1
Stats.StatPoints.Value = Stats.StatPoints.Value + 3
Player.Character.UpperTorso.LevelUp:Play()
local Particle = game.ReplicatedStorage.LevelParticle:Clone()
Particle.Parent = Player.Character.UpperTorso
Particle.delete.Disabled = false
end
end)
thanks for reading

1 comment
Could you not just change line3 to “Stats.xp.Value = xp.Value - Level.Value * 20” ?