like, everything works, when I walk exp goes up as expected but when exp hits max it does not level up, it just keeps going, here is my script in serverscriptservice, I apologize for bad english
local maxXp = 20 game.Players.PlayerAdded:Connect(function(player) local levelinfo = Instance.new("Folder") levelinfo.Name = "LevelsInfo" levelinfo.Parent = player local level = Instance.new("IntValue") level.Name = "Level" level.Value = 1 level.Parent = levelinfo local exp = Instance.new("IntValue") exp.Name = "Experience" exp.Value = 0 exp.Parent = levelinfo local xpNeeded = Instance.new("IntValue") xpNeeded.Name = "expNeeded" xpNeeded.Value = 20 xpNeeded.Parent = levelinfo exp.Changed:Connect(function(newExp) if exp.Value >= xpNeeded.Value then level.Value += 1 exp.Value -= xpNeeded.Value xpNeeded.Value = xpNeeded.Value + 2 end end) end)
this part here does not seem to do anything
exp.Changed:Connect(function(newExp) if exp.Value >= xpNeeded.Value then level.Value += 1 exp.Value -= xpNeeded.Value xpNeeded.Value = xpNeeded.Value + 2 end end)
I tried recreating the problem, but there seems to be no Problem. I have sent my .rblx file as an example to how it may work