Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
Nozazxe 107
3 years ago
Edited 3 years ago

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.

0
Also I have third party purchases or whatever on. Nozazxe 107 — 3y

1 answer

Log in to vote
1
Answered by 3 years ago

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)

0
Ah, Thank you so very much! Nozazxe 107 — 3y
0
np! Ferrarimami 120 — 3y
Ad

Answer this question