Lua script logitech

update 1/23/22. How to fix "Logitech Disables Lua Scripts from Latest Update". GHUB Logitech Update Blocking Lua Recoil Scripts - FIX. THIS WILL NOT WORK PERFECT OUT-OF-THE-BOX. YOU NEED TO CHANGE THE SETTINGS. Newbies -- Step 1 is downloading Visual Studio Code. It'll save you're life. Download extensions > Lua.

Lua script logitech. With The Finals Logitech Lua Script No Recoil Macro; 6in1 (AK47, FCAR, M11, XP-54, M60, LEWIS GUN) Up to date Season 2. Works with All Windows Versions. Undetected & Secure. Customizable Button Switch Weapon. Customizable Button Activate & Deactivate. Easy Installation. Work with any Sensitivity.

Go to the big mouse picture in LGS. Unassign standard command "Back" from physical MB#4 (select "Unassign" from the drop-down menu). Step 4. Set the script (see below). Step 5. Go to the big mouse picture in LGS. Assign command "Back" to your physical LMB. You will see a warning about a potentially dangerous operation.

When it comes to creating a quality voice over project, one of the most important aspects is the script. A well-crafted script can make all the difference in delivering a clear and...Download ZIP. Logitech G No Recoil Script. Raw. NoRecoilScript.lua. This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters.If you need that, you can create a logitech key to change profiles, and change in and out of this script. Step 1 - Have a logitech mouse, or G hub. Step 2 - Open your ghub profile, click on your mouse image. On the profile you will see "details", then you will see scripting to the right of that. Click and open new script/edit.v4.0 Logitech Anti-Recoil LUA live topic. I haven't been around, I've been touching grass. Came back for my usual updates. More reliable, More easy, More gooder. For all the instructions and how to, see my history: No Recoil / Rapid Fire - Final Release - Logitech GHUB. Code:Logitech Lua script. 0. Lua script for g502. Hot Network Questions Homemade salad dressing with raw garlic not safe? Float should appear on next page and this page should be a floatpage Can a pilot tell a controller they don't need IFR clearance? I want to show by simulation that the Wilcoxon test is more robust than the Student test for …Rust 1MS Logitech Macro - Any Sensitivity - Any Fov (But best work on 0.4-0.6 sensitivity) - Working on only Logitech mouses - NO GAME BAN! Dont use Script, macro better. Dont use Script, macro better.Welcome, I'll teach you how to create or import a script in the new Logitech Gaming Hub update on LUA. ★Links My website: https://www.kriptaep.com Store: …

LOGITECH/LUA SCRIPT: IsModifierPressed for spacebar. 0. How to make random looping time in logitech gaming lua script? 1. Rapid fire with logitech lua script? 0. Logitech G Hub API Lua Script. Hot Network Questions How to write the metaphor: "Time is like sunlight and habits are like plants. The habits that receive your time will ...This is a script written LUA for MW3 (2023). I used the gun with the highest recoil (Swarm) as a base. Sens should be around 20-25% if you need more sens speed I suggest updating your DPI. You can change the script and find settings based on your sens. This will only work when you ADS (Hold) so the script can run 24/7 and not be a bother to you.[Request] New working GHUB script? Heady24: Rainbow Six Siege: 1: 7th May 2021 11:09 PM [Coding] coding a lua script in logitech ghub to autoclick: 090807: Minecraft: 2: 8th September 2020 11:10 PM [Discuss] How many of you all are running a private platform and how many of you are undetected: renatakeda: League of Legends: 20: 14th April 2018 ...Recoil Script with (Logitech) LUA language - need advice: petee: Battlefield 4: 0: 7th November 2013 08:51 PM [Question] Macro For Mice logitech performance mx or logitech Mx510: mamkody: Battlefield 3: 0: 21st January 2013 12:39 AM [Request] Less Recoil Script / Macro for Logitech G15/G19 Keyboard: abbadon0r: Battlefield 3: 1: 19th August 2012 ...In this video, I'll show you how to use the Logitech No Recoil Script (GHUB) to create a rust macro. This macro will enable you to shoot and kill enemies wit...LUA scripts for Logitech G series. Written for the G502 Hero, but should work with all Logitech G series. The scripts can be customized to launch any of your local macros.

