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

Is it possible to clone() 1 more thing in a place?

I'll use lighting as a place where the stuff will be

Lighting
----Store
------Hats <- trying to copy everything under this place
--------Black Domino
--------Midnight Sparkle Time Fedora
--------Duke of the Federation
--------Black Sparkle Time Fedora

etc

I'm trying it with this script

game.Lighting["Black Domino","Duke of the Federation"]:Clone().Parent = game.Players.LocalPlayer.Hats

2 comments

0

Can you explain what parent your wanting the object(s) to be cloned to? And what the parent of the original object(s) are parented to?

0

Because if you dont have the correct parent the script could clone then parent the object(s) to the wrong parent.

1 answer

✓ Accepted answer

Basicly, you want to use a table and a for i,v in pairs loop.

for i,v in next,game:GetService("Lighting"):GetChildren() do
	local NewObj = v:Clone()
	NewObj.Parent = game.Players.LocalPlayer.Hats -- Thats the parent you wanted right?? 
end

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