I made a script that on "f" pressed turns on SpotLight, the problem is when I use key == "f" it doesn't work and when I use key:byte() == 50 (etc.) it does.. Here's script
script.Parent.ChildAdded:connect(function()
if mouse == nil then
Player = game.Players.LocalPlayer
mouse = Player:GetMouse()
end
mouse.KeyDown:connect(function(key)
local Left = script.Parent.Parent.Lights.FL.FLL
local Right = script.Parent.Parent.Lights.FR.FRL
key = key:lower()
if key == "f" and Left.Enabled == false then
Left.Enabled = true
Right.Enabled = true
if key == "f" and Left.Enabled == true then
Left.Enabled = false
Right.Enabled = false
end
end
end)
end)

1 comment
This is not an answer. Use comments to clarify information.