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

Trying To make a Developer Product Door What's Wrong?

Asked by 9 years ago

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


0
Is this in a LocalScript? Gamenew09 180 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago
workspace.TheDoorToHall1.CanCollide = nil

CanCollide shouldn't be 'nil'; it's a true/false value. Set CanCollide to false for a part you can walk through, and CanCollide true for a part you can't.

Ad

Answer this question