Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

When I Was Setting The PrimaryPart It Said Gave Me Errors?

The Code I Used Was PP = game.StarterPlayer.StarterCharacter.PrimaryPart game.StarterPlayer.StarterCharacter:SetPrimaryPartCFrame(PP) wait(0.5) game.StarterPlayer.StarterCharacter:GetPrimaryPartCFrame(PP) Then I got two errors 09:16:10.880 - Model:GetPrimaryCFrame() failed because no PrimaryPart has been set, or the PrimaryPart no longer exists. Please set Model.PrimaryPart before using this. 09:16:10.884 - A primary part should be set so that the character can be spawned correctly This And 09:16:10.746 - Argument 1 missing or nil Help I Don't know What to do or anything i really need help with this

2 comments

1

You haven't set a primary part yet. All you did was make a reference to the Primary part of the model, which hasn't been set yet. So, :SetPrimaryPartCFrame() won't work. Also, the parameter of :SetPrimaryPartCFrame() is a CFrame, so an object doesn't go in there. It's :SetPrimaryPartCFrame(CFrame.new(x, y, z))

0

Thanks

1 answer

The reason you are getting this error is because you are not setting it correctly. The command :SetPrimaryPartCFrame() sets the cframe of the primary part of the model, not the actual Primarypart it self. If you would like to set the primary part, all you have to do is this:

game.StarterPlayer.StarterCharacter.PrimaryPart=PP

This discussion is preserved as it was. New answers, comments, and votes are closed.