I have made a certain key that makes a frame visible or invisible. This isn't working. Can someone tell me why and how to fix it?
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local CoolFrame = game.StarterGui.ScreenGui.Frame
Mouse.KeyDown:Connect(function(Key)
Key = Key:lower()
if Key == 'e' then
if CoolFrame.Visible == false then
CoolFrame.Visible = true
else
CoolFrame.Visible = false
end
end
end)

1 comment
Keydown is deprecated.