I am trying to make a script which when you click a button a frame pops up and when you press the X in the top right of the frame 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)




4 comments

0

i don't think you need the active parts, just use visible

0

Alright ill test it now

1

I'm not understanding what you need. Explain in detail what you're attempting to do.

0

Its fixed @Acheo