I'm trying to get an equip tool to enable a SpotLight when you press "F". I'm also trying to get the tool to turn off when you press "F" again. Any help on this? I've been trying to fix it.
local tool = script.Parent local light = script.Parent.Handle.SpotLight tool.Selected:connect(function(mouse) mouse.KeyDown:connect(function(key) if key == "f" then light.Enabled = true else light.Enabled = false end end) end)
local tool = script.Parent local light = script.Parent.Handle.Spotlight a = Instance.new("BoolValue") a.Parent=tool a.Value.Value=false tool.Selected:connect(function(mouse) mouse.KeyDown:connect(function(key) if key == "f" then if script.Parent.Value.Value=false then light.Enabled=true script.Parent.Value.Value=true else light.Enabled=false script.Parent.Value.Value=false end end end) end)
Should work although not tested.