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)

4 comments
Are you sure that you are Changing the Values for the exp from the Server.
Yes, it shows on gui too and when I test it and check it exp value goes up.
does the exp.Changed function fire?
idk what happened but I copied everything in that script then deleted whole script, then created new script at same place and copied all stuff in it, now it works