local Gamepasses = {

}

local Items = {

[531481057] = {

1000

},

[531480410] = {

game.ServerStorage.Minigun

},

[531479464] = {

"W:10"

},

[531478618] = {

"H:25"

}

}

local MarketplaceService = game:GetService("MarketplaceService")

function GetName(ID)

if type(ID) ~= "number" then

return

end

local sets = game:service("InsertService"):GetUserSets(ID)

for k, v in next, sets do

if v.Name == "My Models" then

return v.CreatorName

end

end

end

local function Sep(table,plr)

for i,v in pairs(table) do

if type(v)=="userdata" then

v:Clone().Parent = plr.Backpack

elseif type(v)=="number" then

game.ServerStorage.PlayerMoney:FindFirstChild(plr.Name).Value = game.ServerStorage.PlayerMoney:FindFirstChild(plr.Name).Value + tonumber(v)

else

if v:sub(0,2) == "W:" then

plr.Character.Humanoid.WalkSpeed = plr.Character.Humanoid.WalkSpeed + tonumber(v:sub(3))

else

plr.Character.Humanoid.MaxHealth = plr.Character.Humanoid.MaxHealth + tonumber(v:sub(3))

plr.Character.Humanoid.Health = plr.Character.Humanoid.Health

end

end

end

end

local function SepQ(table,plr)

for i,v in pairs(table) do

if type(v)=="userdata" then

v:Clone().Parent = plr.Backpack

elseif type(v)=="number" then

return

else

if v:sub(0,2) == "W:" then

plr.Character.Humanoid.WalkSpeed = plr.Character.Humanoid.WalkSpeed + tonumber(v:sub(3))

else

plr.Character.Humanoid.MaxHealth = plr.Character.Humanoid.MaxHealth + tonumber(v:sub(3))

plr.Character.Humanoid.Health = plr.Character.Humanoid.Health

end

end

end

end

MarketplaceService.ProcessReceipt = function(receiptInfo)

print(receiptInfo.ProductId)

if Items[receiptInfo.ProductId] then

if type(GetName(receiptInfo.PlayerId)) == "string" then

wait()

local p5 = game.Players:FindFirstChild(GetName(receiptInfo.PlayerId))

wait()

Sep(Items[receiptInfo.ProductId],p5)

end

end

return Enum.ProductPurchaseDecision.PurchaseGranted

end

game.Players.PlayerAdded:connect(function(p)

if p~=nil then

for i,v in pairs(Gamepasses) do

if MarketplaceService:PlayerOwnsAsset(p,i) then

Sep(v,p)

end

end

wait(0.5)

p.CharacterAdded:connect(function(c)

for i,v in pairs(Gamepasses) do

if MarketplaceService:PlayerOwnsAsset(p,i) then

SepQ(v,p)

end

end

end)

end

end)