Vehicle Spawner Help

I’m trying to create a Vehicle Spawner, I have everything set up, but I’d like to move the vehicle to a Spawn Pad.

These are some parts of the script that handle getting s Spawn Pad.

Getting a Spawn Pad:

function GetVehicleSpawnPad()
	for _, v in pairs(workspace:WaitForChild("CivilianSpawnPads"):GetChildren()) do
		if v:FindFirstChild("BeingTouched") and v.BeingTouched.Value == false then
			return v
		end
	end
	return nil
end

local SpawnPad = GetVehicleSpawnPad()
	if not SpawnPad then
		FE.PushNotification:FireClient(Player, "Red", "No available spawn pads.")
		return
	end

	local VehicleClone = VehicleModel:Clone()
	local SpawnLocation = SpawnPad

Moving the vehicle to a Spawn Pad:

VehicleClone:PivotTo(CFrame.new(SpawnLocation.Position) + Vector3.new(0, 5, 0))

This is what happens when a car is spawned and move to a pad.
image

But the pads are like this in studio
image

5 Likes

Do you mean the vehicle is not spawned at the angle you want?

If yes you can use the following code to rotate the angle.

VehicleClone:PivotTo(CFrame.new(SpawnLocation.Position) * CFrame.Angles(0,math.rad(90),0)+ Vector3.new(0, 5, 0))
3 Likes

Are you an ERLC dev or are you Copying/Uncopylocking ERLC??

2 Likes

None, I’m making my own roleplay game like ER:LC

2 Likes

Did you take anything off ERLC like maps or scripts? Just wondering

1 Like

No, I’ve found some things in the toolbox

1 Like

Hmm well i do know that FE.PushNotification is part of ERLC’s code, you are also doing FireClient with the same arguments ERLC does

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.