#How do I modify this script to work for multiple parts?

1 messages · Page 1 of 1 (latest)

quaint abyss
#

I followed a tutorial to make this button, however it is only intended to work for one part (red). How can I make the same button work for both of these parts at the same time?

#

studio noob here> i tried putting them in a group and getting children. it didn't work

rotund sonnet
#

You need to loop through them all when you use GetChildren

#

Look up pair loops in Roblox

#

Or just loops in general should have info on that

quaint abyss
#

Oh okay, thanks.

rotund sonnet
#

Np, Roblox documentation should have it

#

Also use a folder called door with the parts in it instead of nesting parts

#

Right now you have a part in a part, just have a door folder with the doors for that

rustic badgerBOT
#

studio** You are now Level 9! **studio

haughty flame
# quaint abyss

Make sure you use the right variables here.

You have nothing named doorChildren, you put the children of On into a variable called door, then used door in the for loops instead of the variable child

quaint abyss
#

wait

#

im slow

#

its giving me an error in line one though

haughty flame
quaint abyss
#

oh thanks

#

it keeps giving me an error here but I dont know what that means

#

do i need an end or something?

haughty flame
quaint abyss
#

ohh

#

okay im not getting any errors but it doesnt work

haughty flame
quaint abyss
#

Nope

haughty flame
quaint abyss
quaint abyss
#

I thought it was maybe how I referred to the part.transparency but idk

#

Should it be something like On:children()

#

wait no because we made it into a variable already

haughty flame
# quaint abyss

Okay so it was an error, not that it just didn't work.

You should be using child as the variable, not Part, as you made no variable called Part

quaint abyss
haughty flame
quaint abyss
#

lemme try lowercase

haughty flame
quaint abyss
#

mb

#

it works now!!!

#

thank you

quaint abyss
#

Right okay

#

Now I made a countdown timer in screenGUI

#

heres the code

#

How can I make the timer start when the player steps on the button?

#

(in workspace, the activation button that you actually step on is named 'Button'