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.
@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)