Here is my script, and i tried to make it so when the amount of xp and maxXp are equal the xp value will reset, the maxXp value will become higher by 250 and the level will raise by 1, but it just says attempt to call nil value?
local int3 = game.Players.LocalPlayer:WaitForChild("leaderstats") local int = game.Players.LocalPlayer.leaderstats:WaitForChild("xp") local int2 = game.Players.LocalPlayer.leaderstats:WaitForChild("maxXp") local level = game.Players.LocalPlayer.leaderstats:WaitForChild("level") int.Changed:Connect() if int.Value == int2.Value then level.Value = level.Value + 1 int.Value = 0 int2.Value = int2.Value + 250 end
Just figured it out, had to just put xp.Changed and use a function!