From fa5f39407ed4aec75ba99a8ae96894bd4a1a0a2d Mon Sep 17 00:00:00 2001 From: adhi <129642486+Streoids@users.noreply.github.com> Date: Wed, 26 Nov 2025 17:58:58 +0530 Subject: [PATCH 1/2] Armor blocker when enabled weaker armor gets cancelled. Useful in some situations like in hive skywars --- module/Armor blocker.lua | 79 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 module/Armor blocker.lua diff --git a/module/Armor blocker.lua b/module/Armor blocker.lua new file mode 100644 index 0000000..3b252d9 --- /dev/null +++ b/module/Armor blocker.lua @@ -0,0 +1,79 @@ +name = "Armor blocker" +description = "Blocks weaker armor if you're wearing a stronger one." +author = "Streoids" +local power = +{ + leather_helmet = 1, leather_chestplate = 1, leather_leggings = 1, leather_boots = 1, + golden_helmet = 2, golden_chestplate = 2, golden_leggings = 2, golden_boots = 2, + chainmail_helmet = 3, chainmail_chestplate = 3, chainmail_leggings = 3, chainmail_boots = 3, + iron_helmet = 4, iron_chestplate = 4, iron_leggings = 4, iron_boots = 4, + diamond_helmet = 5, diamond_chestplate = 5, diamond_leggings = 5, diamond_boots = 5, + netherite_helmet = 6, netherite_chestplate = 6, netherite_leggings = 6, netherite_boots = 6 +} +local function prefix(name) + if not name then return name + end + local s = tostring(name) + local i = s:find(":") + if i then return s:sub(i+1) + end + return s +end +local function getPower(name) + if not name then return 0 + end + return power[ prefix(name) ] or 0 +end +local function realarmor(piece) + if not piece then return false + end + local n = piece.name + if not n or n == "" or n == "empty" then return false + end + if piece.maxDurability == -1 then return false + end + return true +end +local function slotname(name) + if not name then return nil + end + local s = prefix(name) + if s:find("helmet") then return "helmet" + end + if s:find("chestplate") then return "chestplate" + end + if s:find("leggings") then return "leggings" + end + if s:find("boots") then return "boots" + end + return nil +end +function onLoad() + print("§aLoaded Armor blocker by Streoids.") +end +onEvent("MouseEvent", function(button, action) + if button ~= 2 or action ~= 1 then return + end + local hand = player.mainhand() + if not hand or not hand.name or hand.name == "" or hand.name == "empty" then + return + end + local slot = slotname(hand.name) + if not slot then + return + end + local armor = player.armor() + if not armor then + return + end + local current = armor[slot] + if not realarmor(current) then + return + end + local currentPower = getPower(current.name) + local heldPower = getPower(hand.name) + if heldPower > 0 and heldPower < currentPower then + print("§7§oArmor is weaker than what you're wearing now.") + return true + end +end) -- john pork cool. From 551046c93c6150123ee72243ebad39a717e67f64 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Wed, 26 Nov 2025 12:29:08 +0000 Subject: [PATCH 2/2] Update script indices [skip ci] --- module-index.json | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/module-index.json b/module-index.json index 2dcb1e4..deb77d2 100644 --- a/module-index.json +++ b/module-index.json @@ -8,6 +8,15 @@ "type": "module", "path": "module/AFKmessage.lua" }, + { + "filename": "Armor blocker.lua", + "name": "Armor blocker", + "description": "Blocks weaker armor if you", + "author": "Streoids", + "version": "1.0.0", + "type": "module", + "path": "module/Armor blocker.lua" + }, { "filename": "Auto Crasher.lua", "name": "Auto Crasher 5000",