Good day! Today I wrote my first and own script for the first time. It is a door script in which when you press the button that the door opens. So it’s actually very simple. The script works, but I’m not sure if I made this as easy as possible or if there is an easier and more efficient way to do it.
Here is the code of the working door:
local button = script.Parent.Parent local wood = script.Parent.Parent.Parent.Wood function onClick() button.CanCollide = false wood.CanCollide = false wood.Transparency = 0.3 wait(3) button.CanCollide = true wood.CanCollide = true wood.Transparency = 0 end clickDetector.MouseClick:Connect(onClick)```