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

What have I done wrong in my vehicle spawner script?

Asked by 10 years ago

Hi guys, I've been trying to get this code to work for 2 days now. This is what it's supposed to do:

1) When the left mouse button is clicked, and the tool is equipped, identify vehicle pad 2) Clone the bike in ReplicatedStorage(no, it's not a possibility that these parts fell off the map. I anchored all of them.) 3) Place the new bike on the pad 4) Unanchor the bike 5) Destroy itself.

Here's the code block: (yes, this is in a localscript.)

01local ADFBike = game.ReplicatedStorage["ADF Bike"]
02local Tool = script.Parent
03 
04function unanchor (m)
05    for _,i in pairs (m:GetChildren()) do
06        if i:IsA("BasePart") then
07            i:MakeJoints()
08            i.Anchored = false
09        else
10            unanchor(i)
11        end
12    end
13end
14 
15Tool.Equipped:connect(function (Mouse)
View all 32 lines...
1
Which of those print statements is running? adark 5487 — 10y

1 answer

Log in to vote
0
Answered by
RM0d 305 Moderation Voter
10 years ago
01local ADFBike = game.ReplicatedStorage["ADF Bike"]
02local Tool = script.Parent
03 
04function unanchor (m)
05    for _,i in pairs (m:GetChildren()) do
06        if i:IsA("BasePart") then
07            i:MakeJoints()
08            i.Anchored = false
09        else
10            unanchor(i)
11        end
12    end
13end
14 
15Tool.Equipped:connect(function (Mouse)
View all 34 lines...
1
will add more later RM0d 305 — 10y
Ad

Answer this question