The PromptPurchase button is a surface gui.
Print Screens
Script
script.Parent.MouseButton1Click:connect(function(Player)
game:GetService("MarketplaceService"):PromptPurchase(Player, 364870365)
end)
The PromptPurchase button is a surface gui.
Print Screens
Script
script.Parent.MouseButton1Click:connect(function(Player)
game:GetService("MarketplaceService"):PromptPurchase(Player, 364870365)
end)
This isn't working because you can't define player in a MouseButton1Click argument. You would need to do this:
local Player = game.Players.LocalPlayer
This will only work in a local script
so your full script would be:
local Player = game.Players.LocalPlayer
local passId = 364870365
script.Parent.MouseButton1Click:connect(function()
game:GetService("MarketplaceService"):PromptPurchase(Player, passId) -- Just to make it easier
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.