Add little player damage
parent
ca1ec9fcdf
commit
25325f579c
|
@ -45,5 +45,14 @@ minetest.register_on_protection_violation(function(pos, name)
|
||||||
("%s is protected by %s."):format(
|
("%s is protected by %s."):format(
|
||||||
minetest.pos_to_string(pos),
|
minetest.pos_to_string(pos),
|
||||||
table.concat(owners, ", ")))
|
table.concat(owners, ", ")))
|
||||||
|
|
||||||
|
-- Little damage player
|
||||||
|
local player = minetest.get_player_by_name(name)
|
||||||
|
if player and player:is_player() then
|
||||||
|
local hp = player:get_hp()
|
||||||
|
if hp and hp > 1 then
|
||||||
|
player:set_hp(hp - 1)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
Loading…
Reference in New Issue