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

Script can't detect when a developer product has been purchased?

Asked by 6 years ago

Anyone know why this no work? It's a server script in serverscriptservice. FE is on.

local MarketplaceService = game:GetService("MarketplaceService")
local product = 135776612

print("Script on")

MarketplaceService.ProcessReceipt = function(receiptinfo)
    for i, player in ipairs(game.Players:GetChildren()) do
        if player.userId == receiptinfo.PlayerId then
            if receiptinfo.ProductId == product then
                print("Recieved command")
                local songstop = game.Workspace:FindFirstChild("Gucci Music")
                songstop:Pause()
                local clone = game.ServerStorage.fetts:Clone()
                clone.Parent = game.Workspace.TipJar
                game.Workspace.TipJar.Scripts.music.TimePosition = 45
                wait(0.5)
                game.Workspace.TipJar.Scripts.music:Play()
                game.Workspace.TipJar.Scripts.music.Volume = 1
                wait(1)
                game.Workspace.TipJar.Scripts.music.Volume = 2
                wait(1)
                game.Workspace.TipJar.Scripts.music.Volume = 3
                wait(20)
                game.Workspace.TipJar.Scripts.music.Volume = 3
                wait(1)
                game.Workspace.TipJar.Scripts.music.Volume = 2
                wait(1)
                game.Workspace.TipJar.Scripts.music.Volume = 1
                wait(1)
                game.Workspace.TipJar.Scripts.music:Stop()
                wait(5)
                clone:Remove()
                songstop:Resume()
            end
        end
    end
end
0
It don't know, but perhaps do: "MarketplaceService.ProcessReceipt = function(receiptinfo, player)" so the game knows what you mean by player? <-- Probably wrong 0HappyManDudeguy0 15 — 6y
0
No it isn't that, I just tried it and it makes no difference. ;-; Works on studio but not on game. MachoPiggies 526 — 6y

Answer this question