Hello! So I am not sure on how to work this but I have a remote event fire when someone clicks a gui and it spawns a car. But for some reason Idk How to do it like that.
Script:
local events = game.ReplicatedStorage.CarSpawnerEvents
In the Server script, after you clone the car, you’ll want to Parent it to the workspace. clone.Parent = workspace
Then, you will wanna position it. You can do this with MoveTo(). Make sure before doing this that the car model has a PrimaryPart. To set its PrimaryPart, look in the model’s properties for where it says “PrimaryPart.” Then click that and then click whatever part inside the model you want to be its PrimaryPart. This will make it act as sort of the “core” of the model.
So once you’ve done that: clone:MoveTo(position)
Try this, your first script doesn’t have the player variable which is always the first variable on an OnServerEvent. Also, you are finding CarName inside the ViewPortCars, but you need to use a WaitForChild since you are finding for the CarName’s value, not the CarName word itself.
local events = game.ReplicatedStorage.CarSpawnerEvents
events.SpawnCar.OnServerEvent:Connect(function(player, CarName, Addon1)
local clone = game.ReplicatedStorage.ViewPortCars:WaitForChild(CarName):Clone()
end)