when i press buy its make my Lives Lower but in the script its doing +“Amount”
where is my mistake + its dosent print any errors
local MarketplaceService = game:GetService(“MarketplaceService”)
local function processReceipt(receiptInfo)
local player = game:GetService("Players"):GetPlayerByUserId(receiptInfo.PlayerId)
if not player then
return Enum.ProductPurchaseDecision.NotProcessedYet
end
game.Players:GetPlayerByUserId(receiptInfo.PlayerId).leaderstats.Lives.Value = game.Players:GetPlayerByUserId(receiptInfo.PlayerId).leaderstats.Lives.Value + 15
return Enum.ProductPurchaseDecision.PurchaseGranted
local MarketplaceService = game:GetService(“MarketplaceService”)
local function processReceipt(receiptInfo)
local player = game:GetService("Players"):GetPlayerByUserId(receiptInfo.PlayerId)
if not player then
return Enum.ProductPurchaseDecision.NotProcessedYet
end
game.Players:GetPlayerByUserId(receiptInfo.PlayerId).leaderstats.Lives.Value = game.Players:GetPlayerByUserId(receiptInfo.PlayerId).leaderstats.Lives.Value + 15
return Enum.ProductPurchaseDecision.PurchaseGranted
Could you post your player death script here? That might be the issue. I see no reason for the health to lower other than a script doing that somewhere.
player.CharacterAdded:Connect(function(character)
local humanoid
humanoid = character:FindFirstChild("Humanoid")
if humanoid then
humanoid.Died:Connect(function()
print("Dead")
local event = game.ReplicatedStorage.Events.Died
local Event = game.ReplicatedStorage.Events.KickPlayer
Event:FireClient(player)
event:FireClient(player)
local eventMessage = game.ReplicatedStorage.Events.DiedMessage
eventMessage:FireClient(player)
end)
end