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

How do I make a brick walk-through?

4 answers

Just untick the 'CanCollide' property in the properties of the part.

It should look a little like this for an open/close door

local Door = script.Parent --The Part that we are touching
function onTouch(Brick) --Sends a message to the brick that it was touched
	local Player = Brick.Parent:findFirstChild("Humanoid") --Searches for a human
	if(Player ~= nil) then --If there is a human then..
			Door.CanCollide = false --Door opens
			Door.Transparency = 1 Door is see through
			Door.BrickColor = BrickColor.new(math.random(), math.random(), math.random()) --Changes colour, just a little fun thing if you want it
			wait(1.5) --Waits 1 1/2 seconds before it closes
			Door.CanCollide = true --closes
			Door.Transparency = 0 --Door is normal again
	end
end
Door.Touched:connect(onTouch) --Connects to the onTouch script.

Put this in a script in the part.

while true do
	script.Parent.CanCollide = false
	wait(10) -- So it doesn't crash
end

1 comment

0

Maliux, look what I just did.

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