I'm trying to create a Car Spawner, and it works fine. But I want the car to spawn infront of them.
This is my script that's causing an error:
RE.SpawnCar.OnServerEvent:Connect(function(player,carName)
local spawnedCar = game:GetService("ReplicatedStorage"):WaitForChild("Vehicles"):FindFirstChild(carName):Clone()
spawnedCar.Name = player.Name.."'s Car"
spawnedCar.Parent = game:GetService("Workspace")
spawnedCar:MakeJoints()
local char = player.Character or player.CharacterAdded:Wait()
spawnedCar:SetPrimaryPartCFrame(char.HumanoidRootPart.CFrame.LookVector + Vector3.new(0,3,10))
end)
And this is the error I am getting:
09:18:00.788 - Unable to cast Vector3 to CoordinateFrame
09:18:00.789 - Stack Begin
09:18:00.789 - Script 'ServerScriptService.EventHandler', Line 7
09:18:00.789 - Stack End
Any help?

4 comments
This didn't really work out. The car just goes to the Workspace and doesn't teleport infront of the character.
It also gives me no errors with this script.
Your issue had to do with casting a Vector3 to a CFrame, not an issue with your math. If you wanted the car to spawn in front of the HumanoidRootPart, what you need to do is to add the HumanoidRootPart's position to the HumanoidRootPart's LookVector.
Errors aren't the end-all-be-all of scripting since they can't point out unintentional behavior. They can only point out errors with compiling and running your script, such as issues with casting and syntax.