Anti-Stick Bug / Other Avatar Types with Busted Hitboxes System

If you own, play, etc. any sort of combat game, especially one that relies heavily on character hitboxes, you know how annoying it is when people abuse the busted hitboxes that some avatar/body types have.

I’ve been trying to solve this problem myself recently on 2 Player Military Tycoon, and I was not able to find much from my research, besides people telling me to make the game R6 instead of R15, or forcing the blocky avatar on all players, regardless of their body type - punishing 95% of players just to stop 5% of the ones using these busted hitbox characters.

With this below script, you’ll be able to filter out Stick Bug characters, as well as other ones that have similar hitbox issues!

This system might not stop alll avatar types with busted hitboxes, but it will definitely stop the most egregious ones, while letting the “normal” ones pass through.

local plrs = game:GetService("Players")
local maxBustedParts = 7 --- change this to whatever. currently set that if roughly half the character uses unwanted body types, it triggers filter 

local function plrAdded(player:Player)
    
    local function charAdded(char:Model)
        local hum = char:FindFirstChildOfClass("Humanoid")
        ---check for blacklisted items
        local numBlackListed = 0
        local headBlackListed = false
        for _,i in pairs(char:GetChildren()) do
            if i:IsA("BasePart") then
                ---print(tostring(i).." Magnitude: "..i.Size.Magnitude) --- test/debug purposes
                if i.Size.Magnitude < 1 then
                    if i.Name == "Head" then
                        headBlackListed = true --- probably useless functionality but whatever
                    end
                    numBlackListed += 1
                end
            end
        end
        local function fixHum(all:boolean)
            local success, result = pcall(plrs.GetHumanoidDescriptionFromUserId, plrs, player.UserId)
            if success then
                if result then
                    result.Head = 0
                    if all then
                        ---result.BodyTypeScale = 0 
                        --- uncomment the above line if you want to use absolute classic scale
                        result.Head = 0
                        result.LeftArm = 0
                        result.LeftLeg = 0
                        result.RightArm = 0
                        result.RightLeg = 0
                        result.Torso = 0
                    end
                    hum:ApplyDescription(result)
                end
            else
                warn(result)
            end
        end
        if hum then
            if numBlackListed >= maxBustedParts then
                warn(tostring(player).." has blacklisted body type(s)...")
                fixHum(true)
            elseif headBlackListed then
                warn(tostring(player).." has blacklisted head...")
                fixHum()
            end
        end
        ---end check
    end
    
    player.CharacterAdded:Connect(charAdded)
    
    if player.Character then
        charAdded(player.Character)
    end
end

plrs.PlayerAdded:Connect(plrAdded)

for _,i in pairs(plrs:GetPlayers()) do
    plrAdded(i)
end

Let me know what you think, and if this has been any use!

5 Likes

One thing to note, when checking for the “magnitude” of the size of characters, this might cause issue where you allow players to have whatever scale of their avatar that you want. For all of my R15 games, I use the “Classic Scale,” but if you don’t, you may have to change the 1 in if i.Size.Magnitude < 1 then line to a smaller number less than 1.

3 Likes

So, a friend of mine came up with a script that does the similar thing, except it checks the whole size of the character and not just individual parts.

Here is is:

--- pass the character model into this function
local function getCharacterHitboxSize(character)
    local modelSize = character:GetExtentsSize()

    local width = modelSize.X
    local height = modelSize.Y
    local depth = modelSize.Z

    local minHeightThreshold = 4.5
    local minWidthThreshold = 3

    local isTooThin = width < minWidthThreshold
    local isTooShort = height < minHeightThreshold

    return {
        width = width,
        height = height,
        depth = depth,
        isTooThin = isTooThin,
        isTooShort = isTooShort,
    }
end

Works pretty good. However, some things my script will filter, won’t get filtered by this, and vice versa. A good idea would be to have both these scripts working together; it would result in slightly more body types, like the one picture below, getting filtered that shouldn’t, but it would definitely catch more body types that you want to filter.

2 Likes

why not just add one hitbox block to the root part / body parts and go from that? I know some games that do this.

1 Like

I have armor models in my game that are designed specifically to protect specific parts of the body (e.g. plate carrier deflecting shots from the torso). A catch-all hitbox would ruin that.

1 Like