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

Scripts break when I clone a brick with the script inside. how to fix?

Asked by
o_kh 0
6 years ago

Im currently developing a game right now, which needs to have candy cloned. Problem is when I do clone it the scripts dont work when in workspace. The original candy works in workspace its just the cloned version. Im using FE and here is part of the big script i used:

    local h1 = workspace.candy.hershey:Clone()
    local h2 =  workspace.candy.hershey2:Clone()
    local h3 =  workspace.candy.hershey3:Clone()
    local t1 =  workspace.candy.twix:Clone()
    local t2 = workspace.candy.twix2:Clone()
    local scrp = script.Parent.scripttoclone:Clone()
    scrp.Parent = h1
    local cloneofclone = scrp:Clone()
    cloneofclone.Parent = h2
    local cloneofclone2 = scrp:Clone()
    cloneofclone2.Parent = h2
    local cloneofclone3 = scrp:Clone()
    cloneofclone3.Parent = h2
    local cloneofclone4 = scrp:Clone()
    cloneofclone4.Parent = h2

its really messy but it should have done the job

0
"Im using FE" You don't say? User#19524 175 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

this may help with you're situation

c = game.ReplicatedStorage.Name here:Clone()  -- change Name here
c.Name = "name here" --Change name here
c.Parent = game.ReplicatedStorage 
game.ReplicatedStorage.Name here.Parent = workspace -- change Name here

where it says name here put the name of your model/'s in that.

(make sure u have a replica of that model or tool in ReplicatedStorage or else it won't work)

Ad

Answer this question