I have quite an annoying issue, I don’t know if it’s related to the process receipt that this script is inside of, I’ve provided a segment of the script inside of my process receipt below;
if receiptInfo.ProductId == gemsID then
if player:FindFirstChild("Potions") and player.Potions["GemsBoostActive?"].Value == false then -- Check if Potions exists before accessing its child
local potionGUI = ReplicatedStorage:FindFirstChild("GemsPotion"):Clone()
if potionGUI then
potionGUI.Parent = player.PlayerGui:WaitForChild("UserUI"):WaitForChild("PotionFrame")
else
warn("GemsPotion not found in ReplicatedStorage")
end
player.Potions["GemsBoostActive?"].Value = true
end
player.Potions["GemsBoostTime"].Value = player.Potions.GemsBoostTime.Value + 30 * 60
elseif receiptInfo.ProductId == winsID then
if player:FindFirstChild("Potions") and player.Potions["WinsBoostActive?"].Value == false then
local potionGUI = ReplicatedStorage:FindFirstChild("WinsPotion"):Clone()
if potionGUI then
potionGUI.Parent = player.PlayerGui:WaitForChild("UserUI"):WaitForChild("PotionFrame")
else
warn("WinsPotion not found in ReplicatedStorage")
end
player.Potions["WinsBoostActive?"].Value = true
end
player.Potions["WinsBoostTime"].Value = player.Potions.WinsBoostTime.Value + 30 * 60
The issue simply is that whenever the product is purchased, the first time the functionality works fine, it’s expected to add 1800 (30 * 60) to the players WinsBoostTime.Value
. When the product is purchased for a second timer, however, it duplicates itself and then adds 3600, then it keeps doubling itself every purchase. Any insight on this issue would be greatly appreciated, thanks alot.