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

How to script my Parts to be not CanCollideable on touch?

for key, value in pairs(game.Workspace.Anxiety:GetDescendants()) do if value:IsA("BasePart") and value.Name == "Base" then value.Touched:Connect(function(testDictionary) testDictionary.CanCollide = false end) end end for key, value in pairs(game.Workspace.Anxiety.Modell:GetDescendants()) do if value:IsA("BasePart") and value.Name == "Base" then value.Touched:Connect(function(testDictionary) testDictionary.CanCollide = false end) end end

1 answer

Instead, use "Code Blocks" like this one:

print("Use Code Blocks!")

And you can simply just use:

script.Parent.Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid") then
		script.Parent.CanCollide = false
	end
end)

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