of     1   

SectionOne
#182839913Monday, February 01, 2016 7:11 PM GMT

..And changes property of them? It needs to change both property of parts which have a mesh and don't have it or are a unionoperation. This is my piece of code but for some reason it doesn't do for all of them and misses them out, making them look as previous... local skin = script.Parent:GetChildren() for i=1, # skin do if skin[i]:IsA("Part") or skin[i]:IsA("UnionOperation") then --[Rest of code] OH GOD WHAT IS THAT SIGGY
LegendaryAccount
#182840039Monday, February 01, 2016 7:16 PM GMT

a recursive function function DoStuffToModel(model,callback) for i,v in pairs(model:GetChildren()) do callback(v) DoStuffToModel(v,callback) end end DoStuffToModel(workspace.Model,function(obj) if obj:IsA("Part") or obj:IsA("UnionOperation") then --[Rest of code] end end)
SectionOne
#182840099Monday, February 01, 2016 7:19 PM GMT

What's the callback for? OH GOD WHAT IS THAT SIGGY
LegendaryAccount
#182840270Monday, February 01, 2016 7:24 PM GMT

callback is used in lua alot. for example when making a event as in game.Players.PlayerAdded:connect(function(player) end) -- thats a callback function being called from the connect method and it passed a player object though the parameter. I used it for each time it finds a part in the model it will call that function and do what ever is in that function to do to the part. obj will referer to each part in the model
SectionOne
#182840385Monday, February 01, 2016 7:28 PM GMT

Thanks, I'll see if it works and get back to you with it :) OH GOD WHAT IS THAT SIGGY
SectionOne
#182847659Monday, February 01, 2016 9:59 PM GMT

The stack is overflowing every time it executes and nothing happens... OH GOD WHAT IS THAT SIGGY
SectionOne
#182847896Monday, February 01, 2016 10:03 PM GMT

HELP HOW DO I AVOID STACK OVERFLOWS! OH GOD WHAT IS THAT SIGGY
128Gigabytes
#182849471Monday, February 01, 2016 10:31 PM GMT

@LegendaryAccount It would be better to do it without recurse local function functionModel(instance, run) local children, x = instance:getChildren(), 1 while (children[x]) do run(children[x]) for _, child in next, (children[x]:getChildren()) do table.insert(children, child) end x = (x + 1) end return (children); end functionModel(workspace.model, function(instance) if (instance:isA("BasePart")) then print(instance.Name) end end)

    of     1