
Key RequiredUniversal

-- Kaden's Hitbox Expander (Console Edition)
-- Version 2.2.0 - Status Panel with Toggle Key Hints
--[[
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
CORE REQUIREMENTS MET:
• Zero GUI / Drawing API / Visual Elements (unless G pressed in debug mode)
• Console Output Only
• Hotkey Controlled ([, ], P, K, L, B, N, U, Y, G)
• Invisible Hitboxes by default (Transparency = 1, CanCollide = false)
• Max 15 FPS Update Loop
• Lightweight Player Scanning
• Automatic Character Management
• Emergency Cleanup on Exit
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
]]
-- Services
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
-- Local References
local LocalPlayer = Players.LocalPlayer
local Workspace = workspace
-- Configuration (Matches DEFAULT SETTINGS + new toggles)
local Config = {
Enabled = true,
HitboxSize = 12,
Transparency = 1,
CanCollide = false,
RefreshRate = 15,
MaxDistance = math.huge,
IgnoreTeam = true,
IgnoreDead = true,
IgnoreForceField = true,
IgnoreSpawnProtection = true,
DebugMode = false,
VisualizeHitboxes = false -- Only active when DebugMode=true
}
-- State Tracking
local OriginalHitboxes = {} -- { hrp -> original size }
local CharacterCache = {} -- { player -> character }
local LastUpdate = 0
local UpdateInterval = 1 / Config.RefreshRate
-- Utility: Print to console with prefix
local function Log(msg)
print("[Hitbox Expander] " .. msg)
end
-- Utility: Get distance to target
local function GetDistance(targetHrp)
if not LocalPlayer.Character or not LocalPlayer.Character:FindFirstChild("HumanoidRootPart") then
return math.huge
end
return (LocalPlayer.Character.HumanoidRootPart.Position - targetHrp.Position).Magnitude
end
-- Utility: Check if player should be targeted
local function ShouldTarget(player, character)
if player == LocalPlayer then return false end
if not character or not character.Parent then return false end
local hrp = character:FindFirstChild("HumanoidRootPart")
if not hrp then return false end
-- Team check
if Config.IgnoreTeam and LocalPlayer.Team and player.Team and LocalPlayer.Team == player.Team then
return false
end
-- Dead check
if Config.IgnoreDead then
local humanoid = character:FindFirstChildOfClass("Humanoid")
if not humanoid or humanoid.Health <= 0 then return false end
end
-- ForceField check
if Config.IgnoreForceField and character:FindFirstChildOfClass("ForceField") then
return false
end
-- Spawn protection (3-second window)
if Config.IgnoreSpawnProtection then
local cache = CharacterCache[player]
if cache and cache.SpawnTime and (tick() - cache.SpawnTime) < 3 then
return false
end
end
-- Distance check
if GetDistance(hrp) > Config.MaxDistance then
return false
end
return true
end
-- Store original hitbox properties
local function StoreOriginal(hrp)
if not OriginalHitboxes[hrp] then
OriginalHitboxes[hrp] = {
Size = hrp.Size,
Transparency = hrp.Transparency,
CanCollide = hrp.CanCollide
}
end
end
-- Restore original hitbox
local function RestoreHitbox(hrp)
if OriginalHitboxes[hrp] then
pcall(function()
hrp.Size = OriginalHitboxes[hrp].Size
hrp.Transparency = OriginalHitboxes[hrp].Transparency
hrp.CanCollide = OriginalHitboxes[hrp].CanCollide
end)
OriginalHitboxes[hrp] = nil
end
end
-- Apply hitbox expansion
local function ApplyHitbox(hrp)
StoreOriginal(hrp)
pcall(function()
hrp.Size = Vector3.new(Config.HitboxSize, Config.HitboxSize, Config.HitboxSize)
hrp.CanCollide = Config.CanCollide
-- Visualization only in debug mode
if Config.DebugMode and Config.VisualizeHitboxes then
hrp.Transparency = 0.7
else
hrp.Transparency = Config.Transparency
end
end)
end
-- Restore ALL hitboxes (emergency cleanup)
local function RestoreAll()
for hrp in pairs(OriginalHitboxes) do
RestoreHitbox(hrp)
end
end
-- Process all valid players
local function ProcessPlayers()
local targets = 0
for _, player in ipairs(Players:GetPlayers()) do
local character = CharacterCache[player] and CharacterCache[player].Character
if character and ShouldTarget(player, character) then
local hrp = character:FindFirstChild("HumanoidRootPart")
if hrp then
ApplyHitbox(hrp)
targets += 1
end
else
-- Clean up invalid entries
local hrp = character and character:FindFirstChild("HumanoidRootPart")
if hrp and OriginalHitboxes[hrp] then
RestoreHitbox(hrp)
end
end
end
return targets
end
-- Main update loop (capped at 15 FPS)
local function Update()
if not Config.Enabled then return end
local now = tick()
if now - LastUpdate < UpdateInterval then return end
LastUpdate = now
ProcessPlayers()
end
-- Handle new characters
local function OnCharacterAdded(player, character)
CharacterCache[player] = {
Character = character,
SpawnTime = tick()
}
character:WaitForChild("HumanoidRootPart", 5)
end
-- Handle player removal
local function OnPlayerRemoving(player)
local data = CharacterCache[player]
if data and data.Character then
local hrp = data.Character:FindFirstChild("HumanoidRootPart")
if hrp then
RestoreHitbox(hrp)
end
end
CharacterCache[player] = nil
end
-- Setup player listeners
local function InitPlayers()
for _, player in ipairs(Players:GetPlayers()) do
if player.Character then
OnCharacterAdded(player, player.Character)
end
player.CharacterAdded:Connect(function(char) OnCharacterAdded(player, char) end)
end
Players.PlayerRemoving:Connect(OnPlayerRemoving)
end
-- Hotkey handler
local function OnInput(input, gameProcessed)
if gameProcessed then return end
local key = input.KeyCode
local changed = false
if key == Enum.KeyCode.LeftBracket then
Config.HitboxSize = math.clamp(Config.HitboxSize + 1, 1, 100)
Log("Size Increased: " .. Config.HitboxSize)
changed = true
elseif key == Enum.KeyCode.RightBracket then
Config.HitboxSize = math.clamp(Config.HitboxSize - 1, 1, 100)
Log("Size Decreased: " .. Config.HitboxSize)
changed = true
elseif key == Enum.KeyCode.L then
Config.DebugMode = not Config.DebugMode
Log("Debug Mode: " .. (Config.DebugMode and "Enabled" or "Disabled"))
if Config.Enabled then changed = true end
elseif key == Enum.KeyCode.N then
RestoreAll()
Log("Emergency Restore Completed")
elseif key == Enum.KeyCode.U then
Config.IgnoreTeam = not Config.IgnoreTeam
Log("Ignore Teammates: " .. tostring(Config.IgnoreTeam))
elseif key == Enum.KeyCode.Y then
Config.IgnoreDead = not Config.IgnoreDead
Log("Ignore Dead Players: " .. tostring(Config.IgnoreDead))
elseif key == Enum.KeyCode.G then
if Config.DebugMode then
Config.VisualizeHitboxes = not Config.VisualizeHitboxes
Log("Hitbox Visualization: " .. (Config.VisualizeHitboxes and "Enabled" or "Disabled"))
if Config.Enabled then changed = true end
else
Log("Visualization requires Debug Mode (press L first)")
end
elseif key == Enum.KeyCode.K then
Config.Enabled = not Config.Enabled
Log(Config.Enabled and "Enabled" or "Disabled")
if not Config.Enabled then RestoreAll() end
elseif key == Enum.KeyCode.P then
-- Re-sync all character states
RestoreAll()
CharacterCache = {}
InitPlayers()
Log("Re-synced All Character States")
Log("Current Size: " .. Config.HitboxSize)
elseif key == Enum.KeyCode.B then
local totalPlayers = #Players:GetPlayers()
local targets = ProcessPlayers() -- Force refresh count
Log("━━━━━━━━━━━━━━━━━━━━")
Log("Hitbox Expander Status")
Log("━━━━━━━━━━━━━━━━━━━━")
Log("Enabled: " .. tostring(Config.Enabled) .. " [K]")
Log("Hitbox Size: " .. Config.HitboxSize .. " [[ / ]]")
Log("Refresh Rate: " .. Config.RefreshRate)
Log("Targets Found: " .. targets)
Log("Total Players: " .. totalPlayers)
Log("Optimization Mode: Enabled")
Log("Debug Mode: " .. tostring(Config.DebugMode) .. " [L]")
Log("Visualize Hitboxes: " .. tostring(Config.VisualizeHitboxes and Config.DebugMode) .. " [G]")
Log("Ignore Teammates: " .. tostring(Config.IgnoreTeam) .. " [U]")
Log("Ignore Dead: " .. tostring(Config.IgnoreDead) .. " [Y]")
Log("━━━━━━━━━━━━━━━━━━━━")
end
if changed and Config.Enabled then
RestoreAll() -- Reapply with new settings
end
end
-- Cleanup on script end
local function Cleanup()
RestoreAll()
CharacterCache = {}
OriginalHitboxes = {}
end
-- Initialize
InitPlayers()
UserInputService.InputBegan:Connect(OnInput)
RunService.Heartbeat:Connect(Update)
-- Finalize setup
Log("Loaded Successfully")
Log("Current Size: " .. Config.HitboxSize)
Log("FPS Limit: " .. Config.RefreshRate)
-- Emergency cleanup hook
game:BindToClose(Cleanup)No comments yet for this script.



