How could I get all the children from inside a model together so I don't have to make a variable for each body part?
local Fire = game.ServerStorage.Parts:GetChildren() -- NEED TO GET CHILDREN FROM INSIDE THIS MODEL local firecopy = Fire:Clone() game.Players.PlayerAdded:connect(function(player) player.CanLoadCharacterAppearance = false wait() firecopy.Parent = player.Character end)
The error is occurring on the first line because I can't select all the children to clone. Part is a model in server storage with package parts. Thanks.
Nice try! When you use GetChildren, it practically returns a table, filled with all of the 'children' as its values. Ex:
local a = model:GetChildren() -- Above would look like: {Apple, Button}
To 'break' the table, you'll need to use a generic or numeric for loop, but in this case, is a generic for loop. I'll show you:
local Fire = game.ServerStorage.Parts game.Players.PlayerAdded:connect(function(player) player.CanLoadCharacterAppearance = false wait() for i,v in pairs(Fire:GetChildren()) do -- iterates through all of its children v:clone().Parent = player.Character -- clones it and puts it in the player's character end end)
local Fire = game.ServerStorage.Parts:GetChildren() -- NEED TO GET CHILDREN FROM INSIDE THIS MODEL for i = 1, #Fire do local firecopy = Fire[i]:Clone() game.Players.PlayerAdded:connect(function(player) player.CanLoadCharacterAppearance = false wait() firecopy.Parent = player.Character end end) --That's what my guess would be?