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

how to make a wall cancollide = false when clicked?

heres my attemp:

local wall = script.Parent local mouse = game.Player:GetMouse() local click = game.Workspace.wall1.ClickDetector:Touched()

local function closeWall(part) wall.CanCollide = true for transparency = 0, 0, 0 do door.Transparency = transparency wait(.1) end

function openDoorOnClick() if mouse.click.wall then wall.CanCollide = false for transparency = 1, 0, -.1 do door.Transparency = transparency wait(.1) wait(5) closeWall end

2 comments

0

forgot to add:

0

local mouse = game.Player:GetMouse()

1 answer

You can't touch a click detector.

Try doing:

local wall = script.Parent 
 local click = game.Workspace.wall1.ClickDetector.MouseClick

local function closeWall() 
wall.CanCollide = true 
for transparency = 0, 0, 0 do 
door.Transparency = transparency 
wait(.1)
end

function openDoorOnClick() 
 wall.CanCollide = false 
for transparency = 1, 0, -.1 do 
door.Transparency = transparency 
wait(.1) 
wait(5) 
closeWall()
end
click:connect(openDoorOnClick)

You also don't need to get the mouse. You also need to use the events.

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