Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Vehicle Clone Doesn't Drive After Spawned. How do you make it drive?

I have been trying to make a vehicle spawn next to the player when the inventory spawn button is clicked. I got the vehicle to clone and spawn next to me, but it doesn't drive when I go in. I am testing the spawn button with the Van in the toolbox, the scripts and the Vehicle Seat will not work.

local player = game.Players.LocalPlayer

local charPart = player.Character.HumanoidRootPart

local Inv = player.PlayerGui.Inventory

local InvSpawn = Inv.Frame.SpawnButton


InvSpawn.MouseButton1Click:connect(function()
	
	if true then
		
		local originalVan = game.Workspace.Van
		
		local cloneVan = originalVan:Clone()
		
		cloneVan.Parent = game.Workspace
		
		cloneVan:SetPrimaryPartCFrame(CFrame.new(charPart.CFrame.X + 10, charPart.CFrame.Y + 5, charPart.CFrame.Z))
		
		cloneVan:MakeJoints()
		
	end
	
end)

Van Model : https://www.roblox.com/library/187731990/Transporter-Van

3 comments

0

The "if statement" is there right now because, later I am going to have it check if the player has bought it.

0

Try doing MakeJoints before setting the parent

0

Actually, its not destroying the first model, are you sure they're not spawning on top on each other?

1 answer

This has been answered somewhere else.

1 comment

0

Can i have a link to where you solved the problem?

This discussion is preserved as it was. New answers, comments, and votes are closed.