Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

✓ Accepted answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.