I have found this code in the Roblox developer library regarding game passes, however I have a question on functions here. In this line of code: MarketplaceService.PromptGamePassPurchaseFinished:Connect(onPromptGamePassPurchaseFinished) why is it not :Connect(onPromptGamePassPurchaseFinished(Argument, Argument, Argument))?? If the function requires arguments, why do none have to be provided? Or do they and I have misunderstood?
Thanks
local function onPromptGamePassPurchaseFinished(player, purchasedPassID, purchaseSuccess)
if purchaseSuccess == true and purchasedPassID == gamePassID then
print(player.Name .. " purchased the game pass with ID " .. gamePassID)
-- Assign this player the ability or bonus related to the game pass
--
end
end
-- Connect "PromptGamePassPurchaseFinished" events to the "onPromptGamePassPurchaseFinished()" function
MarketplaceService.PromptGamePassPurchaseFinished:Connect(onPromptGamePassPurchaseFinished)```