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

Is There A Way To Create A Variable By Going Downwards or Is Similar?

Asked by 5 years ago
Edited 5 years ago

I'm trying to script that it will parent to another frame but it "parents" frontwards and I want to like parent backwards to the frame I'm trying to write in a script? Is there a way to do this or is similar? I know its the same code but I'm trying to like try to parent like down instead of upwards. I'm confused on trying to make a variable for when pressed button in a different local script.

01local Button = script.Parent
02Frame = script.Parent.Parent.Parent.CharacterFrame
03 
04function onClick()
05    if Frame.Visible == false then
06    Frame.Visible = true
07    elseif Frame.Visible == true then
08        Frame.Visible = false
09    end
10end
11 
12Button.MouseButton1Click:Connect(onClick)

1 answer

Log in to vote
2
Answered by 5 years ago

ZIndex is a number that indicates the view priority of a GUI object.. the higher it is, the higher the priority... also make sure ScreenGUI.ZIndexBehavior is set to sibling, if is sibling priorioty, otherwise set it to Global

Ad

Answer this question