You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
I want to know the best way to do if the player A hits player B, then player B will play an animation
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I’ve tried to add a BoolValue so when player A hits the player B, player B’s BoolValue turns on, running the function using Boolean.Changed. But I want to know if there is a better way of doing it?
I have also tried to play an animation in player B, from player A’s local script but only player A could see the animation being played on player B
Well, with a Touched event, you can get the opponents Humanoid and play the animation there.
p.Touched:Connect(function(hit)
if (hit.Parent:FindFirstChild("Humanoid")) then
local hum = hit.Parent.Humanoid --gets humanoid here
local Animator = hum.Animator --use this to play animations
--you can play the animation for the other client or player here
end
end)
This might not be correct but, I’ll do some research and come back to this post.