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 there two error in my shop gui(error in question)?

I still dont know why it cuts off the local player and the comma welp

script.Parent.MouseButton1Click:Connect(gravcoil)

function gravcoil()
	game:GetService("MarketplaceService"):PromptGamePassPurchase(game.Players.LocalPlayer, 3196348)
end


error:13:58:57.084 - Attempt to connect failed: Passed value is not a function another error: 13:59:00.608 - attempt to call a nil value

1 comment

0

Is it a server script?

1 answer

✓ Accepted answer

The function must be defined before called otherwise the script will not know what the function is.

function gravcoil()
    game:GetService("MarketplaceService"):PromptGamePassPurchase(game.Players.LocalPlayer, 3196348)
end

script.Parent.MouseButton1Click:Connect(gravcoil)

I hope this helps :)

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