Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

0

Is this in a LocalScript?

1 answer

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.