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

7 comments
could you provide the full error?
attempt to call a nil value
Does you setting "Close functions" or something along that line disabled?
PoWerofThEePg, dont quite understand what you meant?
int.Changed:Connect() <--- This is wrong.
Look at the example here and see how yours is very different: https://developer.roblox.com/en-us/api-reference/event/IntValue/Changed
And by the way I'm just 8 so please do not judge me too too hard...