Run script from ModuleScript if confirmed

I was doing some ModuleScript for my Warning interface.
image

But, so I was a little confused of how I could make a script run if the “Sure” button would be pressed.


The main focus is the YesButton, and I need somehow some script run after this be pressed.
Any help is welcome c:

a ModuleScript is a collection of functions and variables. Your UI should be handled from the LocalScript when Sure is clicked, then you can send a remote event to the server to do things on server-side, or call a function from ModuleScript that way.

The structure of your code should look like this.

-- Local Script
local moduleScript = require(SomeModule)
local yourUI = ...
local SureButton = yourUI.SureButton
local NoButton = yourUI.NoButton

SureButton.MouseButton1Click:Connect(function()
          yourUI.Visible = false
          moduleScript.Confirm() -- Run the function when 'Sure' is clicked.
end)

NoButton.MouseButton1Click:Connect(function()
          yourUI.Visible = false
end)

May you avoid pasting your code as an image, and use a code block instead?