#Skip Stage Not Working
1 messages · Page 1 of 1 (latest)
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
doesnt anything inside findfirstchild have to be a string
so the playerdatafolder:fubdfirst ch ild(player.userid)
wont work
Numbers will be casted to strings automatically
so the script has no problems?
** You are now Level 2! **
Can’t be asked reading it on mobile
Just wanted to clear up that that wasn’t the solution
oh alr thanks