So. I have a localscript inside a tool that hides the player when he clicks and and unhides him when he unequips it. To hide the hats, I move them all into Lighting however I don't know any quick method to get them back.
local tool = script.Parent local othertool = game.Lighting local function onActivate() local char = game.Players.LocalPlayer.Character for _, obj in pairs(char:GetChildren()) do if obj:IsA("Accoutrement") then obj.Parent = othertool char.Head.face.Parent = tool tool.Handle.Transparency = 1 char.Head.Transparency = 1 char['Right Arm'].Transparency = 1 char['Left Arm'].Transparency = 1 char.Torso.Transparency = 1 char['Right Leg'].Transparency = 1 char['Left Leg'].Transparency = 1 end end end tool.Activated:Connect(onActivate) local function onUnequip() local char = game.Players.LocalPlayer.Character tool.face.Parent = char.Head tool.Handle.Transparency = 0 char.Head.Transparency = 0 char['Right Arm'].Transparency = 0 char['Left Arm'].Transparency = 0 char.Torso.Transparency = 0 char['Right Leg'].Transparency = 0 char['Left Leg'].Transparency = 0 end tool.Unequipped:Connect(onUnequip)
To get all of the children of something, you can just use :GetChildren(). Example:
game.Lighting:GetChildren()