So I have a folder in ServerStorage that I instanced in one script and I need to reference it in another script. The folder's name is set to player.Name.
The problem the folder is created for each player in the server so if I were to reference the folder in another server script how would I get the particular folder that's named after the local player?
You'd simply use FindFirstChild(). You could also use WaitForChild() but if your folder doesn't exist it'll yield forever.
local ServerStorage = game:GetService("ServerStorage") local function FindFolder(playerName) local folder = ServerStorage:FindFirstChild(playerName) if not folder then print("Folder does not exist") else print("Folder "..playerName.." was found.") end end game.Players.PlayerAdded:Connect(function(Player) FindFolder(Player.Name) end)
game.ServerStorage[INSERT PLAYER NAME inside the brackets]