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

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

Asked by 6 years ago
Edited 6 years ago

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

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)) KingLoneCat 2642 — 6y
0
Thanks doggyd12 0 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

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
Ad

Answer this question