Files
factorio-scenario-ExpCluster/modules/commands/speed.lua
PHIDIAS 779adff212 Make commands display in game chat (#297)
* Update friendly-fire.lua

* Update research.lua

* Update friendly-fire.lua

* Update speed.lua

* Update cheat-mode.lua

* Update bot-queue.lua

* Update train.lua

* Update pollution.lua

* Update commands.cfg

* Update commands.cfg

* Update commands.cfg

* Update cheat-mode.lua

* Update research.lua

* Update commands.cfg

* Update commands.cfg

* Update commands.cfg
2024-06-05 19:33:56 +01:00

17 lines
555 B
Lua

--[[-- Commands Module - Set game speed
- Adds a command that allows changing game speed
@commands Set game speed
]]
local Commands = require 'expcore.commands' --- @dep expcore.commands
require 'config.expcore.command_general_parse'
Commands.new_command('game-speed', 'Set game speed')
:add_param('amount', 'number-range', 0.2, 1)
:set_flag('admin_only')
:register(function(player, amount)
game.speed = math.round(amount, 3)
game.print{'expcom-speed.result', player.name, string.format('%.3f', amount)}
return Commands.success
end)