intValue of Level wont change when xp and maxXp are equal?
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?
01 | local int 3 = game.Players.LocalPlayer:WaitForChild( "leaderstats" ) |
02 | local int = game.Players.LocalPlayer.leaderstats:WaitForChild( "xp" ) |
03 | local int 2 = game.Players.LocalPlayer.leaderstats:WaitForChild( "maxXp" ) |
04 | local level = game.Players.LocalPlayer.leaderstats:WaitForChild( "level" ) |
06 | if int.Value = = int 2. Value then |
07 | level.Value = level.Value + 1 |
09 | int 2. Value = int 2. Value + 250 |