Add only_players
This commit is contained in:
parent
6da28cf391
commit
65d21ae49c
5
init.lua
5
init.lua
@ -6,7 +6,7 @@ minetest.register_globalstep(function(dtime)
|
|||||||
etime = etime + dtime
|
etime = etime + dtime
|
||||||
local control = player:get_control()
|
local control = player:get_control()
|
||||||
if minetest.settings:get_bool("killaura") or minetest.settings:get_bool("forcefield") and control.dig then
|
if minetest.settings:get_bool("killaura") or minetest.settings:get_bool("forcefield") and control.dig then
|
||||||
local interval_str = minetest.settings:get("killaura_interval") or "0"
|
local interval_str = minetest.settings:get("killaura_interval") or "auto"
|
||||||
local interval
|
local interval
|
||||||
if interval_str == "auto" then
|
if interval_str == "auto" then
|
||||||
interval = player:get_wielded_item():get_tool_capabilities().full_punch_interval
|
interval = player:get_wielded_item():get_tool_capabilities().full_punch_interval
|
||||||
@ -18,9 +18,10 @@ minetest.register_globalstep(function(dtime)
|
|||||||
end
|
end
|
||||||
local punched_anything = false
|
local punched_anything = false
|
||||||
local friendlist = (minetest.settings:get("friendlist") or ""):split(",")
|
local friendlist = (minetest.settings:get("friendlist") or ""):split(",")
|
||||||
|
local only_players = minetest.settings:get_bool("killaura_only_players")
|
||||||
for _, obj in ipairs(minetest.get_objects_inside_radius(player:get_pos(), 5)) do
|
for _, obj in ipairs(minetest.get_objects_inside_radius(player:get_pos(), 5)) do
|
||||||
local do_attack = true
|
local do_attack = true
|
||||||
if obj:is_local_player() then
|
if obj:is_local_player() or only_players and not obj:is_player() then
|
||||||
do_attack = false
|
do_attack = false
|
||||||
else
|
else
|
||||||
for _, friend in ipairs(friendlist) do
|
for _, friend in ipairs(friendlist) do
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
killaura (Killaura) bool false
|
killaura (Killaura) bool false
|
||||||
forcefield (ForceField) bool false
|
forcefield (ForceField) bool false
|
||||||
friendlist (Friend List) string
|
friendlist (Friend List) string
|
||||||
|
killaura_interval (Killaura Interval) string "auto"
|
||||||
|
killaura_only_players (Only Killaura Players) bool false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user