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

Why isn't the model cloning?

Asked by 9 years ago

I have it so that when the player hits the button "Play" it makes their camera focus on them, and then is supposed to clone the model called DisplayForestCamoMech, and then the mech's position is the players position + (5,0,5)! Why isn't this happening!

FIXED

Here is my [Fixed] script

    if script.Parent.Value == 1 then
    script.Parent.Parent.Parent.Parent.Parent.Parent.Workspace.CurrentMech:remove()
    mech = script.Parent.Parent.Parent.Parent.Parent.Parent.ReplicatedStorage.DisplayForestCamoMech:Clone()
    mech.Name = "CurrentMech"
    mech.Parent = game.Workspace
    mech:makeJoints()
    script.Parent.Parent.MechName.Text = ("Forest Camo Mech single gun")
    elseif script.Parent.Value == 2 then
    script.Parent.Parent.Parent.Parent.Parent.Parent.Workspace.CurrentMech:remove()
    mech = script.Parent.Parent.Parent.Parent.Parent.Parent.ReplicatedStorage.DisplayForestCamoMechDoubleGuns:Clone()
    mech.Name = "CurrentMech"
    mech.Parent = game.Workspace
    mech:makeJoints()
    script.Parent.Parent.MechName.Text = ("Forest Camo Mech double guns")
    end

Please help!!! Thank you!!!

0
Hope this works. Replace line 5 with this: mech = ReplicatedStorage.DisplayForestCamoMech:Clone() UserOnly20Characters 890 — 9y
0
no, but thanks! yogipanda123 120 — 9y
0
Sorry then :c UserOnly20Characters 890 — 9y
0
If you don't mind me asking why do you have so many Parent's? It might be wise to recheck the parent to see if there is a miss error. UserOnly20Characters 890 — 9y
View all comments (3 more)
0
Is this a LocalScript or a Script, do you have FilteringEnabled on? Spongocardo 1991 — 9y
0
I got this to work, thanks tho! yogipanda123 120 — 9y
0
No problem, but you can just get rid of the mass amounts of Parents for the mech object lines and just use game instead. It makes your code more readable to other people. Spongocardo 1991 — 9y

Answer this question