I was wondering if you could poissibly store dev product purchases so once they have been purchased they stay with you forever, like if they buy a sword, when they come back the game would recongnise it and give them the sword. I can't create gamepasses cause my game seems to be broken so I cant create a single pass. I was thinking maybe Data Store. I have looked at the dev product wiki but need help with server side and putting in the datastote.
-- Server side
local MarketplaceService = Game:GetService("MarketplaceService")
MarketplaceService.ProcessReceipt = function(receiptInfo)
game.Workspace.DisplayScreen.SurfaceGui.TextBox.Text = receiptInfo.PlayerId .. " just bought " .. receiptInfo.ProductId
-- ...
-- use DataStore to record purchase
-- ...
return Enum.ProductPurchaseDecision.PurchaseGranted
end
-- Client side
local MarketplaceService = Game:GetService("MarketplaceService")
local buyButton = game.Workspace.BuyButton.SurfaceGui.TextButton
local productId = "ID"
buyButton.MouseButton1Click:connect(function()
MarketplaceService:PromptProductPurchase(player, productId)
end)

5 comments
in localscript, startergui?
DataStores can only be accessed from server scripts.
which are just normal scripts, placed just in sevrerscriptstorage?
Normal scripts are server scripts.
ok thanks :D