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

how do I fix a expected ) to close ( error?

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
	

1 answer

✓ Accepted answer

On Line 6 Close The Event you made on line "1" which is The Player Added Event : game.Players.PlayerAdded:connect(function(player)

on Line 6 make sure the "end" looks like this:

end)

Not like this

end

because it is not an if statement or a function .

3 comments

0

Thanks for the acceptance ! :) !

1

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(

0

It has nothing to do with the type of situation.

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