diff options
author | Gabriel Pérez-Cerezo <gabriel@gpcf.eu> | 2020-10-10 23:35:17 +0200 |
---|---|---|
committer | Gabriel Pérez-Cerezo <gabriel@gpcf.eu> | 2020-10-10 23:35:17 +0200 |
commit | 51fd69402daad7eb6761e5cc22170e9a762e99c1 (patch) | |
tree | 7290278630faad5e3e4d67deb5d0bb6e70884d0a /atm/interest.lua | |
parent | a692af48d467bfd3ba9638ab74540a823f73a506 (diff) | |
parent | 8d6e05f2ec00354875858e20b152f630f5935466 (diff) | |
download | forks-modpack-51fd69402daad7eb6761e5cc22170e9a762e99c1.tar.gz forks-modpack-51fd69402daad7eb6761e5cc22170e9a762e99c1.tar.bz2 forks-modpack-51fd69402daad7eb6761e5cc22170e9a762e99c1.zip |
Merge commit '8d6e05f2ec00354875858e20b152f630f5935466' as 'atm'
Diffstat (limited to 'atm/interest.lua')
-rw-r--r-- | atm/interest.lua | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/atm/interest.lua b/atm/interest.lua new file mode 100644 index 0000000..e492566 --- /dev/null +++ b/atm/interest.lua @@ -0,0 +1,16 @@ +-- adapted from the income.lua file from the currency mod. +local timer = 0 +minetest.register_globalstep(function(dtime) + timer = timer + dtime; + if timer >= 1000 then + timer = 0 + atm.readaccounts() + for _,player in ipairs(minetest.get_connected_players()) do + local name = player:get_player_name() + if not (atm.balance[name] == nil) then + atm.balance[name] = math.floor(atm.balance[name] + 5) + end + end + atm.saveaccounts() + end +end) |