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)
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. :)