game.Players.PlayerAdded:Connect(function(plr)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = plr
local stage = Instance.new("IntValue",leaderstats)
stage.Parent = leaderstats
stage.Value = 1
stage.Name = "Stage"
plr.CharacterAdded:Connect(function(Character)
repeat wait() until Character ~= nil
local Level = game.Workspace.AllCheckpoints:FindFirstChild(stage.Value)
Level.Value = stage.Value
Character:WaitForChild("HumanoidRootPart").CFrame = Level.stage + Vector3(0,5,0)
end)
end)
I dont know what is wrong with this script. Could you help me. It says "attempt to index local 'level' (a nil value)"
Please help me
It says there is an error in line 12.

2 comments
Your code is so messy and hard to read.. lol
I edited it, you should see it correctly now