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

Why would the car spawn when I click the button?

Asked by 5 years ago

The code is in a Local Script

local model = game.ServerStorage.Dew

function click()

    newModel = model:Clone()
    newModel.Parent = workspace
    newModel:makeJoints()
    script.Parent.Parent.Parent:Destroy()
end

script.Parent.MouseButton1Click:connect(click)

2 answers

Log in to vote
0
Answered by
Zottic 19
5 years ago

I don't really know the path of the actual script but I will try my best to answer.

local model = game.ServerStorage.Dew -- game:GetService("ServerStorage").Dew

function click() -- nil value

    newModel = model:Clone()
    newModel.Parent = workspace -- game.workspace
    newModel:makeJoints()
    script.Parent.Parent.Parent:Destroy() -- check how many parents the script has
end

script.Parent.MouseButton1Click:connect(click)

Ad
Log in to vote
0
Answered by
Cyrakohl 108
5 years ago

It’s spawned but you need to position the car in a spawn point if you look in explorer the car will be there

0
I don't get what you mean, I already position it. Luke2323244 17 — 5y

Answer this question