Attempt to index nil with 'Parent'

  1. What do you want to achieve? I’m trying to make a script where it clones the Character but it doesn’t work…

  2. What is the issue? It errors “attempt to index nil with ‘Parent’”.

  3. What solutions have you tried so far? Make it a server-script.

Script:

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		local IntroPlayer = char:Clone()
		IntroPlayer.Parent = workspace
		IntroPlayer.Name = "IntroPlayer"
		IntroPlayer.HumanoidRootPart.CFrame = workspace.MenuArea.SpawnPart.CFrame
	end)
end)

Please help if You can.

Try adding repeat task.wait() until char.AncestryChanged before the local IntroPlayer.

1 Like

Im going to try that out now, Hopefully it works!

If it didn’t work, then try this plr.CharacterAppearanceLoaded:Wait()

It Worked! Thx, also, how would I be able to put a animation on the clone?

I don’t know if it works for you, but maybe you could use plr.Character:Clone() instead? Usually that works for me. Also, is it not a server-script?

Put an animation inside of the model and play it when you want

Do :LoadAnimation() on it.

Thanks for your help, I’m going to put you in the credits!

1 Like