Hello. I am trying to make a button that when clicked, it prompts a accessory purchase.
This is what I have, but it doesnt work.
local ITEM_ID = 7169551212 -- ID
script.Parent.MouseButton1Click:Connect(function(p)
game:GetService("MarketplaceService"):PromptPurchase(p,ITEM_ID)
end)
local plr = game:GetService("Players").LocalPlayer
local ITEM_ID = 7169551212 -- ID
script.Parent.MouseButton1Down:Connect(function()
game:GetService("MarketplaceService"):PromptPurchase(plr.UserId,ITEM_ID)
end)
you didn’t put the id variable as the second argument…
local player : player = game:GetService("Players").LocalPlayer
local id : number = 7169551212 -- ID
script.Parent.MouseButton1Down:Connect(function()
game:GetService("MarketplaceService"):PromptPurchase(player.UserId, id)
end)
local player = game:GetService("Players").LocalPlayer
local id : number = 7169551212 -- ID
script.Parent.MouseButton1Down:Connect(function()
game:GetService("MarketplaceService"):PromptPurchase(player.UserId, id)
end)
local player = game:GetService("Players").LocalPlayer
local id = 7169551212 -- ID
script.Parent.MouseButton1Down:Connect(function()
game:GetService("MarketplaceService"):PromptPurchase(player, id)
end)
why is it still happening is it something else wrong and not the script or like is there a different script i can use for this to work and just throw this other script away