I am developing a new Roblox game where you can setup and control you're own virtual machine using SurfaceGUIs on a modeled screen. I am trying to make a confirmation GUI where if you click YES, then it starts the VM, and if you click NO, then it closes the GUI and doesn't start a VM. But when I click on NO, nothing happens! Here is my code:
local gui = script.Parent.Parent
local button = script.Parent
local function cancel()
gui.Visible = false
end
button.Activated:Connect(cancel())
Please help!
P.S: The confirmation frame is in the ScreenGUI, the button is in the frame, and the LocalScript is in the button.
Connect()
call. \$\endgroup\$