#Getting all objects

1 messages · Page 1 of 1 (latest)

thin lily
#

Is it possible to get a part inside all models? For example, my base is this:

votingobjs
|__ map 1 | submitvote (part)

|__ map 2 | submitvote (part)

|__ map 3 | submitvote (part)

Im trying to get all the submitvote parts and make it print “true”. If done it will be greatly appreciated, thanks.

lyric yew
#

like

#

find a part that could be anywhere in the workspace?

#

is that what you mean?

small herald
#

Do you just need references to all of the parts? What condition do you want the script to print "true" under?

thin lily
proud badger
#

Use findfirstchild

#

Actually use a for loop with votingobjs as parent

#

Then do if child is a model

#

And proceed

thin lily
#

just modify the code?

#

cus im new to like for i _ v

#

for i

#

for _

#

for v

#

still confuses me somehow

proud badger
#

Sorry didn't look at the code

#

Wait I'll check kt

#

So it doesn't print true right?

#

I is the amount of children inside the specified instance

thin lily
#

it does, when i moved map1 2 3 out of votingobjs it doesnt print false

proud badger
#

So if you had 3 models, I would be 3

proud badger
#

V is the name per child you can give

#

_ is the exact same loop just without I

thin lily
proud badger
#

Is the part important? Like visually

#

Otherwise you could replace it with a value

thin lily
#

na

#

im trying to make a voting system

proud badger
#

Try printing submitvote for me, if that errors then do print(submitvote.Nams)

thin lily
#

and im trying to make it easier by just getting all the "submitvote" parts and if theyre stepped on, they increase how much times each and every one of them r stepped on

#

like increase the value

proud badger
#

Alright yeah nice idea

#

Print submitvote

#

Maybe send screenshot of output too

thin lily
#

nvm it works

#

ik i posted code only but

proud badger
#

I thought so

#

That's alright

thin lily
#

i loaded in, it printed the name

proud badger
#

Well good luck with your game

thin lily
#

then i changed the submitvote names

#

to .

#

and it printed false

thin lily
#

im looking forward to this

#

good luck with yourself in life

proud badger
#

Thank you

thin lily
#

welcome bro

lethal vapor
#

Can’t you just find first child with true as the second parameter

proud badger