1
Fork 0
mirror of https://github.com/redstrate/Kawari.git synced 2025-06-30 11:47:45 +00:00
kawari/resources/scripts/commands/gm/SetSpeed.lua
Joshua Goins 6951f9448d Port GM commands to Lua
This removes a ton of implementation overlap between the two
command systems. For example, we had two different implementations
of unlocking aetherytes which is just unnecessary.

On the flipside, this makes implementing new GM commands just as
easy as writing debug ones. I moved the existing debug Lua
implementations into their GM counterparts and updated the USAGE
accordingly.
2025-06-28 10:27:56 -04:00

16 lines
490 B
Lua

required_rank = GM_RANK_DEBUG
command_sender = "[setspeed] "
function onCommand(args, player)
local SPEED_MAX = 10 -- Arbitrary, but it's more or less unplayable even at this amount
local speed_multiplier = args[1]
if speed_multiplier <= 0 then
speed_multiplier = 1
elseif speed_multiplier > SPEED_MAX then
speed_multiplier = SPEED_MAX
end
player:set_speed(speed_multiplier)
printf(player, "Speed multiplier set to %s.", speed_multiplier)
end