diff --git a/nopvp.lua b/nopvp.lua index e700d0b..ff6135a 100644 --- a/nopvp.lua +++ b/nopvp.lua @@ -9,12 +9,17 @@ minetest.register_on_punchplayer(function(player, hitter, time_from_last_punch, end local player_name = player:get_player_name() - if minetest.check_player_privs(player_name, {pvp=false}) then + local hitter_player_name = hitter:get_player_name() + + if minetest.check_player_privs(hitter_player_name, {kick=true}) then + return false + end + + if not minetest.check_player_privs(player_name, {pvp=true}) then return true end - local hitter_player_name = hitter:get_player_name() - if minetest.check_player_privs(hitter_player_name, {pvp=false}) then + if not minetest.check_player_privs(hitter_player_name, {pvp=true}) then return true end