Hitbox Service, easily create Accurate Hitboxes using minimal scripting!

try seeing if ur going into the part. Maybe by making it 0.5 transparency

Try create with part instead.

I’m diffidently touching the part. Sorry for the trouble.

Tried this just now. Still isn’t working. So sorry for the trouble.

ok just let us look at the game jam!1 I’ll be back after a bit.

1 Like

for some reason the .touched preset just gives me Hitbox:Start() is needed to use, and when i do it still give me the error

2 Likes

I just want to point out that both @luisgamercooI231fan and @kinglol123468 are permanently suspended from the DevForum, so it looks like Hitbox Service won’t be getting anymore updates. If you want help, you can try contacting the creator outside the DevForum though.

¯\_(ツ)_/¯

1 Like

Does this work on client sided?

i’m pretty sure it does. But you should still do it on the server because exploiters can ruin it easily.

1 Like

I trust your word for it.

I’m not sure if I’m using this in the right way but this code running on the server. Kills my Frames Per Second.

local ServerSideHandler = coroutine.wrap(function()
	
	RunService.Heartbeat:Connect(function()
		
		task.wait(0.01)
		
		for i,v in pairs(AllRunningHitBoxes) do
			
			local HitBoxParams = OverlapParams.new(v.hitboxparams)
			local HitBox = HitBoxService:CreateWithPart(v.hitboxpart, HitBoxParams)
			
			HitBox:Start()
			
			local HitRegisters = HitBox:GetItems()
			
			for i,v in pairs(HitRegisters) do
				
				if v:IsA("BasePart") then
					
					print(v)
					
				end
				
			end
			
		end
	
	end)
	
end)

ServerSideHandler()
1 Like

It’s seem like the module is updated you shoud use this instead

local RegionStats = REVsSqDrN2snr28pSsfDiS4aYpay7dbC5a - script.Parent.Size/2, script.Parent.Position + script.Parent.Size /2) -- gets the part's dimensions
local HitboxModule = require(game.ReplicatedStorage.HitboxModuleMain) -- requires the module.
local Hitbox = HitboxModule:CreateWithBox(script.Parent,RegionStats.CFrame, RegionStats.Size, OverlapParams.new()) -- makes hitbox
Hitbox.Touched:Connect(function(Object) -- this object that the hitbox touched.
print(Object)
end)
3 Likes

the module usually has lag issues when you put a .Hearbeat inside the same thread. Since the module uses .Heartbeat for inner code. I recommend you either A use @thebrickplanetboy’s method OR task.spawn a new thread in your pairs loop.

1 Like

First time using this, I used this hitbox for a projectile script and I have to say, it is very laggy, It’s my first time using this and I would like a solution of some sort. I did this:

local overlapParams = OverlapParams.new()
overlapParams.FilterDescendantsInstances = {char}
overlapParams.FilterType = Enum.RaycastFilterType.Blacklist

local newHitbox = PartHitbox:CreateWithPart(newSpin, overlapParams)
newHitbox:Start()
					
local c
c = newHitbox.Touched:Connect(function(Hit)
	if Hit.Parent:FindFirstChild("Humanoid") then
	    if Hit.Parent.Name ~= char.Name then
			local enemyHumanoid = Hit.Parent.Humanoid
			fxDMG:FireServer(input,Hit,enemyHumanoid,1)
		end
	end
	c:Disconnect()
end)

if I do Hitbox:Stop() then Hitbox.Entered:Connect(function() should stop giving error right?

are you putting the .Touched inside of a heartbeat? That usually makes it lags.

If not you can manually check the items using the :GetItems function.

I have some questions I hope you can answer

Is this faster than the new worldroot detection functions? I’m talking about :GetPartsInBoundingBox() and :GetPartsInRadious().

→ If not:
[This question is a little more specific for my game, because I’m used skinned meshes and the setup I have.]
Currently, I’m using :GetPartsInBoundingBox() and checking using a whitelist for Collection service:GetTagged(“Hitbox”). Is this still slower than your fastest method? (Maybe doing the same whitelist check)

→ question:
[I’m sorry if this is answered in the post already]
I’ve seen you have various methods. Can you tell me which is the fastest? Or, how could I make this faster?

→ question:
[I’m not well informed about Zone+ so idk how useful it is]
There’s a .Touched and .Entered which seem really useful. But if we get into Zones (which is what these seem like), would you recommend using yours over zone+'s ? Of course, it’s better the have all in one module, but if I only want to use Zones and not hitboxes, is it still better?

Anyway, seems pretty reliable so I’m counting on this module! After all I’ve been having some delay problems with my hitboxes lately but I thought I couldn’t do anything. So I’m glad I found this post!

PD: I’d like answers from the OP and people who have tested it if possible :slightly_smiling_face:

Edit: I just found out the Dev is banned from the forums lol. Sorry to hear that, I couldn’t live without devforum tbh. Those who want to make a v2 I’d really appreciate it!

The module itself uses the worldroot detections.

honestly idk

idk this either tbh

i’d say they’re both good. But for different purposes. If you want to use zones, i’d recommend u use zone +. For hitboxes this module.

1 Like

I will do some benchmarking now some day I guess.

sorry for the bump/self promo but I think it’s important.

I’ve recently created a v2 version of the module with the owner himself. It fixes a LOT of the bugs hitboxservice v1 had and adds a lot of features to it. I’d recommend you check it out since this module seems to no longer be maintained.

https://devforum.roblox.com/t/hitbox-service-v2-easily-create-accurate-hitboxes-using-minimal-scripting/1761565

cc: @ElVaranCubico_YT

2 Likes