Can anyone tell me whats wrong with this script?

When programming, every bracket (([{) needs a corresponding }]) or else it’ll complain. It’s why in the example

RBXScriptSignal:Connect(function() end)

You use end) rather than end; you’re just closing the ( you started a few characters back.

In your script, you started a table under module.Products, but never closed the { after you were done. Hence why Studio indented your code awkwardly. A good table should look like:

{ -- open
    { -- open
        -- ...
    } -- close
} -- close

Quick and dirty solution? Add } before module.AbortCustomPurchases = true