Add /armor command.
This commit is contained in:
parent
50ce118087
commit
3d57691431
2 changed files with 20 additions and 0 deletions
19
chat.lua
Normal file
19
chat.lua
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
minetest.register_chatcommand("armor", {
|
||||||
|
params = "",
|
||||||
|
description = "Display your armor values",
|
||||||
|
privs = {},
|
||||||
|
func = function(name, param)
|
||||||
|
local player = minetest.get_player_by_name(name)
|
||||||
|
local armor = player:get_armor_groups()
|
||||||
|
if armor then
|
||||||
|
minetest.chat_send_player(name, "Armor:")
|
||||||
|
for group, value in pairs(armor) do
|
||||||
|
minetest.chat_send_player(name, " "..group.." "..value)
|
||||||
|
end
|
||||||
|
if fun_caves.armor_expire and fun_caves.armor_expire[name] then
|
||||||
|
local min = math.floor((fun_caves.armor_expire[name] - minetest.get_us_time()) / 60000000)
|
||||||
|
minetest.chat_send_player(name, "Your elixir will expire in "..min..' minutes.')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
1
init.lua
1
init.lua
|
@ -71,6 +71,7 @@ dofile(fun_caves.path .. "/fungal_tree.lua")
|
||||||
dofile(fun_caves.path .. "/armor.lua")
|
dofile(fun_caves.path .. "/armor.lua")
|
||||||
dofile(fun_caves.path .. "/wallhammer.lua")
|
dofile(fun_caves.path .. "/wallhammer.lua")
|
||||||
dofile(fun_caves.path .. "/mapgen.lua")
|
dofile(fun_caves.path .. "/mapgen.lua")
|
||||||
|
dofile(fun_caves.path .. "/chat.lua")
|
||||||
|
|
||||||
if mobs and mobs.mod == "redo" then
|
if mobs and mobs.mod == "redo" then
|
||||||
dofile(fun_caves.path .. "/mobs.lua")
|
dofile(fun_caves.path .. "/mobs.lua")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue