I’m making an obby on roblox, and for some odd reason my skip stage system isn’t working. When I tested it for the first time, it worked, and when i retested it, and bought the dev product, it didn’t work. I’ve been having this issue for a few hours and i cant seem to find a way to fix it. Just to note, my obby checkpoint system doesn’t save if that has anything to do with it… any help is really appreciated, here are my scripts
LocalScript in textbutton:
script.Parent.MouseButton1Down:Connect(function()
local marketPlaceService = game:GetService(“MarketplaceService”)
marketPlaceService:PromptProductPurchase(game.Players.LocalPlayer, 1763516924)
end)
Script in ServerScriptService:
local marketPlaceService = game:GetService(“MarketplaceService”)
marketPlaceService.ProcessReceipt = function(receiptInfo)
local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)
if receiptInfo.ProductId == 1763516924 then
player.leaderstats.Stage.Value += 1
wait(1)
player:LoadCharacter()
return Enum.ProductPurchaseDecision.PurchaseGranted
end
end
1 Like
Try having a value or attribute inside all the checkpoints and instead of loading their character, simply tp them to the next checkpoint
if receiptInfo.ProductId == 1763516924 then
player.leaderstats.Stage.Value += 1
wait(1)
local newspawn = workspace.Checkpoints:FindFirstChild(player.leaderstats.Stage.Value)
player.Character.HumanoidRootPart.CFrame = newspawn.CFrame + Vector3.new(0,5,0)
return Enum.ProductPurchaseDecision.PurchaseGranted
end
1 Like
Alright thank you
Where am I supposed to insert this script?
Inside the server script in ServerScriptService
Only one ProcessReceipt callback can exist per game. Have you made sure that no other script is also using ProcessReceipt? If you have a donation board model that might be preventing it from working. If it works in playtest mode but not in the main game, this is likely the issue.
i replaced that script with my script in serverscriptservice and it didnt work
Did you even insert a value or attribute in every spawn corresponding with their stage value? Eg Stage 1 should have a value or attribute of 1
dont use wait
, its deprecated, use task.wait()
No i didnt, i dont need to do that theres just an issue with the script because it was working for the first time i tested it but now it isnt