Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

error attempt to index nil with 'CharacterAdded'? I need help

Asked by 3 years ago
Edited 3 years ago

`iv been working on my Checkpoint for month and I cant find the problems so I came here for answers.

game.Players.PlayerAdded:Connect(function(player)

    local stats = Instance.new("IntValue", player)
    stats.Name = "leaderstats"

    local Stage = Instance.new("IntValue", stats)
    Stage.Name = "Stage"
    Stage.Value = 1
end)

player.CharacterAdded:Connect(function(Character)
    repeat wait()until player.Character ~=nil
    local hum = Character:WaitForChild("Humanoid")
    wait()
    Character:MoveTo (Checkpoints[Stage.Value].Position)


end)

Oh and the script is in the ServerScriptService if that helps.

BTW it says unknown global player, checkpoint, and Stage if that also help.

0
sorry this is my first time so I dont know how to use this playerboygotswag2 0 — 3y
0
Please respond back if you can, I really need help. playerboygotswag2 0 — 3y

Answer this question