#sparkezdownload link: https://support.logi.com/hc/en-us/articles/360025298133Mar 10, 2024 ... Join the discord for help https://discord.gg/pZm3ZFG3 Download: https://lootdest.com/s?rO4M Disclaimer: In accordance with the Youtube ...Start of by heading into your G Hub Software. 2. At the top you should see "Active Profiles" click on this. 3. Go to your Rainbow Six Siege Profile, and next to the detail you should see "Scripting", click on this. 4. Now what you do is where it says "Active LUA Scripts: None", you are gonna click on the None and select "Create a new LUA script".I'm recording a full detailed step by step video tutorial for Youtube!! In the video i will show: 1) The usage and customisation of the "Legacy Lazy Edits FN" lua script and a alternative way to get "Legacy Lazy Edits FN" with a simple Macro, which you can use with any Device and Manufacturer like Logitech, Razer, Steelseries, ... 2) How to easily increase your Fortnite Game stability and ...

Orlando lozano lottery winner.

1. Right-click on your profile. 2.Click "Create Script". 3.Paste my script and save. 4. close the window. Press the 5th Mousebutton and "shift" to switch the "Recoil" function on or off. When you turn on the function u Need to press the 2nd Mousebutton first then the 1st Mousebutton to make it run.The Lua code provided generates a no recoil script for Apex Legends using Logitech G HUB. The script takes the weapon name and recoil pattern as input parameters. It validates the input parameters and generates the script accordingly. The script uses a loop to simulate the recoil pattern by moving the mouse relative to the pattern values.Step 1: Click on the “ Windows Search Bar ” and type “ Control ”. Step 2: Click “ Control Panel ” and select “ Uninstall or Change a Program ”. Step 3: Find “ Logitech G Hub ” in the list of installed software and right-click it. Step 4: Click “ Uninstall ”, select “ Yes ” on the following prompt and wait until the ...In Lua script you can call PlayMacro with the name of the macro created to control the illumination programmatically. GHUB can not see usual key (letter, digit) status to determine whether the key is pressed or not. Only Logitech mouse buttons and Logitech keyboard G-keys are visible by GHUB.Recoil Script with (Logitech) LUA language - need advice: petee: Battlefield 4: 0: 7th November 2013 08:51 PM [Question] Macro For Mice logitech performance mx or logitech Mx510: mamkody: Battlefield 3: 0: 21st January 2013 12:39 AM [Request] Less Recoil Script / Macro for Logitech G15/G19 Keyboard: abbadon0r: Battlefield 3: 1: 19th August 2012 ...Witcher 3 - Instant Sign Casting LUA script for Logitech Gaming Software. lua witcher-3 logitech logitech-gaming witcher3 Updated Nov 30, 2018; Lua; Improve this page Add a description, image, and links to the logitech topic page so that developers can more easily learn about it. Curate this topic ...

