Raycast Hitbox 4.01: For all your melee needs!

You will have to follow instructions. Its not a drag and drop. It works in all environment, be it server or client.

2 Likes

EDIT: fixed it! Iā€™m no longer destroying the hitbox when unequipped, and creating it before anything else. If this isnā€™t the preferred method, please let me know :heart:

Iā€™m having an issue when an user quickly equips & unequipps a weapon using this module, while using the weapon. The variable ā€œHitboxā€ turns to nil, and I get this error output:

  Players.Untethered.Backpack.Sword.SwordScript:78: attempt to call a nil value

I was able to replicate this issue in the showcase Example Place in the original post of this thread. The error shown on that example place is this:

  Players.Untethered.Backpack.ClassicSword.SwordScript:135: attempt to call a nil value

This is specifically within this function from the Sword script in the example place.

function Attack()
	Damage = DamageValues.SlashDamage
	Sounds.Slash:Play()

	if Humanoid then
		if Humanoid.RigType == Enum.HumanoidRigType.R6 then
			local Anim = Instance.new("StringValue")
			Anim.Name = "toolanim"
			Anim.Value = "Slash"
			Anim.Parent = Tool
		elseif Humanoid.RigType == Enum.HumanoidRigType.R15 then
			local Anim = Tool:FindFirstChild("R15Slash")
			if Anim then
				local Track = Humanoid:LoadAnimation(Anim)
				Track:Play(0)
			end
		end
	end	

	wait(0.2)
	Hitbox:HitStop()
end

Specifically, in the Hitbox:HitStop() line.

What can I do to work around this issue? Iā€™m a bit stuck here :frowning:

2 Likes

Hi, Iā€™m having an issue with the RayCastHitBox. okay, so the issue is that I canā€™t detect the anchored part. for example, when I used my sword on a wall that is anchored, It wonā€™t detect anything. :slightly_frowning_face:

1 Like

Have you tried changing the detection mode?

Everyone, after I call Hitbox:HitStart(1)ļ¼Œ do I need to wait for an event before calling Hitbox:Destroy() to reduce memory

This can be used for ranged attacks as well right? Whenever we delete the projectile we can delete the hitbox and done.

Does the hitbox detect Terrain? If you wanted a tentacle to create a splash effect when colliding with terrain water, would that be possible?

Replicate the hitboxes from the client, then send the hit data to the server. This fixed the problem for me

Good Morning / Afternoon / Evening, Why is it like this?

1 Like

activate hitboxes from the client.

a guy told me that the hitbox will be messy when the animation is ran clientsided, he didnt mention abt this tho, ill try it out

sorry, I should have been more specific. Activate the hitbox from the client then send the hit data to the server

1 Like

Will the exploiter use hitbox extender >:(

1 Like

i may be answering my own question by why not play the animation in a serverscript and make a local variable that becomes a connection instead of making it play on both local and serverscripts?

Its hard to do this, because you need to adjust the attachments position. You could add a check, and if the attachment has moved, kick the player or even move it back. You would have to do this with Position And NOT world position

I donā€™t think this would work. But even if it did, you would still have the problem with client delays. To sum it up try swinging while the player is walking, then you will see that the hitbox is far behind

This is similar to ClientCast:
ClientCast - A Client-based, Idiosyncratic Hitbox System! - Resources / Community Resources - DevForum | Roblox

Edit: I donā€™t believe Raycast Hitbox would replicate from client only ClientCast does

I have done this to the weapons in my game as well, It works perfectly fine.

Edit: I only realised what you meant about the exploiter prevention, didnā€™t even know that ClientCast was a thing until you showed me it. Thanks

3 Likes

ClientCast has easier exploiter prevention if you set the ClientCasterā€™s owner to a client

Example:

Caster.Collided:Connect(function(Data)
    if (Data.Position - Caster.Object.Position).Magnitude > 5 then
        return print("very likely an exploiter")
    end
end)

Ah, I see, so i make the hitbox on the client, and then when the animation has reached the keyframe i do onclientevent and then start the hitbox?