How can I make an animation that plays when damaged that is NOT client sided?

So what I’m trying to do here is like the title said; have an animation play when the player is damaged. So far, all of the topics I’ve seen only work when client sided (only you can see the animation, no one else can), but I want to make it so that everyone can see it.

This is my current local script, located in StarterCharacterScripts:

local Character = script.Parent
local Humanoid = Character:WaitForChild("Humanoid")

local anim1 = game.ReplicatedStorage.Animation
local anim1 = Humanoid:LoadAnimation(anim1)
local anim2 = game.ReplicatedStorage.Animation2
local anim2 = Humanoid:LoadAnimation(anim2)


local oldHealth = Humanoid.Health
Humanoid.HealthChanged:Connect(function()
	if oldHealth > Humanoid.Health then
		print("Humanoid took " .. oldHealth - Humanoid.Health .. " damage")
		local value = math.random(1,6)
		if value == 1 then
			anim1.Priority = Enum.AnimationPriority.Action
			anim1:Play()
		elseif  value == 2 then
			anim2.Priority = Enum.AnimationPriority.Action
			anim2:Play()
		end
	
	end
	oldHealth = Humanoid.Health
end)

Thanks in advance,
kitekite

Animations are automatically replicated if 1, you’re playing it through the localscript , 2 the networkownership of it is yours(might be wrong), 3 it has an animator.

I’m trying to figure out how I can play it through a normal serverscript, but nothing seems to be working.

Thanks for the reply, I’ll look into it.

Why would you even want to play it through the server. Just send a remote event to the client to make them play the animation or alternatively make others load the animation for it(NPCs)