Hitbox
Object-oriented hitboxes on GetPartsInPart, with welding, timed scans and humanoid filtering.
Hitbox creates an invisible part (or converts one of yours) and scans it with Workspace:GetPartsInPart on demand, on a timer, or on any signal. It can weld to a moving part, filter hits with a predicate, report parts or the humanoids they belong to, and cleans itself up with a Trove. It is built for melee, projectiles and area effects.
Use it when
- You need a hitbox that follows a sword, a fist or a vehicle for a fixed duration.
- You want the humanoids inside a volume, deduplicated, every frame or every n seconds.
Install
Studio Wally
Using the Studio Wally plugin:
- Open the widget.
- Search
kashtheking/hitbox. - Press download and choose Shared module (recommended for almost every package).
Wally
Add this to the [dependencies] section of your wally.toml, then run wally install:
Hitbox = "kashtheking/hitbox@1.0.3"
local Hitbox = require(ReplicatedStorage.Packages.Hitbox)
Dependencies
Wally installs these automatically:
Credits
Trove and Timer are by sleitnick (RbxUtil).
API
Every constructor, method, property and type is documented on the Hitbox API page, generated from the doc comments in init.luau. Each entry links to its line in the source.
Help
Questions and bug reports: the Discord or a GitHub issue. See Help & contact for everything else.