Function 1 MoveMouseRelative repeated every ()ms. Function 2 MoveMouseRelative repeated every ()ms. Function 3 PressKey("P") repeated every ()ms. Function 4 PressKey("P") repeated every ()ms. And combine it that so If I press MouseButtonPressed (1) it does Function 1+3, so it clicks P and drags mouse down at the same time, but with different ...1. You can use polling of key/button statuses inside a long running script to exit it immediately. First, bind "Forward" action to physical key G4. "Forward" is the default action for mouse button 5, so Windows will see your G4 press as if it was mouse button 5 press. Second, set the script: local function ShoudExitNow() -- Exit when mouse ...How to use logitech lua scripting. 0. Logitech Lua script. 0. Lua script for g502. Hot Network Questions How to disallow camera sync from Mac to iPhone Alright to leave or use electric bicycle in rain Recreate {% cache %} content without clearing first Can I bond a ground wire to a junction box that is using metal conduit for ground ...im trying to run this script on my logitech mouse. I want the mouse cursor to move down, it does but after a while of the cursor moving down the cursor reverses in direction. Does anyone know why? if IsMouseButtonPressed(1)then. repeat. MoveMouseRelative(0*mult, 11*mult)Sleep(10) if not IsMouseButtonPressed(1) then …However nothing happens after i activate the script using mouse 3 button When I activate the script with my mouse 3 (scrollwheel) click, the caps lock key turns on/off and the script also has this message 'ON-NoRecoil-R301' or the off alternative, which indicates that atleast the first half of the code is functioning, but the second half where …No Recoil / Rapid Fire - Final Release - Logitech GHUB Improved Warzone COD RECOIL and Rapid Fire Logitech Script Megathread with Support How to fix "Logitech Disables Lua Scripts from Latest Update" GHUB Logitech Update Blocking Lua Recoil Scripts - FIX THIS WILL NOT WORK PERFECT OUT-OF-THE-BOX. YOU …2. 49 views 10 days ago. ...more. Learn how to assign Logitech macros, edit scripts, and customize buttons on your Logitech mice and keyboards in this video. …In Windows Settings, open Apps & features. Search for Logitech G HUB. Click on Logitech G HUB and click Modify. In the new window, select Reinstall G HUB, then click REINSTALL. G HUB will reinstall, and this will resolve the issue while retaining the settings. 1.LUA Scripts Macro Apex Legends S17 UPDATED🛒 Purchase | Universal Macro for Logitech Mouse• Purchase on Fiverr: https://www.fiverr.com/share/6NBkjr📧 Conta...Easy installation. Works with any DPI setting. Recommended FOV: 90. Compatible with Logitech G HUB or Logitech Gaming Software. Supports Logitech mice (click here for the list). Enhance your Apex Legends gameplay seamlessly with this reliable and feature-rich Logitech Lua Script. Join the gaming revolution now! Installation Guide Download Now.

316. 54K views 2 years ago. Since Logitech removed Luas feature after the update : 2022.1.3492 ( idk the reason why ) this video shows how to use old G-hub version and how to get …

Lua script for logitech [apex legends no recoil] when Num lock true the scrip runs when not it doesnt first aim then shoot whit num lock on Raw. no recoil This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden ...Rust Undetectable Macro Script. Rust Logitech Macro options allow you to get the maximum performance from your Logitech branded hardware devices. Moreover, the accuracy and speed rate of the Logitech gamer mouse increase. Moreover, the game system or other players absolutely does not notice this support you get in games.Sleep expects a single argument - an integer amount of milliseconds. For example, use Sleep(10) MOUSE_BUTTON_PRESSED("11") is unknown function. If you want to determine whether button #11 is down: Assign a command "Back" to the mouse button #11 in the user interface of G Hub; Use IsMouseButtonPressed(4) in the script: function OnEvent(event, arg)There is a newer, better version available now. I originally did this for BF4 but it works with pretty much every shooter (depending on the weapon) This is a simple …It's not macro that could be recorder with G-Hub software. Those are working. LUA. scripting isn't functioning. You can write a script it is accepted by software, but it will not be executed per profile in game. 1. Reply. 1 / 3. I had an accident last year where I loss 3 of my fingers, and it have been a life changing experience trying to ...1. I'm new to Lua language, just wanna program a macro for Logitech Mouse button, the desired action is: press the button to start and loop the macro continuously until I toggle it off by pressing the button again. I know a similar question had been post as: Lua handling mouse event . But I have difficulties to run their example code.I want to click a mouse5 button and let a script do a loop that press a keyboard Y key with a random delay time. Until I click a mouse button5 again it must stop a loop. I have tried for a while and can't fix it, it became a infinite loop. Here the code I tried to write: function OnEvent(event, arg) OutputLogMessage("event = %s, arg = %s ...Welcome,I'll teach you how to create or import a script in the new Logitech Gaming Hub update on LUA.★LinksMy website: https://www.kriptaep.com Store: https:...This is Universal recoil that make to lua script. This is not an aim assist script, and yes lua script using mouse event will be detected. Yes this is a universal anti recoil, but it's also an aim assistance since it makes. it easier to hit enemies. And using Lua scripts in Software programs of you're.

Jeanine pirro no makeup.

Ifit free activation code.

