The script is supposed to kill you when you purchase it. The leaderstats part works and so does the prompt to purchase. But it doesn't kill you.
Script:
local MarketplaceService = game:GetService("MarketplaceService") local RemoteEvent = game.ReplicatedStorage.PromptSkipStagePurchase local productId = 1164319291 -- Prompt purchase RemoteEvent.OnServerEvent:Connect(function(player) MarketplaceService:PromptProductPurchase(player, productId) end) -- Skip function MarketplaceService.ProcessReceipt = function(receiptInfo) if receiptInfo.ProductId == productId then local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId) player.leaderstats.Stage.Value = player.leaderstats.Stage.Value + 1 -- Make the stage leaderstat go up by 1 player.Character.Humanoid.MaxHealth = 0 -- Kills player so they respawn at next check point end end
You accidentally changed the MaxHealth, not the players actual Health
local MarketplaceService = game:GetService("MarketplaceService") local RemoteEvent = game.ReplicatedStorage.PromptSkipStagePurchase local productId = 1164319291 -- Prompt purchase RemoteEvent.OnServerEvent:Connect(function(player) MarketplaceService:PromptProductPurchase(player, productId) end) -- Skip function MarketplaceService.ProcessReceipt = function(receiptInfo) if receiptInfo.ProductId == productId then local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId) player.leaderstats.Stage.Value = player.leaderstats.Stage.Value + 1 -- Make the stage leaderstat go up by 1 player.Character.Humanoid.Health = 0 -- Kills player so they respawn at next check point end end