When I check the error it says ServerScriptService.LevelUp:2: attempt to index nil with 'FindFirstChild' If anyone can help me I would be gratefull here's the script
local plr = game.Players.LocalPlayer
local Stats = game.Players.LocalPlayer:FindFirstChild("Stats") --This is finds the Stats
local XP = Stats:FindFirstChild("XP") -- This should find XP
if XP.Value > 70 *plr.leaderstats.Level.Value then -- I wanted to do if the XP is higher then 70 times level so what I went times by level is when you get lvl 2 it times it to 140
plr.leaderstats.Level.Value = plr.leaderstats.Level.Value +1 -- this gives it
end
Hope I explained it right to you guys Anyone can help thanks again

5 comments
Could I have a whole working script?
okay please wait about 10 mins
hover your mouse on the code and click the "view source" on the upper right. you can copy the code there faster.
its better to put the while loop in the end of the function.. anything after the while loop inside the function will not run unless the while loop is stopped
I made a new one, but I will still accept it