This commit is contained in:
2024-06-18 20:32:25 +09:00
parent 71d5d4813b
commit 49710a0482
3 changed files with 259 additions and 0 deletions

View File

@@ -1,3 +1,6 @@
local items = require 'config'
local main = require 'main'
local function clock_display(sec)
local s = math.floor(sec) % 60
local m = math.floor(sec / 60) % 60
@@ -21,3 +24,35 @@ if settings.startup['PHI-XC'].value then
end
end)
end
if settings.startup['PHI-PB'].value then
commands.add_command('bonus', nil, function(command)
local player
if command.player_index then
player = game.get_player(command.player_index)
else
game.print('Command Error')
return
end
if type(command.parameter) ~= 'number' then
player.print('Parameter need to be number')
return
end
local bonus = tonumber(command.parameter)
if (bonus < 0) or (bonus > 10) then
player.print('Parameter need to be in range of 0 - 10')
return
end
for _, v in pairs(items['bonus']['player_bonus']) do
if v.enabled then
game.players[command.player_index][v.name] = game.players[command.player_index][v.name] + (bonus / 10)
end
end
end)
end