I am trying to make a script which when you click a button this GUI pops up and when you press the X in the top right of the GUI it closes but I'm confused where i went wrong.
-- iiTiago 2K16
local Mainf = script.Parent
local active = Mainf.Teams.active.Value
function open()
if active == false and Mainf.Visible == false then
print("1")
Mainf.Visible = true
active = true
elseif active ~= false and Mainf ~= false then
print("Team Frame is already activated")
end
end
Mainf.IconCloseButton.MouseButton1Down:connect(function()
active = false
Mainf.Visible = false
Mainf:TweenPosition(UDim2.new(0.5,-150,-1,-100),'Out','Quad',0.35)
end)
Mainf.Parent.TeamsB.MouseButton1Click:connect(open)

1 comment
It doesn't show or clone it