Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why does everyone get this developer product when one person buys it?

Asked by 6 years ago

I read that process receipt can only be called back once. And it seems that this remote event is fired more than once but I'm using it to link to the punch animation. How would I code this so it all fits in place, the player buys the devproduct, when they punch it works and only for them.

local MS = game:GetService("MarketplaceService")
devproductId =  134412521
local events = game.Workspace.Events

events.punchEvent.OnServerEvent:connect(function(plr)
    MS.ProcessReceipt = function(receiptinfo)
    if plr.userId == receiptinfo.PlayerId then
        if receiptinfo.ProductId == devproductId then
    print("Yes")
if plr.Backpack:FindFirstChild("Fight") then
plr.Backpack.Fight.Main.Fighting.Damage.Damageamt.Value = 50
else
workspace[plr.Name].Fight.Main.Fighting.Damage.Damageamt.Value = 100
    end 
wait(15)
    if plr.Backpack:FindFirstChild("Fight") then
plr.Backpack.Fight.Main.Fighting.Damage.Damageamt.Value = 10   
else
    workspace[plr.Name].Fight.Main.Fighting.Damage.Damageamt.Value = 10
                end 
            end
        end
    end
end)

Answer this question