I have a button that you can buy a dev product and if you buy it, it will fire the client but if you buy two it fires it twice then when I click the use button it does eveyrthing inside it twice :
script:
local Id = 1268339333
local mps = game:GetService("MarketplaceService")
local player = game.Players.LocalPlayer
local breaking = false
script.Parent.MouseButton1Click:Connect(function()
mps:PromptProductPurchase(game.Players.LocalPlayer, Id)
end)
game.ReplicatedStorage.BoostPurchased.OnClientEvent:Connect(function(boostName)
print("hello") -- prints this twice
if boostName == "TimesTwoOrbs" then
game.ReplicatedStorage.OrbsMultiplier.Value = 2
local Minutes = game.ReplicatedStorage.TwoTimesOrbsMinutes
local Seconds = game.ReplicatedStorage.TwoTimesOrbsSeconds
script.Parent.Parent.Use.AmountAbleToUse.Value += 1
script.Parent.Parent.Use.MouseButton1Click:Connect(function()
print("hi") -- prints this twice
if script.Parent.Parent.Use.AmountAbleToUse.Value > 0 then
script.Parent.Parent.Use.AmountAbleToUse.Value -= 1
if Seconds.Value == 0 then
Seconds.Value = 60
Minutes.Value += 1
elseif Seconds.Value <= 60 and Seconds.Value > 0 then
Minutes.Value += 2
end
if breaking == false then
breaking = true
while wait() do
breaking = true
repeat
Seconds.Value -= 1
wait(1)
until Seconds.Value == 0
if Seconds.Value == 0 then
Minutes.Value -= 1
wait(1)
Seconds.Value = 60
end
if Minutes.Value and Seconds.Value == 0 then
break
end
end
game.ReplicatedStorage.OrbsMultiplier.Value = 1
breaking = false
end
end
end)
end
end)