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

Why does my primary part no longer exist?

Asked by 5 years ago

I'm trying to do a car spawner script and I got so close to finishing but I get this error message

121:59:59.967 -
2Model:SetPrimaryCFrame() failed because no PrimaryPart has been set, or the PrimaryPart no longer exists. Please set Model.PrimaryPart before using this.

Here is my script

1game.ReplicatedStorage:WaitForChild("SpawnCar").OnServerEvent:Connect(function(player, NameOfCar)
2    local car = game.ServerStorage.Cars:FindFirstChild(NameOfCar):Clone()
3    car:SetPrimaryPartCFrame(player.Character.HumanoidRootPart.CFrame + Vector3.new(0,1,0))
4    car.Parent = workspace
5    car:MakeJoints()
6 
7 
8end)

It says to use Model.PrimaryPart and isn't that what i'm setting?

1
There is a Primary Part property in the model, make sure you set it Nguyenlegiahung 1091 — 5y
0
Thanks Darksniper600 104 — 5y

Answer this question