#Doesn't skip the stage when bought the Gamepass
12 messages · Page 1 of 1 (latest)
`local marketPlaceService = game:GetService("MarketplaceService")
marketPlaceService.ProcessReceipt = function(receiptInfo)
local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)
if receiptInfo.ProductId == game.ReplicatedStorage.IDs.Products:WaitForChild("SkipStage").Value then
player.leaderstats.Stage.Value += 1
wait(1)
player:LoadCharacter()
return Enum.ProductPurchaseDecision.PurchaseGranted
end
end
`
MarketPlaceService.PromptProductPurchaseFinished:Connect(function(PlayerId, GamepassId, IsPurchased)
if IsPurchased ~= Enum.ProductPurchaseDecision.PurchaseGranted then return end
-- your code here
end)
use this function, it's easier to understand
What do I replace it for?
`local Id = game.ReplicatedStorage.IDs.Products:WaitForChild("SkipStage").Value
local mps = game:GetService("MarketplaceService")
local plr = game.Players.LocalPlayer
local Event = game.ReplicatedStorage.Events
local SkipEvent = Event.SkipEvent
local SuccessEvent = Event.SuccessEvent
local Info = mps:GetProductInfo(Id, Enum.InfoType.Product)
local Stage = plr.leaderstats.Stage
local MaxLevel = 50
script.Parent.MouseButton1Click:Connect(function()
if Stage.Value >= MaxLevel then
else
mps:PromptProductPurchase(plr, Id)
end
end)
mps.PromptProductPurchaseFinished:Connect(function(player, gpsid, purchased)
if gpsid == Id and purchased then
SkipEvent:FireServer(plr)
SuccessEvent:FireServer(Info.Name)
end
end)
mps.PromptProductPurchaseFinished:Connect(function(player, gpsid, purchased)
if gpsid == Id then
if not purchased then
end
end
end)`
I had a guy do it for me but he broke it
** You are now Level 1! **
Tell him to watch more tutorials
LMAOOOO
U are NOT handling transactions on fucking client
took the words right out my mouth 