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

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

Asked by 8 years ago

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
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? MessorAdmin 598 — 8y
0
Because if you dont have the correct parent the script could clone then parent the object(s) to the wrong parent. MessorAdmin 598 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

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
Ad

Answer this question