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

(ANSWERED) Why do I get this error (Unable to cast Instance to int64) In my output?

The error is: Unable to cast Instance to int64 Script:

local ms = game:GetService(“MarketplaceService”)
local id = 13589927

script.Parent.MouseButton1Click:Connect(function()
ms:PromptGamePassPurchase(id, game.Players.LocalPlayer)
end)

I’m using a GUI Textbutton to prompt a game pass purchase.

1 comment

0

Also I have third party purchases or whatever on.

1 answer

✓ Accepted answer

You need to do it the other way. The first Value is the Player, the second the ID. So just do:

local ms = game:GetService(“MarketplaceService”)
local id = 13589927

script.Parent.MouseButton1Click:Connect(function()
ms:PromptGamePassPurchase(game.Players.LocalPlayer, id)
end)

2 comments

0

Ah, Thank you so very much!

0

np!

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