I want someone in the chat to type "/donate" and then a prompt of the donation purchase shows up. I tried but it horribly failed. can someone fix this for me? I don't have much scripting experience, thanks.
ProductID = 999105219
ProductPrice = 100
CurrencyType = "R$" -- ROBUX > "R$" |
MS = game:GetService("MarketplaceService")
local function onPlayerChatted(player, message)
if message == '/donate' and player.Character and player.Character:FindFirstChild("Head") then
MS:PromptProductPurchase(Player,ProductID)
end
end
local function onPlayerAdded(player)
pl.Chatted:Connect(function (message) onPlayerChatted(player, message) end)
end
game.Players.PlayerAdded:Connect(onPlayerAdded)

1 comment
i tried this but whenever i tested it, it the purchase prompt didn't show up