UPADATE V5.0.0
Removed Setup Requirements
- No more
HitboxSettingsfolder in ReplicatedStorage - No more
Alive Folderto manually parent characters into - No more
Ignore Folderconfiguration - No more
NumberValuefor velocity constant
New Simplified API
Factory methods for common use cases:
-- Sphere hitbox
local hit = Hitbox.sphere(10, CFrame.new(0, 5, 0))
-- Box hitbox
local hit = Hitbox.box(Vector3.new(10, 5, 10), CFrame.new(0, 5, 0))
-- From existing part
local hit = Hitbox.fromPart(workspace.MyHitboxPart)
Full constructor with sensible defaults:
local hit = Hitbox.new({
Size = Vector3.new(10, 10, 10), -- Only required field
CFrame = CFrame.new(0, 5, 0), -- Optional, defaults to origin
DebounceTime = 0.5, -- Optional
Lifetime = 5, -- Auto-destroy after 5 seconds
Debug = true, -- Show visualization
AutoStart = true, -- Start immediately
Tag = "Enemy", -- Optional CollectionService tag filter
})
Legacy Support
The old parameter names (SizeOrPart, InitialCframe, LifeTime) are still supported for backwards compatibility but are deprecated.
Technical Improvements
- Removed Timer dependency - Uses
task.delayinstead of polling Timer - Auto-detects characters - Scans workspace for Humanoids automatically
- Optional tag filtering - Use
Tagparameter to filter by CollectionService tags - Backward compatible - Still supports
SizeOrPartandInitialCframe(deprecated)