#Skip Stage Not Working

1 messages · Page 1 of 1 (latest)

primal geyser
#

i am able to buy the skip stage and the gui is working but the stage doesnt get skipped

#
local ServerStorage = game:GetService("ServerStorage")
local Players = game:GetService("Players")
local BuySkipStageEvent = game:GetService("ReplicatedStorage"):WaitForChild("BuySkipStage")

local PlayerDataFolder = ServerStorage:WaitForChild("PlayerData")
local Spawns = game.Workspace.Spawns

local function processReceipt(receiptInfo)
    
    local player = Players:GetPlayerByUserId(receiptInfo.PlayerId)
    if not player then 
        return Enum.ProductPurchaseDecision.NotProcessed 
    end    
    
    if receiptInfo.ProductId == 3321716892 then
        if player then
            local playerFolder = PlayerDataFolder:FindFirstChild(player.UserId)
            local currentStage = playerFolder:WaitForChild("Stage")
            currentStage.Value += 1

            player.Character:WaitForChild("HumanoidRootPart").CFrame = Spawns[currentStage.Value].CFrame + Vector3.new(0,3,0)
            player.RespawnLocation = Spawns[currentStage.Value]
        end
    end

    return Enum.ProductPurchaseDecision.PurchaseGranted
    
end    

local function buyDevProduct(player, productName)
    
    local productId
    
    if productName == "Skip Stage" then
        
        productId = 3321716892
        MarketplaceService:PromptProductPurchase(player, productId)
        
    end

end

BuySkipStageEvent.OnServerEvent:Connect(buyDevProduct)
MarketplaceService.ProcessReceipt = processReceipt```
#

Local script in the gui

woven sapphire
#

so the playerdatafolder:fubdfirst ch ild(player.userid)

#

wont work

next stone
primal geyser
frigid crowBOT
#

studio** You are now Level 2! **studio

next stone
#

Just wanted to clear up that that wasn’t the solution

primal geyser
woven sapphire
#

idk then