So, in this developer product purchasing server-sided handler, there is a warning on line 17 W006 warning in my script, how to get it away?
This is what the warning says:
"W006: Statement spans multiple lines; use indentation to silence"
Here is my coding:
(Also, is there something else that I did wrong with this script? , the MarketplaceService-part should fire when the player buys a dev product via my GUI)
local ds = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory")
local MarketplaceService = game:GetService("MarketplaceService")
local productId1 = 43143055 --//200 snowflakes
local productId2 = 43143018 --//500 snowflakes
local productId3 = 43143112 --//1000 snowflakes
local productId4 = 43143148 --//5000 snowflakes
--MarketplaceService.ProcessReceipt will fire when someone completes a purchase, This is how it runs!
MarketplaceService.ProcessReceipt = function(receiptInfo)
-- find the player based on the PlayerId in receiptInfo
for i, player in ipairs(game.Players:GetChildren()) do
if player.userId == receiptInfo.PlayerId then
-- check which product was purchased
if receiptInfo.ProductId == productId1 then
player.leaderstats.Snowflakes.Value = (player.leaderstats.Snowflakes.Value + 200)
elseif receiptInfo.ProductId == productId2 then
player.leaderstats.Snowflakes.Value = (player.leaderstats.Snowflakes.Value + 500)
elseif receiptInfo.ProductId == productId2 then
player.leaderstats.Snowflakes.Value = (player.leaderstats.Snowflakes.Value + 1000)
elseif receiptInfo.ProductId == productId2 then
player.leaderstats.Snowflakes.Value = (player.leaderstats.Snowflakes.Value + 5000)
end
end
end
-- record the transaction in a Data Store
local playerProductKey = "player_" .. receiptInfo.PlayerId .. "_purchase_" .. receiptInfo.ProductId
ds:IncrementAsync(playerProductKey, 1)
-- tell ROBLOX that we have successfully handled the transaction
return Enum.ProductPurchaseDecision.PurchaseGranted
end
Any help is greatly appreciated!

1 comment
Why I hate the warning system sometimes! I'm not getting the warning on my end.