This script does a few things. 1) Numlock enables the recoil management script. 2) Caps lock enables Rapid fire. This is a single fire, fast repetition with a number range for timing so it's not robotic. 3) The Scroll Lock button will alternate between AK, and M4/SSG/Aug. Scroll Lock off = AK, Scroll Lock on = AR.The main problem is that Ghub uses a lua vm to do move the mouse, they have removed all standard libs for lua. THIS is the ghub mouse move killer, because it makes it (almost) impossible to communicate to the script from an external program. even if you had your exact mouse inputs you could not tell the lua script anything, and the lua script itself cant do anything more than simple macros.aprenda a como inserir o script valorant (macro) no recoil no programa da logitech g-hub para os mouse da linha g! link do macro valorant: https://bit.ly/do...I want to click a mouse5 button and let a script do a loop that press a keyboard Y key with a random delay time. Until I click a mouse button5 again it must stop a loop. I have tried for a while and can't fix it, it became a infinite loop. Here the code I tried to write: function OnEvent(event, arg) OutputLogMessage("event = %s, arg = %s\n ...Jan 26, 2021 · If you need that, you can create a logitech key to change profiles, and change in and out of this script. Step 1 - Have a logitech mouse, or G hub. Step 2 - Open your ghub profile, click on your mouse image. On the profile you will see "details", then you will see scripting to the right of that. Click and open new script/edit. Recoil Script with (Logitech) LUA language - need advice: petee: Battlefield 4: 0: 7th November 2013 08:51 PM [Question] Macro For Mice logitech performance mx or logitech Mx510: mamkody: Battlefield 3: 0: 21st January 2013 12:39 AM [Request] Less Recoil Script / Macro for Logitech G15/G19 Keyboard: abbadon0r: Battlefield 3: 1: 19th August 2012 ...It works for me so please play around with the script and try to fix it yourself. But here are some potential solutions. Make sure your mouse is set to persistent: Profiles > Details > Set as Persistent. Try changing local currentKeyBind = "lalt10" to a number that you have on your mouse.1. Create a new Lua Script.2. Copy & Paste the code.3. Press "Mouse 4" to change the Recoil Preset.Tested Games: CS:GO, R6S, GTA5, Apex Legends, 5x COD Games... ….

Easy installation. Works with any DPI setting. Recommended FOV: 90. Compatible with Logitech G HUB or Logitech Gaming Software. Supports Logitech mice (click here for the list). Enhance your Apex Legends gameplay seamlessly with this reliable and feature-rich Logitech Lua Script. Join the gaming revolution now! Installation Guide Download Now.Lua script does not work when mouse is in on board memory mode. Only simple macros (sequences of key press/release and delays) are available in this mode. For Lua script to work, a Lua virtual machine should …20 year Logitech customer also, not any more. I will be filing an anti consumer practices lawsuit in New Zealand against Logitech since they still actively sell products that they have now crippled using software. Boycott Logitech unless LUA returned. Do not buy their mice.LUA. Battlefield 2042: No Recoil/Rapidfire Logitech How does the Bf2042 No Recoil Logitech Script Works work? Numlock – Toggles the script. Scroll lock – Toggles AR and SMG style guns, OFF= AR/Strong No Recoil.I want to click a mouse5 button and let a script do a loop that press a keyboard Y key with a random delay time. Until I click a mouse button5 again it must stop a loop. I have tried for a while and can't fix it, it became a infinite loop. Here the code I tried to write: function OnEvent(event, arg) OutputLogMessage("event = %s, arg = %s\n ...any Logitech LUA scripts? You can probably make some spell cast combo with LUA but nothing more. Also you can just do it yourself as this is as easy as it gets. All you can do is write a macro that can possibly simplify the game. For example, an automatic jump to the ward lee seen, but no more than that, I think it's possible if you try to ...Download Call of Duty Modern Warfare No Recoil Macro Script. Simple to install and easy to use. Download and be the best in Modern Warfare. By using our website, you agree to the use of our cookies. ... With Call of Duty Modern Warfare Logitech Lua Script No Recoil Macro; 28 in 1 (COD MW Weapons; Kilo 141, FAL, M4A1, ODEN, M13, FN SCAR 17, AK ...Bind "Primary Click" to G8 (from now on, use button#8 instead of LMB) Bind "Back" to G1. Set the script. Now you should have the following: Primary Click = G8. Back = G1 G4. Mouse button#8 is now "spare LMB" just in case LMB works incorrectly. edited Sep 11, 2020 at 6:21. answered Jul 5, 2020 at 4:36.[Release] PUBG LOGITECH Lua script for basic anti-recoil and lean/peek spam toggle: MADDJESTER: PUBG Releases: 21: 12th December 2022 12:09 PM [Release] Update 3.0 - Rapid Fire & Anti Recoil - Logitech LGHUB LUA BLOCK FIX: sashaatx: Call of Duty: Modern Warfare: 6: 30th January 2022 07:52 AM [Release] … Lua script logitech, Overview. The G-series Lua API is a set of functions using the Lua programming language and provides advanced scripting functionality for the G-series line of gaming keyboards. This document assumes a working knowledge of the Lua programming language. Further information can be obtained from www.lua.org. , Start of by heading into your G Hub Software. 2. At the top you should see "Active Profiles" click on this. 3. Go to your Rainbow Six Siege Profile, and next to the detail you should see "Scripting", click on this. 4. Now what you do is where it says "Active LUA Scripts: None", you are gonna click on the None and select "Create a new LUA script"., Welcome to the Logitech G subreddit! This is the place to talk about Logitech G hardware and software, pro gaming competitions and our sponsored teams and players. We love getting feedback and hearing about your experiences with your products. Please use the "Support" flair if you want help from our support team., You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window., Rapid fire with logitech lua script? 0. How can I write simple Lua code for Logitech mouse? 0. How to make this Logitech Mouse LUA script work better? 0. Can Someone Combine these 2 scripts. 1. How to use logitech lua scripting. 0. …, 1- U need to have Logitech G HUB. 2- Go to games and applications select R6 and create a new o choose a existent profile. 3- Manage profiles and select the circular button (Scripting) and the Create a new LUA script. 4- Delete all the text in that box paste the script and save it (Ctrl+S), LOGITECH scripts ARE NOT ahk scripts. They're scripts that you can use with LGS Hub and a logitech compatible mouse to run scripts. I've personally never been banned with them- not in csgo, not in overwatch, no where. But I'm hearing people say the are, so wtf., Try the following and check if this helps: In Windows Settings, open Apps & features. Search for Logitech G HUB. Click on Logitech G HUB and click Modify. In the new window, select Reinstall G HUB, then click REINSTALL. G HUB will reinstall, and this will resolve the issue while retaining the settings. Reply., aie1123 / CS2-CSGO-No-Recoil-LOGITECH-Script-Macro Public. Notifications. Fork 1. Star 6. main. Cannot retrieve latest commit at this time. 21 Commits., There are only two possible outcomes. true == true -> true or false == true -> false. So you can use the return value directly and simply write if IsMouseButtonPressed(1) then. If you want to do someting in the false case it is common practice to simply negate the return value. not false -> true., Logitech is a renowned name in the world of computer peripherals, and their keyboards are no exception. One of the key features that sets Logitech keyboards apart is the ability to..., 建议调试时开启,调试完毕后关闭。. (1 - 开启 | 0 - 关闭) -- Whether to output debugging information, the CPU calculation pressure can be reduced after close. -- It is recommended to turn it on during debugging and turn it off after debugging. -- (0 - Disable | 1 - Enable) debug = 1, -- CPU 负载等级,建议输入 1 ~ 30 ..., end. i want to set numlock to turn on and off script. and i want to set when capslock is off script use this: repeat. MoveMouseRelative(-2, 3) Sleep(10) MoveMouseRelative(2, -2) Sleep(10) until not IsMouseButtonPressed(1) and when capslock is on script use this:, LGS_script_template.lua is a template for writing your own Lua scripts in the Logitech Gaming Software programming environment. Both LGS and GHUB are supported. Five additional useful features are implemented here: Function print() now displays messages in the bottom window of the script editor, you can use it the same way as in original Lua;; random() is an improved drop-in replacement for ..., Logitech G hub lua script, trying to turn integer to string. Hot Network Questions If microwave ovens run at 2.4 GHz, what is the long-term effect on living tissue of exposure to this frequency, but with a thousand times less energy? ..., When it comes to managing your prescription medications, it’s important to have access to a reliable and user-friendly platform. The Express Scripts official site is an excellent r..., From memory, I did some simple "inject flag" checks with the Logictech Lua API and some things were picked up so I'd say most of the methods are "virtual" (AC can clearly see you're doing stuff and perhaps already blocks them). However, the MoveMouseRelative method was one that didn't set the "inject flag". Probably comes from the driver directly and valorant only seems to try and block mouse ..., Overview. The G-series Lua API is a set of functions using the Lua programming language and provides advanced scripting functionality for the G-series line of gaming keyboards. This document assumes a working knowledge of the Lua programming language. Further information can be obtained from www.lua.org. , I've always used this LUA script on Logitech Gaming software by using a G502 mouse, I had to change my old mouse and I bought a new version "G502x" which is not recognized by LGS so I had to install GHub to make the mouse useful, but the script is not working with GHub, any changes I can apply to the code so it works properly now?, LED ILLUMINATION SDK. 07/02/2018 | 9.00. Get access to all of the LED backlighting and RGB capabilities of Logitech G products, including implementation in Logitech G HUB Early Access. Integrate profiles for custom key configurations, develop in-game effects, or mark keys to keep track of cooldowns on various commands. DOWNLOAD ILLUMINATION., it run an ever logitech G - Mouse. And if you have a Logitech G Keyboard you can run this script und a 3rd Party mouse. If you want use it please read the Logitech Forum in the LUA Script Section But arg=11 you must change or delete if your mouse dont have enough., aprenda a como inserir o script valorant (macro) no recoil no programa da logitech g-hub para os mouse da linha g! link do macro valorant: https://bit.ly/do..., Logitech Steering Wheel - Scripts and Shift Keys. By NaytoE. This is a tutorial showing you how to use the script feature in the Logitech Gaming Software to make the most out of your wheels buttons. Includes full tutorial for making shift keys to have multiple functions assigned to one key. Award., Welcome to the Logitech G subreddit! This is the place to talk about Logitech G hardware and software, pro gaming competitions and our sponsored teams and players. We love getting feedback and hearing about your experiences with your products. ... so I made a Lua script to fix that! Bind the mouse button you want as your G-Shift toggle in G Hub, For security reasons you need to have exported the script from G-Hub. Copy and Paste the script to C:/ or D:/ etc. Give the file a different name like "world" Go to G-Hub or LGS and add the code line below. data = dofile[[C:\world.lua]] In the code line you will see that I change the name to world. Change it if you gave a different name. , 1. I'm new to Lua language, just wanna program a macro for Logitech Mouse button, the desired action is: press the button to start and loop the macro continuously until I toggle it off by pressing the button again. I know a similar question had been post as: Lua handling mouse event . But I have difficulties to run their example code., Hey guys I recently started trying to write some simple Lua Scripts for Logitech GHUB. I finally got them working the way I like but I'm having troubles with this one. Instead of instantly stopping when I release Mouse5 it will continue to execute the script till the end. I want it however to immediately stop if I release Mouse 5., Points: 573, Level: 1. Level up: 35%, 327 Points needed. Activity: 4.4%. Simple LUA Anti-Recoil script for Logitech G HUB. Created a simple anti recoil script for Logitech GHUB with customizable strengths and wanted to share it here., ApexAHK. Reduced/No Recoil Script For Apex Legos. For Educational Purposes ONLY. UPDATE Log. 11/08/2023. Fixed files not being added to github properly (not even sure how this one happened) 11/04/2023. Changed Prowler Pattern (still burst only)! 11/03/2023., Bind scroll left (G11) to the command "Back". This will remove the functionality of your "Back" G4 button, but Middle Click will work. Set the script: function OnEvent(event, arg) if event == "MOUSE_BUTTON_PRESSED" and arg == 11 then. repeat., For security reasons you need to have exported the script from G-Hub. Copy and Paste the script to C:/ or D:/ etc. Give the file a different name like "world" Go to G-Hub or LGS and add the code line below. data = dofile[[C:\world.lua]] In the code line you will see that I change the name to world. Change it if you gave a different name., The only keys G HUB can "see" are: Shift, Alt, Ctrl (selectable: left/right/any). until not IsModifierPressed("lctrl") -- left ctrl. G HUB can also see LED status for NumLock, ScrollLock and CapsLock (for example, IsKeyLockOn("CapsLock"). G HUB can also handle press/release events of special G-keys and M-keys on a Logitech keyboard (G-keys are ..., On the first run of the function script_running is nil (which evaluates to false). So script_running is set to true and the loop is run. Then when you press the G1 key again it enters the function again, but this time script_running is true, which sets the script_running variable to false and exits the function.