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

How can I get this Dev Product function work?

Asked by 10 years ago

Here is my script that I put in server script service:

local swords={['20388112']='DualDarkhearts';['20256793']='Darkheart';['20256801']='Firebrand';['20256798']='Ghostwalker';['20256822']='Illumina';['20256818']='Venomshank';}
Game:GetService("MarketplaceService").ProcessReceipt = (function(info)
if info.ProductId==20216731 then
for i,player in next,Game.Players:GetPlayers() do
if player.userId==info.PlayerId then
repeat wait() until player.Character
player.Character.Humanoid.WalkSpeed=player.Character.Humanoid.WalkSpeed-(-10)
return Enum.ProductPurchaseDecision.PurchaseGranted
end
end
elseif info.ProductId== 20218088 then
for i,player in next,Game.Players:GetPlayers() do
if player.userId==info.PlayerId then
repeat wait() until player.Character
player.Character.Humanoid.Health=player.Character.Humanoid.Health-(-50)
player.Character.Humanoid.MaxHealth=player.Character.Humanoid.MaxHealth-(-50)
return Enum.ProductPurchaseDecision.PurchaseGranted
end
end
elseif swords[tostring(info.ProductId)] then
for i,player in next,Game.Players:GetPlayers() do
if player.userId==info.PlayerId then
Game:GetService("ServerStorage"):FindFirstChild(swords[tostring(info.ProductId)]):Clone().Parent=player:WaitForChild("Backpack")
return Enum.ProductPurchaseDecision.PurchaseGranted
end
end
elseif info.ProductId==20297497 then
for i,player in next,Game.Players:GetPlayers() do
if player.userId==info.PlayerId then
repeat wait() until player.Character
player.Character:MoveTo(Vector3.new(7.9, 2.2, 35.1))
return Enum.ProductPurchaseDecision.PurchaseGranted
end
end
elseif info.ProductId==20633370 then
for i,v in next,Game.Players:GetPlayers() do
if v.userId==info.PlayerId then
local gui=Workspace.GameModeScript.ChooseGui:Clone()
gui.ScrollingFrame.LocalScript.Disabled=false
gui.Parent=v.PlayerGui
return Enum.ProductPurchaseDecision.PurchaseGranted
end
end
end
end
end)

This is meant for a perk shop of mine. The way it works is that when someone buys a Dev Product for robux the get 15 speed or health for that live, this is meant to add more player points and well also more money. It will not work even when I change the Dev Code, If you can help I would appreciate it and have a good day!

Answer this question