1 minetest
.after(0, function()
3 minetest
.after(2,minetest
.chat_send_all
,"#Better HUD: Please update your version of 3darmor")
8 function hud
.get_armor(player
)
9 if not player
or not armor
.def
then
12 local name
= player
:get_player_name()
13 local def
= armor
.def
[name
] or nil
14 if def
and def
.state
and def
.count
then
15 hud
.set_armor(name
, def
.state
, def
.count
)
19 function hud
.set_armor(player_name
, ges_state
, items
)
24 local max = max_items
* 65535
25 local lvl
= max - ges_state
27 if ges_state
== 0 and items
== 0 then
31 hud
.armor
[player_name
] = lvl
* (items
* (20 / max_items
))