autoaim: add basic autoaim
This commit is contained in:
parent
e2a4b41334
commit
46bd009798
18
clientmods/autoaim/init.lua
Normal file
18
clientmods/autoaim/init.lua
Normal file
@ -0,0 +1,18 @@
|
||||
local function look_nearest()
|
||||
for k, v in ipairs(minetest.localplayer.get_nearby_objects(10)) do
|
||||
if (v:is_player() and v:get_name() ~= minetest.localplayer:get_name()) then
|
||||
local pos = v:get_pos()
|
||||
pos.y = pos.y - 1
|
||||
autofly.aim(pos)
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_globalstep(function()
|
||||
if minetest.settings:get_bool("autoaim") then
|
||||
look_nearest()
|
||||
end
|
||||
end)
|
||||
|
||||
minetest.register_cheat("Autoaim", "Combat", "autoaim")
|
@ -28,3 +28,4 @@ load_mod_quotebot = true
|
||||
load_mod_autosneak = true
|
||||
load_mod_list = true
|
||||
load_mod_supernotes = true
|
||||
load_mod_autoaim = true
|
||||
|
Loading…
x
Reference in New Issue
Block a user