My FNAF 1 Doors won't work

Hello!

I’ve recently been trying to make a FNAF Recreation, and so far all I’ve really got progress on, is the map. This is a solo project, so issues are to be expected.

My problem is this…

I’ve decided to go ahead and start working on the main mechanics, and the first mechanic, is the doors. The way I’ve always made clickable buttons, via parts won’t work, so I’ve came to the forum to see if I’ve forgotten to add something. I’ve tried every way I know to fix this issue, and nothing works.

Here’s the code:

local Click = game.Workspace.LeftButton.ClickDetector
local RightButton = game.Workspace.RightButton
local RightDoor = game.Workspace.Right

RightButton.Click.MouseClick:Connect(function()
    RightDoor.CanCollide = false
    RightDoor.Transparency = 1
if RightDoor.CanCollide == false then
    RightDoor.CanCollide = true
    RightDoor.Transparency = 0
    end)
end)

this is your main problem. you set the door as if its open then in the following code it automatically closes. try adding this code before this part
if RightDoor.CanCollide == true then

1 Like

Thank You so much.

I’m very VERY new to coding so any help is more the much appreciated. Thank You for taking the time to respond so quickly.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.