Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

1 comment

0

"Im using FE" You don't say?

1 answer

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.