HitboxClass | v1.1B | A Powerful OOP-based Hitbox Module

I’m not that familiar with the VSCode + Rojo stack so I’m not entirely sure how Wally works, I will once I figure it out.

I have one more question about this module: will hitbox alternatives be added in the future, such as Shapecasting or Raycasting, by chance?

Hello im new to this module script but when i use HitSomeone its doesnt do anything but if i use HitObject Instead its work fine . Here the code :

local ModuleScript = game:GetService("ReplicatedStorage")["Module Script"]
local HitboxClass = require(ModuleScript.HitboxClass)
local HitboxTypes = require(ModuleScript.HitboxClass.Types)

local HitPart = script.Parent

local hitboxParams = {
    SizeOrPart = HitPart.Size,
    DebounceTime = 1,
    Debug = true,
    InitialPosition = HitPart.CFrame,
    -- Optionally, you can add Blacklist here
    Blacklist = {},
} :: HitboxTypes.HitboxParams

local newHitbox = HitboxClass.new(hitboxParams)

newHitbox.HitSomeone:Connect(function(hitChars)
   print(hitChars)
end)

newHitbox:Start()

No, probably not. There are other modules that are good at those already.

Make sure the character you’re trying to hit is in the Alive folder set in the settings. Object mode checks everything except the Projectiles folder, while Humanoid mode, the default, only checks in the Alive folder.

I did add players character to alive folder when players join but it still not working

same here! i’ve found out that my game has been getting memory leaks, just to found out that the part object is removed with the :Remove() function which actually makes it float somewhere without a parent while staying in the memory, i switched that to :Destroy(), the performance got a lil better but i’ll probably have to clear the array…

Are you spawning scripts to do hitboxes and then deleting the scripts themselves?

The part should be getting destroyed when the Hitbox is destroyed as well. I use Remove just to parent the part to nil out of habit for later usage.

image

Hello! I’m trying to learn how to use HitboxClass, and I’m running into an issue with the Debug property. My hitbox doesn’t show up at all even when Debug is set to true.

-- A ModuleScript required client-side
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local WCS = require(ReplicatedStorage.CombatFramework.wcs)
local HitboxClass = require(ReplicatedStorage.HitboxClass)
local HitboxTypes = require(ReplicatedStorage.HitboxClass.Types)

local KickboxingPunch = WCS.RegisterSkill("KickboxingPunch")

function KickboxingPunch:OnStartServer(player : Player)
	
	local characterModel = player.Character
	local humanoidRootPart : BasePart = characterModel:WaitForChild("HumanoidRootPart")
	
	local hitboxParams = {
		SizeOrPart = ReplicatedStorage:WaitForChild("KickboxingHitbox"), 
		DebounceTime = 1,
		Debug = true,
		Blacklist = {characterModel}
	} :: HitboxTypes.HitboxParams
	
	print("Hi, attack just started!")
	
	local newHitbox, connected = HitboxClass.new(hitboxParams)
	
	newHitbox:WeldTo(humanoidRootPart, CFrame.new(humanoidRootPart.CFrame.LookVector * 2.5))
	
	newHitbox.HitSomeone:Connect(function(hitModels)
		print(hitModels)
	end)
	
	newHitbox:Start()
end

return KickboxingPunch

Hiya, I’m trying to properly understand this but I’m not entirely sure.

From what I see, client side hitbox is still called for the server, doesn’t this mean that the delay will exist nonetheless for higher ping players.

I’m not understanding if HitboxClass.new() can be run on client.

What does the KickboxingHitbox look like? If you recreate it with a Vector3 or a number does it still not show it?

The delay will always exist for higher-ping players, there’s no avoiding that. Best you can do is connect to the client-sided hitbox’s signals to apply VFX and sounds for a more responsive experience.

It can be ran on the client as long as it’s been required at least once on the server.

My hitbox doesnt follow a projectile i made that using bodyvelocity to fling. It hits the ground before the projectile does. It’s basically a grenade

Make sure you use the :Weld() method to weld it to the projectile, and make sure you’re welding it to a part of the projectile that is constantly on it, like the body of a missle.

Just tried Vector3 and number and it still doesn’t show. However, when I connect to its hitSomeone signal, it still prints out whatever it’s hit. KickboxingHitbox is just a cube-shaped hitbox.