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

how to move everything from one folder the player backpack?

Asked by 7 years ago

ok so im trying to make a script that clones everything from a folder and put it into a players backpack any ideas?

0
@goulstem but what if i just decsied to add like 2-3 more items to that folder then i would have to go to my script and add those adds i want to make my script to find the items in the folder and then clone those items popthecorn145 16 — 7y

1 answer

Log in to vote
0
Answered by
Goulstem 8144 Badge of Merit Moderation Voter Administrator Community Moderator
7 years ago

You can use a generic for loop to iterate through your folder's descendants, then set the Parent property of each object to the Player's backpack.

local folder = game.ReplicatedStorage.Tools --Folder

for _,v in next,folder:GetChildren() do --Generic for
    v.Parent = game.Players.Player.Backpack --Set the parent
end
0
worked great thanks! popthecorn145 16 — 7y
Ad

Answer this question