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 4 years ago
Edited 4 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.

local Button = script.Parent
Frame = script.Parent.Parent.Parent.CharacterFrame

function onClick()
    if Frame.Visible == false then
    Frame.Visible = true
    elseif Frame.Visible == true then
        Frame.Visible = false
    end
end

Button.MouseButton1Click:Connect(onClick)

1 answer

Log in to vote
2
Answered by 4 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