I found a script on this form for no recoil and would like to be able to toggle it on and off with the scroll lock key. I believe I'm suppose to use if IsKeyLockOn("scrolllock" )then but not sure were to paste it because everywhere I try it, it makes the script unusable. Any help would be appreciated. Here is the script I'm using

local zoomed = false
local weapons = true
local random = 0
EnablePrimaryMouseButtonEvents(true)
function OnEvent(event, arg)
OutputLogMessage("event = %s, arg = %d\n", event, arg)


if (event == "MOUSE_BUTTON_PRESSED" and arg == 2 and weapons) then
zoomed = true
end

if (event == "MOUSE_BUTTON_RELEASED" and arg == 2 and weapons) then
zoomed = false
end


if(weapons == true)then
if (event == "MOUSE_BUTTON_PRESSED" and arg == 1 and zoomed) then


PressKey("q")
Sleep(5)
ReleaseKey("q")


repeat
MoveMouseRelative(0,4)
Sleep(25)
until not IsMouseButtonPressed(1)

end
end

if (event == "MOUSE_BUTTON_PRESSED" and arg == 5) then


PressKey("5")
Sleep(600)
ReleaseKey("5")
Sleep(150)
PressKey("5")
Sleep(600)
ReleaseKey("5")




end
end