#Get all items inside a folder from replicated storage and give them to the player

19 messages · Page 1 of 1 (latest)

oblique sandal
#

use a script to get all the items inside a folder inside replicated storage and give them to a player

obtuse wigeon
#

so

#

you're looking for a script that does that?

oblique sandal
#

yes, thank you! specifically clone them so other players can get it.

obtuse wigeon
#

sure

#

alright done

carmine lanternBOT
#

studio** You are now Level 4! **studio

obtuse wigeon
#
-- The name of the folder you want to get items from
local folderName = "MyFolder"

-- The player you want to give the items to
local player = game.Players.LocalPlayer

-- Get the folder from ReplicatedStorage
local folder = game.ReplicatedStorage:FindFirstChild(folderName)

-- Check if the folder exists
if folder then
    -- Loop through all the children in the folder
    for _, item in ipairs(folder:GetChildren()) do
        -- Clone the item and give it to the player
        local newItem = item:Clone()
        newItem.Parent = player.Backpack
    end
else
    warn("Folder " .. folderName .. " does not exist in ReplicatedStorage")
end
#

just replace the names with the folder u name it

#

*named

oblique sandal
#

tysm!!

obtuse wigeon
#

or just tell me the name of the folder so i can redo it

#

np

#

added a warninh

#

warning

#

at the end

#

if the folder doesn't exist

#

it will tell u

oblique sandal
#

thank you again!