Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

how would i call a function when a gui is pressed?

I'm working on a shop GUI and I dont know how to call a function when a GUI has been pressed how would I do so? (IDK why the script is cut off)

function gravcoilpass()
game:GetService("MarketplaceService"):PromptGamePassPurchase(game.Players.LocalPlayer, 10022825)
end
--somehow calls the function when GUI is clicked--

3 answers

script.Parent.MouseButton1Click:Connect(function(gravcoilpass)

This discussion is preserved as it was. New answers, comments, and votes are closed.