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

TOUHOU MENTIONED?!!! :yum:

This text will be blurred

truly a touhou moment​:money_mouth_face::money_mouth_face::money_mouth_face::fire::fire::fire:

(i am rewriting my entire game now because apparently that fixed it for now despite other hitboxes working fine before ¯_(ツ)_/¯ :skull:)

Sounds like a yield issue, does any of your code yield? The only part of HitboxClass that ever yields is when trying to make an initial connection to the client if using a client-sided hitbox.

Thank for this amazing module, Dude!! It really helps.

1 Like

well no it didnt delay for other hitboxes but i guess it doesnt really matter anymore since im already rewriting my game

and since i am here, is there a “best” way to cancel a move and hitbox once you get stunned instantly?
(also if the ping is too high the hitbox doesnt even hit someone, anyway to prevent that?)

You can ensure all attack hitboxes have a certain ID, like “Attack”, and clear them out with the respective method. For the ping issue, you can have the move determine how high the player’s ping is, and use a server or client-side hitbox depending on that.

1 Like

How can i make the hitbox only hit 1 person? / 1 humanoid

Disconnect from the HitSomeone connection or destroy the hitbox after picking a humanoid from the first HitChars provided by the HitSomeone connection.

1 Like

thank you , mind if u give a example?, would really appreciate it

local HitConnect
HitConnect = newHitbox.HitSomeone:Connect(function(hitchars)
     -- pick a humanoid sent by the signal
     HitConnect:Disconnect()
end)
1 Like

Sorry but, how could i get the signal from the server?, i am using my own damage handler as a module in replicatedstorage, how would i set the hitbox from the client and then use it as i was on the server?, then require my damage handler module so it gets replicated to client-server?

(would i need to set a remote event?)

I’m unsure why you need the client one, since the client fires their response and it goes through the server one regardless. Just disconnect from the server one, the client will keep the server up to date on the hitbox’s state. When you destroy the hitbox on the server, it’ll automatically destroy everything on the client and cleanup. If you don’t want the hitbox to send anything at all, use Stop() or Destroy() for when you’re completely done with the object.

Also, since the signal on the client one is client-sided, the server wouldn’t be able to see it no matter what you do anyways.

how would i pick one?, i did this, but it prints 2 models, instead of only 1

self.hitboxConnect = self.newHitbox.HitSomeone:Connect(function(hitChars)
			for m, i in hitChars do 
				local Hit = false
				if not Hit then 
					Hit = true
					self.newHitbox:Destroy()
					self.hitboxConnect:Disconnect()

					local echar = hitChars[m]
					print(echar)
					
				end
			end
		end)

image

This is so helpful! Thankyouu :slight_smile:

1 Like

Up to you, for instance, if you wanna pick which one is closer, do magnitude checks to see which one is closer to the character model.

Yeah, but how would i select only one? (i don’t really mind the order)

This text will be blurred

Just index the first position. HitChars[1].

1 Like

Works most of the time, there’s just an issue that I don’t even know how to describe:

when I move I guess the hitbox doesn’t register anything inside of it already?

Make sure you have a debounce time of some sort. Or you can use the ClearTaggedChars() method. If neither of those help, show me the code on how you’re using the hitbox if at all possible so I could possibly replicate it.

sorry for being late lol. The hitbox is unanchored which causes it to move like that, so just set guidepart.Anchored = true

1 Like