Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

My Skip Stage script for my obby doesn't seem to be working?

So I have a gui in starter gui with a button, saying this local productId = 341212869 -- Change this to Robux developer product ID.

-- When player clicks on buy brick prompt him/her to buy a product function Click() game:GetService("MarketplaceService"):PromptProductPurchase(game.Players.LocalPlayer, productId) end

script.Parent.MouseButton1Down:connect(Click)

And I have a another script in the gui saying this:

local passId = 341212869 local MPS = game:GetService("MarketplaceService")

local function isAuthenticated(userId, gamePassId) -- define outside the PlayerAdded event return MPS:UserOwnsGamePassAsync(userId, gamePassId) end

game:GetService("Players").PlayerAdded:Connect(function(plr) -- :connect is deprecated, use :Connect

plr.CharacterAdded:Connect(function(char) -- wait for the character! 
    if isAuthenticated(plr.UserId, passId) then
        	if receiptInfo.ProductId == RobuxID then
			player.leaderstats.Stage.Value = player.leaderstats.Stage.Value + 1
    end
end)

end)

2 answers

MarketplaceService is deprecated I'm pretty sure. Use GamepassService instead.

1 comment

0

GamepassService is the one depricated now.

This discussion is preserved as it was. New answers, comments, and votes are closed.