How would I make it so it does this.
game.ServerStorage.AllTheToolsOnly.Parent = game.Lighting
I don't know what to do e.e
local serverstorage = game.ServerStorage local lighting = game.Lighting for i,v in pairs(serverstorage:GetChildren()) do if v:IsA("Tool") then v.Parent = lighting end end
This script gets all the children of ServerStorage and checks if it is a tool. If it is then it will put it in the Lighting.
Use :IsA(...)
to check if something's a subclass of something else.
for i, v in pairs(something:getChildren()) if v:IsA("Tool") then v.parent = game:GetService("Lighting") end end
You would use a for loop
local tools = game:GetService("ServerStorage")["TheTools"] -- Assuming their in a folder for i,v in pairs(tools:GetChildren()) do v.Parent = game:GetService("Lighting") end