I put this in my textbutton and it didnt work idk why
repeat wait() until game.Players.LocalPlayer local mouse = game.Players.LocalPlayer:GetMouse() local FirstFrame = script.Parent.Parent --Or wherever your first frame is, the text button is likely inside of it, so this is what you'd usally put local PopUpFrame = script.Parent.Parent.Parent.PopUp --Once again, change this to wherever your frame is located. local Button = script.Parent --The script will most likely be in the button function onClick() if PopUpFrame.Visible == true then PopUpFrame.Visible = false elseif PopUpFrame.Visible == false then PopUpFrame.Visible = true end end Button.MouseButton1Click:connect(onClick)
wait(5) local player = game.Players.LocalPlayer local mouse = Player:GetMouse() local FirstFrame = script.Parent.Parent --Or wherever your first frame is, the text button is likely inside of it, so this is what you'd usally put local PopUpFrame = script.Parent.Parent.Parent.PopUp --Once again, change this to wherever your frame is located. local Button = script.Parent --The script will most likely be in the button function onClick() if PopUpFrame.Visible == true then PopUpFrame.Visible = false elseif PopUpFrame.Visible == false then PopUpFrame.Visible = true end Button.MouseButton1Click:connect(onClick)
repeat wait() until game.Players.LocalPlayer (Unnecessary) Just use waitfordataready() k.