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

Is my script right?

Asked by 8 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

game.StarterGui.ResetPlayerGuiOnSpawn = false

local MarketplaceService = game:GetService("MarketplaceService")

function getPlayerFromId(id) for i,v in pairs(game.Players:GetChildren()) do if v.userId == id then return v end end return nil end

MarketplaceService.ProcessReceipt = function(receiptInfo) local productId = receiptInfo.ProductId local playerId = receiptInfo.PlayerId local player = getPlayerFromId(playerId) local productName if productId == 185105546 then productName = "$2,000" local cashmoney = game.ServerStorage.MoneyStorage:FindFirstChild(player.Name) if cashmoney then cashmoney.Value = cashmoney.Value + 2000 end elseif productId == 25199926 then productName = "$10,000!" local cashmoney = game.ServerStorage.MoneyStorage:FindFirstChild(player.Name) if cashmoney then cashmoney.Value = cashmoney.Value + 10000 end elseif productId == 22283325 then productName = "10,000" local cashmoney = game.ServerStorage.MoneyStorage:FindFirstChild(player.Name) game.ReplicatedStorage.MasterKey:FireClient(player,"PurchaseConfirm") if cashmoney then cashmoney.Value = cashmoney.Value + 10,000 end elseif productId == 25199829 then productName = "+5 Speed (ONE LIFE ONLY)" local char = player.Character if char then local human = char:FindFirstChild("Humanoid") if human then human.WalkSpeed = human.WalkSpeed + 5 end end elseif productId == 25199898 then productName = "Gravity Coil (ONE LIFE ONLY)" game.Lighting.GravityCoil:Clone().Parent=player.Backpack end game.BadgeService:AwardBadge(playerId,202303025) local message = Instance.new("Hint",workspace) message.Text = player.Name.." purchased "..productName.."!" coroutine.resume(coroutine.create(function() wait(2) message:destroy() end))

1 return Enum.ProductPurchaseDecision.PurchaseGranted
end

0
1) edit your post to use lua code formatting. 2) What is this supposed to do? What does it do instead? What debugging have you tried? BlueTaslem 18071 — 8y
0
Dude, please make it in lua code, because I can't even get my head straight from looking it that way :D RobotChitti 167 — 8y

Answer this question