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

Im making obby and i have problem with this script. Do you guys know how to fix this?

Asked by 3 years ago

game.Players.PlayerAdded:Connect(function(plr) local stage = plr:WaitForChild("leaderstats").stage plr.CharacterAdded:connect(function(char) repeat wait() until plr.Character ~= nil wait(0.01) local Checkpoint = game.Workspace.Stages:FindFirstChild(stage.Value) char:FindFirstChild("HumanoidRootPart").CFrame = CFrame.new(Checkpoint.Position +Vector3.new(0,5,0), Checkpoint.Position) char:FindFirstChild("HumanoidRootPart").Orientation = Vector3.new(0,0,0) wait(0.1) end) end)

stage is not a valid member of IntValue "Players.voffroad1.leaderstats" - Server - CheckPoints:2

1 answer

Log in to vote
0
Answered by
Xapelize 2658 Moderation Voter Community Moderator
3 years ago
game.Players.PlayerAdded:Connect(function(plr)
    local stage = plr:WaitForChild("leaderstats").Stage -- I assume your stage capitalization is wrong. Consider changing the S to capital letter.
    plr.CharacterAdded:connect(function(char) 
    repeat 
        wait() 
    until plr.Character ~= nil 
    wait() 
    local Checkpoint = game.Workspace.Stages:FindFirstChild(stage.Value)
    char:FindFirstChild("HumanoidRootPart").CFrame = CFrame.new(Checkpoint.Position +Vector3.new(0,5,0), Checkpoint.Position) char:FindFirstChild("HumanoidRootPart").Orientation = Vector3.new(0,0,0) 
    wait() 
    end) 
end)
Ad

Answer this question