Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 6 years ago

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

0
The "if statement" is there right now because, later I am going to have it check if the player has bought it. FlyingFighter11 20 — 6y
0
Try doing MakeJoints before setting the parent ABK2017 406 — 6y
0
Actually, its not destroying the first model, are you sure they're not spawning on top on each other? ABK2017 406 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

This has been answered somewhere else.

0
Can i have a link to where you solved the problem? CrimSint -3 — 6y
Ad

Answer this question