I'm trying to make a door that opens when you press the letter f on your keyboard. But I need it to open when you're close to it not when you're far away. Can anyone help me on this? The script is
local m = game.Players.LocalPlayer:GetMouse()
db = true
m.KeyDown:connect(function(k)
k = k:lower()
if k == "f" then
if db == true then
game.Workspace.Door.CanCollide = false
game.Workspace.Door.Transparency = 1
wait(3)
game.Workspace.Door.CanCollide = true
game.Workspace.Door.Transparency = 0.5
end
end
end)

3 comments
region 3?
I want to see the answer to this myself :)
use :Connect plssssssss