I am very clueless about why this is not prompting me I read the [(https://developer.roblox.com/en-us/api-reference/function/StarterGui/SetCore)] I can't still figure it out any help?
Edit: I always get this error message 12:56:45.791 - Unable to cast Function to int64
local MPS = game:GetService("MarketplaceService")
local InfiniteGamePass = 9894874
local Cash2xGamePass = 9914589
local NotificationBindable = Instance.new("BindableFunction")
while wait(7) do
Purchase = math.random(1,2)
if Purchase == 1 then
local function InfiniteGamePass(Text)
if Text == "Buy" then
print("Clicked")
MPS:PromptGamePassPurchase(game.Players.LocalPlayer, InfiniteGamePass)
elseif Text == "Cancel" then
print("Cancel")
end
end
NotificationBindable.OnInvoke = InfiniteGamePass
game.StarterGui:SetCore("SendNotification", {
Title = "Infinite Gamepass";
Text = "Want Infinite Amounts Of Cash?";
Icon = "";
Duration = 7;
Callback = NotificationBindable;
Button1 = "Buy";
Button2 = "Cancel";
})
elseif Purchase == 2 then
local function Cash2x(Text)
if Text == "Buy" then
MPS:PromptGamePassPurchase(game.Players.LocalPlayer, Cash2xGamePass)
elseif Text == "Cancel" then
print("Cancel")
end
end
NotificationBindable.OnInvoke = Cash2x
game.StarterGui:SetCore("SendNotification", {
Title = "2xCash Gamepass";
Text = "Want To Double Up Your Earnings?";
Icon = "";
Duration = 7;
Callback = NotificationBindable;
Button1 = "Buy";
Button2 = "Cancel";
})
end
end

2 comments
I already solve the problem the same time you posted this thanks anyway for the nice explanation on why it did not work :)
Ah, no worries. @gamingwithjbthepro