So what I'm trying to make is make a script track 1) If the player is hovering over the brick and 2) If they pressed a key while hovering over that brick. Much appreciated.
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
Mouse.Move:connect(function()
if Mouse.Target and Mouse.Target == workspace.Door1 then
workspace.Door1.ekey.Enabled = true
print("Im on it")
elseif Mouse.Target and Mouse.Target ~= workspace.Door1 then
workspace.Door1.ekey.Enabled = false
end
end)
function onKeyDown(key)
key = key:lower()
if key == "e" and Mouse.Target == workspace.Door1 then
print("E pressed over the brick")
end
end
