mirror of
https://github.com/a-bad-dev/simple-shooter-game.git
synced 2026-06-08 20:12:11 +00:00
Split the main mod into several smaller mods
yes, this means m o r e g l o b a l s
This commit is contained in:
parent
44c1be6a55
commit
feba0eac84
5 changed files with 268 additions and 263 deletions
14
mods/game/autoheal/init.lua
Normal file
14
mods/game/autoheal/init.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
-- Autohealing mod for SSG
|
||||
local timer = 0
|
||||
core.register_globalstep(function(dtime)
|
||||
timer = timer + dtime
|
||||
|
||||
if timer >= 10 then
|
||||
timer = 0
|
||||
for _, player in pairs(core.get_connected_players()) do
|
||||
if alive_players[player:get_player_name()] == "alive" then
|
||||
player:set_hp(math.min(player:get_hp() + 2, 20))
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
Loading…
Add table
Add a link
Reference in a new issue