Raycast Hitbox 4.01: For all your melee needs!

yo whats the difference between clientCast and this hit box system?

hereā€™s what the previous post said:

Adding onto this, you should also verify Data.Instance itself - exploiters can decide to keep Data.Position the same, but spoof Data.Instance.

1 Like

Oh, I didnā€™t know you were waiting upon a keyframe, I havenā€™t tried this but this might be the issue. Personally the way I would do it and have did it in the video is when the tool is activated, wait a certain amount of time then Start the hitbox. Here is a scuffed example but you get the point.

That could be true, but making a anti cheat for this shouldnā€™t be to hard either. I just did this for 1 Attachment but doing this for all of them shouldnā€™t be any different.

image

I just finished this script in a few seconds so its not to complicated.

1 Like

Ohh ok thanks i needed that info

1 Like

Does this work with non-player characters? Iā€™m creating a hitbox for my own character, and it works fine, but itā€™s not working when I create a hitbox for an NPC character. Iā€™m using the same exact code for both.

local function HandleHitbox(Params, Player)
	warn("CREATING HITBOX")
	local Character
	
	if Player then
		Character = Player.Character
	else
		Character = Params.Character
	end
	
	if Params.Status == "Connect" then
		warn("Connecting")

		local Tool = Character:FindFirstChildOfClass("Tool") or Params.Tool
		local CombatInfo = Tool:WaitForChild("CombatInfo")	
		
		warn("Found tool: " .. Tool:GetFullName())
		
		local Hitbox = RaycastHitbox.new(Tool)
		Hitbox.DetectionMode = RaycastHitbox.DetectionMode.PartMode
		Hitbox.Visualizer = false	
		Hitbox.OnHit:Connect(function(Hit)
			HandleHit(Hit, Tool)
		end)

I have verified that the function still runs for the NPC and that its tool is found.

Output for my character:
17:29:12.759 Connecting
17:29:12.759 Found tool: Workspace.kvKAVl.7000
17:29:12.759 created hitbox for: kvKAVl

Output for NPC:
17:29:20.193 Connecting
17:29:20.194 Found tool: Workspace.Dummy.7000
17:29:20.194 ServerScriptService.Remotes.NewCombat.Hitbox:35: attempt to index nil with ā€˜DetectionModeā€™

Any help would be greatly appreciated. :pleading_face:

Is that on the client or server? Either way there are other approaches to it like checking if the attachments have moved outside the handleā€™s hit box and doing a server checking by checking if the position is valid and in close proximity to the handle.

It works from both the server and the client. And yes there are other ways but I just spent 3 - 4 minutes on it so it isnā€™t perfect.

Hey, Iā€™ve been using this melee module for a while now. Iā€™ve done a lot of modifying to it, such as introducing blocking, hitting more than once, going through players, etc. Itā€™s sort of been a problem, but for some reason, whenever I use the melee system, over time the game gets more and more laggy. The game starts out fine, there arenā€™t any unions or looping scripts, but after about 5 or 10 minutes, the game becomes very laggy.
This has been a previous issue, as my old raycast melee system wasnā€™t able to delete rays. Is there anything you can suggest or advise? Rays are produced on the client, btw.

So, what would be better, this raycast hitbox, or using just a region 3 added to the front body torso of the player?

It should works for NPCs. Seems like the Hitbox isnā€™t getting returned for the NPC. Possible to send me a simple repro place demonstrating the problem?


@RobloxNoob1203 Sounds like a memory leak. Have you cleared any unneeded connections? Are you saving things but not deleting them? This module itself does not cause the memory leaks so it will be something about your melee system that is causing it. Press F9 and take a look at the memory tab to see what is using up all your memory after a while.


@Techblowhead Apples to oranges. Do you want to prioritize accurate and performant-friendly hitboxes or a full box hitbox that you have no control over? Why not have both? For example, in our own experiences, I use this module for the melee stuff and region3 for larger hitboxes like aoes.

i guess you are right. But when it comes to long range, would region3 be good at detection, or would the new overlap params work better? like for a move like a energy beam

I suggest overlap params since its suppose to succeed region3 in those aspects.

How would I make this double wield?

Does anyone else have the issue where once you first click it doesnā€™t register (aka the swing animation wont play), with it always working only after the 2nd mouseclick?

Decided to give this module a try again, and Iā€™m still running into major reliability issues.

https://gyazo.com/ef5b7a58e2b9ac67adde2f77c0b43fb2

As you can see in this gif, I print the name of the hit object, and thereā€™s no print with the second slash(even though the visualization clearly overlaps the other player).

Before it was written off as something that was inevitable when I posted about it before, but I had a 100+ player game using this module and Iā€™ve gotten countless complaints about reliability issues with the swords, and the unreliability seems to be unacceptable from a competitive gameplay perspective. Lower frame rates seem to exacerbate the problem dramatically(Iā€™ve heard reports of people with lower frame rates barely being able to hit stuff at all, and Iā€™ve witnessed it myself a few times).

Iā€™m not sure whatā€™s going wrong. Can provide repro if youā€™re interested in taking a look, Iā€™m very open to the possibility of it being a problem on my end.

1 Like

Having the same issue. It only triggers the OnHit event half the time even when the visualizers CLEARLY hit the target.

EDIT: All of my hit registration is on the server so its not a desync thing and it also happens even when I stand still.

1 Like

Excuse me, I canā€™t turn the plugin off. Is there a fix?

Hi there! Love your module, I have a question.
If itā€™s possible, how can I create a option in a ā€œSettingsā€ gui that toggles the Visualizer on and off?
This is going to benefit for debugging the raycasts to help me solve any possible issues.
Thanks.