Hello, i am making minigames. I want to make this --> If there is Tools folder in map. The tools will in Player.Backpack i want to this but its not working. Sorry my english and scripting isnt really good.
if workspace:FindFirstChild(map.Name).Tools then local tools = workspace:FindFirstChild(map.Name).Tools:GetChildren() tools:Clone().Parent = Player.Starterpack else print('No gears') end
Clone is only a function of instances. GetChildren returns a normal array. You have to loop through the array to actually use the instances.
btw FindFirstChild is for verification (returns either a child or nil), so don't try to immediately use its result. I'll assume map.Name is valid.
if workspace[map.Name]:FindFirstChild("Tools") then for _,tool in ipairs(workspace[map.Name].Tools:GetChildren()) do tool:Clone().Parent = Player.Starterpack end else print('No gears') end