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

How do you make a Click to Open door?

I have gotten the LocalPlayer's mouse in a local script so now what?

local player = game.Players.LocalPlayer
local mouse = player:GetMouse()

1 answer

Insert a ClickDetector inside the part

function onClicked()
wait(0.1)
script.Parent.Transparency = 1
script.Parent.CanCollide = true
wait(2)--amount of time before door is closed
script.Parent.Transparency = 0
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)

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