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

How do I make my car spawning script remove part local only?

Asked by 8 years ago

Hi. I'm making a car spawn script, It works perfectly. However, I want it to remove the old spawned car when you spawn a new one. Is there any way to do this locally, and without having to call them directly? Here's the script.

function onClick()
local ae = game.Lighting.bmww
local name = game.Players.LocalPlayer.Name
local char = game.Workspace:FindFirstChild(name)
local b = game.Lighting.bmww:Clone()

b.Parent = game.Workspace
b:MoveTo(char.Torso.Position + Vector3.new(0, 2, 10))
b:MakeJoints()
-- line removing old one
game.Workspace.cadi:remove()


end

script.Parent.MouseButton1Click:connect(onClick)
0
Eww, put your car in ServerStorage ChemicalHex 979 — 8y
0
But it works as it is. I'm asking a different thing. User#9487 0 — 8y

Answer this question