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

How do you fix the error "attempt to index nil with 'CFrame'"?

Asked by 2 years ago

When i go to load up the gam it says an error "attempt to index nil with 'CFrame'" and I don't know how to fix it. This is the script line. character:FindFirstChild("HumanoidRootpart").CFrame = AvailableSpawnPoints[1].CFrame

1 answer

Log in to vote
0
Answered by 2 years ago

Try using WaitForChild, and the letter p is CAPS

character:WaitForChild("HumanoidRootPart").CFrame = AvailableSpawnPoints[1].CFrame
Ad

Answer this question