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

Trying to make a script that prompts a player to make a purchase?

Asked by
epoke466 100
3 years ago
Edited 3 years ago

I am making a Gui for donations. The goal is that the player can enter a number into a text box and press a text button. For this example, the text that needs to be entered is 1. The text box is called Ammount and the text button is called Donate. But its not working, can you help me fix it. Here is the script:

if (script.Parent.Parent.Ammount.Text == "1")
then
    local bloxyColaId = 1145492849
    local player = game.Players.LocalPlayer

    function onClick() 
        game:GetService("MarketplaceService"):PromptPurchase(player, bloxyColaId) 
    end

    script.Parent.MouseButton1Click:connect(onClick)

end
0
Is that a gamepass? WesleyAng_3 153 — 3y
0
dev product epoke466 100 — 3y

Answer this question