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

What is wrong with this t Shirt Purchase GUI Script ? Works in Studio not Online?

Asked by 6 years ago
Edited 6 years ago

Here is the code i made in about 5 minutes but idk why the script works in studio so i thought it would work and then i play online and it does not work there...

t is the button f is another button h is another Basically want it so when i click one of the buttons it opens up the purchase screen these are donations t = 20 R$ f = 40 R$ h = 100 R$

please help thank you.

local t = script.Parent.twenty
local f = script.Parent.fourty
local h = script.Parent.hundred
local player = game.Players.LocalPlayer

t.MouseButton1Click:connect(function()
    game:GetService("MarketplaceService"):PromptPurchase(player,458603953)
end)

f.MouseButton1Click:connect(function()
    game:GetService("MarketplaceService"):PromptPurchase(player,458604263)
end)

h.MouseButton1Click:connect(function()
    game:GetService("MarketplaceService"):PromptPurchase(player,458604408)
end)

1 answer

Log in to vote
0
Answered by 6 years ago
local t = script.Parent.twenty
local f = script.Parent.fourty
local h = script.Parent.hundred
local player = game.Players.LocalPlayer

t.MouseButton1Click:connect(function()
    game:GetService("MarketplaceService"):PromptPurchase(player,458603953)
end)

f.MouseButton1Click:connect(function()
    game:GetService("MarketplaceService"):PromptPurchase(player,458604263)
end)

h.MouseButton1Click:connect(function()
    game:GetService("MarketplaceService"):PromptPurchase(player,458604408)
end)


"game:GetService('MarketplaceService'):PromptPurchase" CANNOT be used in a LocalScript. Use a Server Script instead. :)

0
I can use server scripts in gui's i thought i couldn't TRILLFLOWS 135 — 6y
0
You can. If this worked for you, please use the "Accept Answer" button. TheEpicCooldeal 12 — 6y
Ad

Answer this question