Hello! I have been working on an Obby Game for the past 3 months (not the best option, I know) cause I’m trying to start with small Projects, and later on move to larger Projects.
GOAL & ISSUE
I’m trying to script it so there is a Skip Stage Developer Product. I’ve finished the whole obby (Building, Scripting and UI), and this is the only thing left, and then I’ll make it public.
Well, pretty much I can’t get the Script to work, even tho I’m pretty sure there are no issues with it. I’ve scripted it to make the Developer Product Purchase pop-up thing, but the Developer Product doesn’t really do anything.
SCRIPTS
(WORKS) This is the script for the Checkpoints in ServerScriptService:
local checkpoints = workspace.Checkpoints
game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local stage = Instance.new("IntValue")
stage.Name = "Stage"
stage.Value = 1
stage.Parent = leaderstats
player.CharacterAdded:Connect(function(char)
local hum = char:WaitForChild("Humanoid")
wait()
char:MoveTo(checkpoints[stage.Value].Position)
hum.Touched:Connect(function(hit)
if hit.Parent == checkpoints then
if tonumber(hit.Name) == stage.Value +1 then
stage.Value = stage.Value +1
end
end
end)
end)
end)
(DOESNT WORK) This is the script for the Developer Product in ServerScriptService:
local marketPlaceService = game:GetService("MarketplaceService")
marketPlaceService.ProcessReceipt = function(receiptInfo)
local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerID)
if receiptInfo.ProductId == 1282206358 then
player.leaderstats.Stage.Value += 1
wait(0.5)
player:LoadCharacter()
return Enum.ProductPurchaseDecision.PurchaseGranted
end
end
EXTRA INFO
There aren’t any errors in the OutPut so idk if it’s a Roblox Error or it just doesn’t work well. Please tell me if you need more information about the Game or about the Scripts. Well, thanks for reading this, and have a good day!!