So for my game I have a nuke developer product that allows you to purchase a developer product for a nuke to spawn in the map and kill all the players.
But when I click the button it doesn't let me purchase it so it happens..
local mps = game:GetService("MarketplaceService") local gamepass_id = 1087678048 script.Parent.MouseButton1Click:Connect(function() local player = game.Players.LocalPlayer mps:PromptGamePassPurchase(player, gamepass_id) end) mps.PromptGamePassPurchaseFinished:connect(function(player, id, purchased) if id == gamepass_id and purchased then game.StarterGui.ScreenGui.TextButton.Visible = false game.Workspace.countdown.Disabled = false game.workspace.nuketime.Playing = true game.workspace.nuketime.Looped = true wait(16) local nukerO = game.ReplicatedStorage.Nuke:Clone() nukerO.Parent=game.Workspace game.Workspace.nuketime.Playing = false game.Workspace.nuketime.Looped = false wait(30) game.Workspace.countdown.Disabled = true game.StarterGui.ScreenGui.TextButton.Visible = true end end)
could I have some help?
It is actually so simple all I did was overthink.
on line 6 all I had to do was replace PromptGamepassPurchase with PromptProductPurchase, and I was all set!
local mps = game:GetService("MarketplaceService") local gamepass_id = 1087678048 script.Parent.MouseButton1Click:Connect(function() local player = game.Players.LocalPlayer mps:PromptProductPurchase(player, gamepass_id) end) mps.PromptGamePassPurchaseFinished:connect(function(player, id, purchased) if id == gamepass_id and purchased then game.StarterGui.ScreenGui.TextButton.Visible = false game.Workspace.countdown.Disabled = false game.workspace.nuketime.Playing = true game.workspace.nuketime.Looped = true wait(16) local nukerO = game.ReplicatedStorage.Nuke:Clone() nukerO.Parent=game.Workspace game.Workspace.nuketime.Playing = false game.Workspace.nuketime.Looped = false wait(30) game.Workspace.countdown.Disabled = true game.StarterGui.ScreenGui.TextButton.Visible = true end end)