Introduction
Hey everyone. This is my first community post here on the DevForum.
I’m excited to showcase my hitbox module called Muchacho Hitbox – a lightweight, easy-to-use hitbox system built using SpatialQuery and OverlapParams.
Originally, I showcased this on my YouTube channel Sushimaster, but I didn’t have a DevForum account at the time. Now I do, and I’d love to share it with you all.
What is MuchachoHitbox?
Muchacho Hitbox is a hitbox module that supports both box-shaped and sphere-shaped hitboxes using Roblox’s SpatialQuery system.
It’s perfect for:
- Melee attacks
- AoE abilities
- Skill shots
- Any gameplay that doesn’t need per-frame accuracy
How to use
To use the MuchachoHitbox module, you first need to require it in your script.
-- To use the MuchachoHitbox module, you first need to require it in your script.
local module = require(game.ServerStorage.MuchachoHitbox)
-- You can create a hitbox using the CreateHitbox function.
local hitbox = module.CreateHitbox()
hitbox.Size = Vector3.new(10, 10, 10)
-- Set the CFrame to wherever you want.
hitbox.CFrame = CFrame.new(0,0,0)
-- You can use .Touched as an event listener for hitbox hits.
hitbox.Touched:Connect(function(hit, humanoid)
print(hit)
humanoid:TakeDamage(10)
end)
-- You can start the hitbox using :Start and stop the hitbox using :Stop.
hitbox:Start()
task.wait(1)
hitbox:Stop()
And yes you can make the hitbox follow an instance by setting the CFrame property to an instance.
hitbox.CFrame = workspace.Part
Documentation
Youtube Video
Here’s a quick showcase of the current version of MuchachoHitbox:
I’d love any feedback or suggestions you might have! Let me know if you run into any bugs or have ideas for improvements.