Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How do I get Children from a different Parent?

Asked by 3 years ago

I'm making a volume slider Gui and it looks like this:

**StaterGui: **

        * ScreenGui 1:*

                    Sound ( I need this for the script) 

                    Script 1 (another script using that “Sound” also) 

         * ScreenGui 2: *

                     Frame: 

                               Script  2(The one that I’m using) 

So, how do I get that Sound to work for my second script but won't affect the first one?

1 answer

Log in to vote
0
Answered by 3 years ago

For Script2

local Sound = script.Parent.Parent.ScreenGui1.Sound
--[[             ^      ^        ^          ^ 
            Script2 ScreenGui1, PlayerGui, ScreenGui1, the sound
]]
1
Oh my, thank you for your help <3. I also had to add another Parent because the script is in a frame. Ken_desu 11 — 3y
Ad

Answer this question