heres my script
game.Players.PlayerAdded:Connect(function(plr)
local stats = Instance.new("IntValue",plr)
stats.Name = "leaderstats"
local Gold = Instance.new("IntValue",stats)
Gold.Name = "Gold"
Gold.Value = 0
local XP = Instance.new("IntValue",stats)
XP.Name = "XP"
XP.Value = 0
local lvl = Instance.new("IntValue",stats)
lvl.Name = "lvl"
lvl.Value = 0
local xpneeded = 99 + (25 * lvl.Value)
XP.Changed:connect(function()
if XP.Value > xpneeded then
lvl.Value = lvl.Value + 1
XP.Value = 0
end
end)
end)

4 comments
It seems like you did it good, what is going wrong here?
nvm i just need to local xpneeded in the XP changed function
Make sure to edit your title and put [SOLVED] after it.
k thx