diff options
author | Elias Fleckenstein <eliasfleckenstein@web.de> | 2020-11-04 12:28:00 +0100 |
---|---|---|
committer | Elias Fleckenstein <eliasfleckenstein@web.de> | 2020-11-04 12:28:00 +0100 |
commit | f1d9ac014efc6403e73223f36d3dbb7f5ed50236 (patch) | |
tree | ae9acb74c6a662a8697235f5ca1446e5e7a1e6b3 /builtin/client/cheats | |
parent | 06b72069d8d29c109b8847c9e4ff7948cd79f632 (diff) | |
download | dragonfireclient-f1d9ac014efc6403e73223f36d3dbb7f5ed50236.tar.xz |
Moved Killaura to Lua; Added ForceField; Added Friendlist; Added ClientObjectRef:is_local_player(); Documented LocalPlayer:get_object()
Diffstat (limited to 'builtin/client/cheats')
-rw-r--r-- | builtin/client/cheats/combat.lua | 22 | ||||
-rw-r--r-- | builtin/client/cheats/init.lua | 1 |
2 files changed, 22 insertions, 1 deletions
diff --git a/builtin/client/cheats/combat.lua b/builtin/client/cheats/combat.lua index 1f9ba9a91..4904d8c52 100644 --- a/builtin/client/cheats/combat.lua +++ b/builtin/client/cheats/combat.lua @@ -4,13 +4,33 @@ local used_sneak = true local totem_move_action = InventoryAction("move") totem_move_action:to("current_player", "main", 9) +core.register_list_command("friend", "Configure Friend List (friends dont get attacked by Killaura or Forcefield)", "friendlist") + core.register_globalstep(function(dtime) local player = core.localplayer if not player then return end local control = player:get_control() local pointed = core.get_pointed_thing() local item = player:get_wielded_item():get_name() - if core.settings:get_bool("crystal_pvp") then + if core.settings:get_bool("killaura") or core.settings:get_bool("forcefield") and control.LMB then + local friendlist = core.settings:get("friendlist"):split(",") + for _, obj in ipairs(core.get_objects_inside_radius(player:get_pos(), 5)) do + local do_attack = true + if obj:is_local_player() then + do_attack = false + else + for _, friend in ipairs(friendlist) do + if obj:get_name() == friend or obj:get_nametag() == friend then + do_attack = false + break + end + end + end + if do_attack then + obj:punch() + end + end + elseif core.settings:get_bool("crystal_pvp") then if placed_crystal then if core.switch_to_item("mobs_mc:totem") then switched_to_totem = 5 diff --git a/builtin/client/cheats/init.lua b/builtin/client/cheats/init.lua index 6fd78b8b8..466ce4aee 100644 --- a/builtin/client/cheats/init.lua +++ b/builtin/client/cheats/init.lua @@ -1,6 +1,7 @@ core.cheats = { ["Combat"] = { ["Killaura"] = "killaura", + ["Forcefield"] = "forcefield", ["AntiKnockback"] = "antiknockback", ["FastHit"] = "spamclick", ["AttachmentFloat"] = "float_above_parent", |