MaxHitbox V1.1, The Newest OOP Hitbox System That Is a Combination of HitboxClass and MuchachoHitbox

MaxHitbox

A handy tool for recognizing hits

This is my first ever hitbox system that I believe could come in handy in terms of Fighting Games, Weapons, etc. This module may have a feature that you’ve been waiting for a while. Nonetheless, let’s get into the features of this module.

You can download the module here:
MaxHitbox - Creator Store

So first let’s set up an example hitbox:

local MaxHitbox = require(path.to.module)

local newHitbox = {
    Mode = "Default", -- There are three modes: Default, ConstantDetection, DestroyOnHit,
    Shape = "Box", -- You can change the shape of the hitbox. Options are: Sphere, Box
    TouchMode = "Humanoid", -- There are three touch modes: Humanoid, Object and Both
    Size = Vector3.new(0,0,0) or number, -- This will be the size of the hitbox, Vector3 if the Shape is a Box, a number if the Shape is Sphere
    CFrame = CFrame.new(0,0,0), -- This is the position (CFrame) of the hitbox,
    Debris = 3, -- The time the hitbox has before being destroyed
    Blacklist = {}, -- Items in the table will be ignored by the hitbox
    Visualizer = false, -- This either enables or disables a hitbox visualizer
}

newHitbox:Start()

Then you want to make a function where the hitbox touches something:

Humanoid


newHitbox.HumanoidTouched:Connect(function(character, humanoid)
----Character represents the model with a humanoid
----Humanoid represents the Character's Humanoid
end)

Object


newHitbox.Touched:Connect(function(object)
---object is the Object that's touched
end)

Both


newHitbox.HumanoidTouched:Connect(function(character, humanoid)
----Character represents the model with a humanoid
----Humanoid represents the Character's Humanoid
end)

newHitbox.Touched:Connect(function(obj)
---object is the Object that's touched
end)

This example shows how to set up a basic hitbox using this module. Whether it’s object or humanoid detection, or both, it can be done.

Now we are going to go in-depth on how the three modes of the hitbox module. As said before, the three modes are: Default, ConstantDetection, DestroyOnHit.

Default


  • This mode will hit the object or humanoid once until the hitbox is destroyed. This can be used for punches or sword slashes

ConstantDetection


  • This mode constantly detects an object or humanoid. Also is can be used with DebounceTime to delay the hits every amount of that time.

DestroyOnHit


  • This mode will make the hitbox disappear when it’s touched. It’s as simplr as that

All of these modes can be used for different purposes. These can even be used for projectiles using the newHitbox:WeldTo().

This is the other documentation of the module:

newHitbox:Start(HitParams : {})


  • This starts the hitbox with the table of information given inside of the parameter table.

newHitbox:WeldTo(Part : Part, CFrame : CFrame)


  • This function allows you to weld a hitbox to a part’s CFrame. You don’t have to include the CFrame parameter if you don’t want an offset of the weld CFrame.

newHitbox:Stop()


  • This function destroys the hitbox and its connections, including the visualization.

That’s all for now! It is a bit barebones, since I rushed this. Enjoy the module!! Demonstrations will come out a bit later!

7 Likes

Can’t wait to find out what the next step is!
Chat, we finally got the full resource! I don’t have much to say about hitboxes, I’ll use my own.

8 Likes

Maybe we’ll get it in 30 more minutes!

2 Likes

10 part novel over the next decade lads. I’m excited for this ride

bro got swatted as he was typing the post

1 Like

the feds got to him in the middle of making his post

I must say it is a very easy guide

uh huh… what the hell happened here

1 Like

Lol. I accidentally published the forum when it wasn’t finished. My bad.

1 Like

After All, This is my second time uploading to the devforum.

Thanks For looking at least :slight_smile:

1 Like

Demonstrations will come out today

1 Like

I might have to recode the module because there is a strange glitch

2 Likes

New version is coming soon!!! V1.1

MaxHitbox V1.1

  • Hitbox can now detect multiple things (it had a bug)

  • Sphere Hitboxes have now been added

  • InRadius Has Been Added

  • Constant Detection has been fixed