How to make close gui button

Hello guys, i need help with script. how to make “Close X Button” .
unknown

local UI = script.Parent 
local X = UI.X 

X.Activated:Connect(function()
	UI.Enabled = false 
end)
1 Like

Hello, can you explain what it’s mean “local X = UI.X”
in which script to do it? normal or local?

In the local script.

the UI.X is just the UI.CloseButton

1 Like