How to send a signal to the player i hit

Hi, I am looking for a way in which I can send a signal to the player that was touched by the raycast (I am using the RaycastHitboxV4.01 module). I have no idea how to do this; here is a visual example of what I need to do.

In this video, I want to make it so that when the player is blocking when he is hit by someone, his blocking stops, and it will be used as a signal to save him so he can do his daily missions (so I want to know how to send the signal to the player that was touched by the raycast).

I already have the block function; inside the character there is a boolean value that will be activated whenever the player is blocking, and I know how to make the hit find when the player is blocking to create a small stun on the player that hit him.
image

Have you tried to use BindableEvents? If you need server-client communication you can use RemoteEvents instead.

1 Like

That’s a great idea; I’ll try sending a signal from the client of the player who hit to the client of the player who was hit.

@DEVLocalPlayer Ty for the idea, this is the way i send the signal:

Server script:

local function getPlayerFromCharacter(character)
	for _, player in pairs(game:GetService("Players"):GetPlayers()) do
		if player.Character == character then
			return player
		end
	end
end


Hitbox.OnHit:Connect(function(hit, humanoid)
	if hit.Parent.Values.Blocking.Value == true then
		BlockSucces:FireTo(getPlayerFromCharacter(humanoid.Parent))
		warn("Blocking")
	else
		humanoid:TakeDamage(DMG.Value)
	end
end)

Client script:

BlockSucces:Connect(function(plr)
	print("Damn, nice block.")
end)

(i used the BridgeNet module)

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.