im getting this error Expected ')' (to close '(' at line 167), got 'end'
game.Players.PlayerAdded:connect(function(player)
for i,v in pairs (script.Parent.Buttons:GetChildren()) do
local id= v.Gamepass.Value
MarketplaceService.PromptGamePassPurchaseFinished:connect(function(player, id, purchaseSuccess)
end
end

3 comments
Thanks for the acceptance ! :) !
The :Connect() method requires a callback function—which is normally provided as a throwaway; due to the common formatting, it may appear as "end)" and be mistaken for a seperate keyword. This syntax error is actually raised due to the closing piece of the argumental parentheses not being supplied -> I.e :Connect(
It has nothing to do with the type of situation.