#How to refer to parts within a model

1 messages · Page 1 of 1 (latest)

abstract ember
#

I am making a basic obby so I can learn coding as I'm pretty new to it. I'm trying to make a part where parts alternate between being collidable and not. How do I refer parts inside of the model?

#

obviously this is wrong because it doesn't work lol

sweet kraken
#

Or something similar if that doesn't work

#

That will provide you a table of instances that are in the model

#

You can loop through each instance with that table

abstract ember
#

how would a format that?

#

game.workspace.alternate1.getchildren()?

sweet kraken
#

ModelName:GetChildren()

abstract ember
#

like this?

sweet kraken
#

Is alternate2 a model?

sweet kraken
abstract ember
#

yes it is

sweet kraken
#

But I would suggest making a variable for the model and a variable for the children you are obtaining

#

That way you have a table you can loop through

tender scroll
#

hello!, Is there anyone need help?

abstract ember
#

ya

abstract ember
#

im workin on something else rn

tender scroll
graceful compass
tender scroll
tender scroll
# abstract ember like this?

replace it with this code :

local alternate2 = workspace:WaitForChild("Alternate2")
local switch = alternate2:GetChildren()**

abstract ember
#

and what does wait for child mean?

#

ik its kinda self explanitory but why do i need to wait for the child?

#

of that

sweet kraken