What is wrong with my Script! I don't want to use Data Stores Because none of the data needs saved.
local buyButton = game.Workspace.BuyButton.SurfaceGui.TextButton
local productId = 22847136
buyButton.MouseButton1Click:connect(function()
game:GetService("MarketplaceService"):PromptProductPurchase(game.Players.LocalPlayer, productId)
end)
local MarketplaceService = Game:GetService("MarketplaceService")
local productId = 22847136
MarketplaceService.ProcessReceipt = function(receiptInfo)
for i, player in ipairs(game.Players:GetChildren()) do
if player.userId == receiptInfo.PlayerId then
if receiptInfo.ProductId == productId then
workspace.TheDoorToHall1.Transparency = 0.25
workspace.TheDoorToHall1.CanCollide = nil
end
end
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end

1 comment
Is this in a LocalScript?