Parrying with RaycastHitboxV4

I am trying to make a parrying mechanic for my tool that uses RaycastHitboxV4, and just cant figure out how to do it.

ive done a few things such as adding a String value to the player logging the state including parrying and attacking.

What ive done is if the player is parrying, or another player is it dose no damage, but it seems that this dosent work.

This is the hit detection for the tool.

Hitbox.OnHit:Connect(function(hit, humanoid)
	if hitted then return end
	hitted = true

	if plr.WPStatus.Value == "parrying" then
		if humanoid.Parent ~= char then
			humanoid:TakeDamage(0)
			tool.BodyAttach.Parry:Play() 
			task.wait(0.5) 
		end
	else
		if humanoid.Parent ~= char then
			humanoid:TakeDamage(Damage)
			tool.BodyAttach.Hit:Play()
			task.wait(0.5)
		end
	end

	hitted = false
end)

If anyone could help me to figure you what i can do it would be greatly appreciated

1 Like

This is just a guess, but is the “parrying” status set in a local script?
If so, it will not replicate to the server. I would suggest using a RemoteEvent.

Im using a RemoteEvent that communicates to the server script on whats going on