Last active
June 17, 2024 03:00
-
-
Save choro3/3330d6800c6f86d1cb7f0c83b0586507 to your computer and use it in GitHub Desktop.
factorio mod sample
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
mod_moving_state = {direction = nil, tick = 0} | |
commands.add_command("keep_going", nil, function(command) | |
mod_moving_state = {direction = defines.direction.north, tick = 30} | |
end) | |
script.on_event(defines.events.on_tick, | |
function(event) | |
if mod_moving_state.tick > 0 then | |
game.get_player(1).walking_state = {walking = true, direction = mod_moving_state.direction } | |
mod_moving_state = { direction = mod_moving_state.direction, tick = mod_moving_state.tick - 1 } | |
end | |
end | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment