Unable to cast Vector3 to CoordinateFrame?
Hello, how do I fix this error Unable to cat Vector3 to CoordinateFrame? It's on line 29.
01 | local Players = game:GetService( "Players" ); |
02 | local InsertService = game:GetService( "InsertService" ); |
04 | local Cars = { 5083437873 , 5083676767 } |
06 | Players.PlayerAdded:Connect( function (player) |
08 | local character = player.Character or player.CharacterAdded:Wait() |
10 | local HumanoidRootPart = character:WaitForChild( "HumanoidRootPart" ) |
12 | local carId = Cars [ math.random( 1 , #Cars) ] ; |
13 | local root = InsertService:LoadAsset(carId); |
15 | local instances = root:GetChildren() |
16 | if #instances = = 0 then |
21 | root = root:GetChildren() |
26 | root.Body.Drive.Disabled = false |
27 | root.Parent = workspace |
29 | root:SetPrimaryPartCFrame(HumanoidRootPart.Position) |