I was trying to make a script that would allow people to donate to me. I have a script that won’t work, but everything seems valid and no errors showed up in the output. Here is the script:
local player = game.Players.LocalPlayer
local id = "1007790822"
script.Parent.MouseClick:Connect(function()
game.MarketplaceService:PromptProductPurchase(player, id)
end)
script.Parent.Parent.Touched:Connect(function()
game.MarketplaceService:PromptProductPurchase(player, id)
end)
Properties of Script
Script type: LocalScript
Parent: ClickDetector
Parent of ClickDetector: Part
Disabled: False
So then, someone might be thinking, “Maybe your id is wrong…”. The id is not wrong. Proof:
Please help me try to figure out what is going wrong!
Didn’t work,
I put the following script inside of a localscript inside of starterplayerscripts:
local player = game.Players.LocalPlayer
local id = "1007790822"
game.Workspace.DonoPrompt.ClickDetector.MouseClick:Connect(function()
game.MarketplaceService:PromptProductPurchase(player, id)
end)
game.Workspace.DonoPrompt.Touched:Connect(function()
game.MarketplaceService:PromptProductPurchase(player, id)
end)
local player = game.Players.LocalPlayer
local id = "1007790822"
local DonoPrompt = workspace:WaitForChild("DonoPrompt", 10)
DonoPrompt.ClickDetector.MouseClick:Connect(function()
game.MarketplaceService:PromptProductPurchase(player, id)
end)
DonoPrompt.Touched:Connect(function()
game.MarketplaceService:PromptProductPurchase(player, id)
end)