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

Why didn't my clone script work? LocalScript cloning ( Advance )

I made a LocalScript that clones a part in the workspace, but then I tried to clone a script inside the part. The part Is local and it can only be seen on the client's screens. If a player moves the part around other players won't see the part getting moved around, because it's a Local Part.

The Part is located in ReplicatedStorage

The Script is located in ReplicatedStorage

This is a LocalScript inside StarterGui

local part = game.ReplicatedStorage:WaitForChild("Part")
local scriptt = game.ReplicatedStorage:WaitForChild("Script")  

local clonepart = part:Clone()       -- Clones the part in workspace
clonepart.Parent = workspace
 
local clonescript = scriptt:Clone() -- Tries to clone the script in the part,
clonescript.Parent = clonepart       -- but it didn't work.

It did clone the part, but it didn't clone the script inside the part.

2 answers

Local Script in ReplicatedStorage can't work. Choose another parent like workspace or StarterGui.

1 comment

0

He already stated that his Local Script is inside StarterGui.

I just tested your script and it works for me. You could try putting the script inside the part, then you don't need to clone the script as it will clone with the part.

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