Game Tick Scripting
This module may be removed in the future. Move your code to Events Scripting module like this:
events.onHandleKeys(() => {
    // your code
});
            
Or if you want to run something every game tick, not related to handling keys, use this:
events.onTickEnd(() => {
    // your code
});
            
Code: