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

The output says that CanCollide is not a valid value, what went wrong?

There is the script:

Used Tuneabl's Sandbox Tutorial Everything works fine when I comment the Canciollide statement in line 40

--------------------------Vars---------------------------------------------

local placementHandler = require(script:WaitForChild("PlacementModule"))
local base = workspace.Base
local items = game:GetService("ReplicatedStorage").Items
local plane = placementHandler.new(base.Baseplate, base.ItemHolder, 3)

local GreyButton = script.Parent.SelectionFrame:WaitForChild("Grey")
local BlueButton = script.Parent.SelectionFrame:WaitForChild("Blue")

local dummyModel
local signal
local currentItemName

------------------------------------------Functions-------------------

local function cancelPlacement()
	if (dummyModel) then
		plane:disable()
		
		if (dummyModel.Parent) then
			dummyModel:Destroy()
		end
		
		dummyModel = nil
		signal = nil
		currentItemName = nil
	end
end


local function initiatePlacement(itemName)
	cancelPlacement()
	
	dummyModel = items[itemName]:clone()	
	currentItemName = itemName
	
	for _, object in pairs(dummyModel:GetChildren()) do
		if (object:IsA("BasePart")) then
			object.Cancollide = false
		end
	end
	
	dummyModel.Parent = workspace
	
	local signal = plane:enable(dummyModel)
	
	signal:connect(function(location, _)
		game:GetService("ReplicatedStorage").ClientPlaced:FireServer(currentItemName, location[1])
		
		cancelPlacement()
	end)
	
end

---------------------------------Buttons----------------------------------

GreyButton.MouseButton1Down:Connect(function()
	initiatePlacement("Grey")
end)

BlueButton.MouseButton1Down:Connect(function()
	initiatePlacement("Blue")
end)

Thanks for the Help!

2 answers

✓ Accepted answer

You forgot to capitalize the "c" in "Collide"

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