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

does promptgamepasspurchasefinished have 3 parameters? getting expected ) to close error

sorry for non descriptive title, don't really know what else to put.

this is the error: Expected ')' (to close '(' at column 69), got '.'

game.Players.PlayerAdded:connect(function(player)
	for i,v in pairs (script.Parent.Buttons:GetChildren()) do
		MarketplaceService.PromptGamePassPurchaseFinished:connect(function(player, v.Gamepass.Value, purchaseSuccess))
			
		end)
		
	end
end)

2 answers

✓ Accepted answer

Edited code:

(change id to the id)

local id = ID
game.Players.PlayerAdded:connect(
    function(player)
        for i, v in pairs(script.Parent.Buttons:GetChildren()) do
            MarketplaceService.PromptGamePassPurchaseFinished:Connect(
                function(player, id, purchaseSuccess)
                end
            )
        end
    end
)

Your code:

game.Players.PlayerAdded:connect(function(player)
    for i,v in pairs (script.Parent.Buttons:GetChildren()) do
        MarketplaceService.PromptGamePassPurchaseFinished:connect(function(player, v.Gamepass.Value, purchaseSuccess))

        end)

    end
end)

Why it doesn't work:

A parameter cannot have a dot, and you added an extra ) on line 3.


Accept answer if it worked.

First parameter is the player, second is the gamepass id, third is if the player bought the item (bool value)

For the error, parameters can't have dots in them. (this would work "player", this wouldn't "player.Name")

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