Other Clients sees you play emote 2 times, but in the Emote client you play it once

hi, im making emotes for my game, and i change it to client, basicly
server shoots a string value, client process the value,
plays emotes.

simple right???
but theres a problem, because is client, i have to check who is doing the emote, specially if i want to use remote events, wich is important too.
now i fixed that ofc, but i notice that other clients sees you playing the emote 2 times, but the client that is doing the emote, just did it once.
like it says on the tittle.

so im confused of how i solved this?:

heres the function that plays the animation:

function module.playEmote(char: Model, emoteName: string)
	local data = EmoteCache[char]
	if not data then return end
	local plr = Players:GetPlayerFromCharacter(char)
	local track = data.Tracks[emoteName]
	if not track then
		warn("Emote not preloaded:", emoteName)
		return
	end
	local Anbimation = data.AnimationsC[emoteName]
	if not Anbimation then
		warn("Emote Not Animation:", emoteName)
		return
	end
	
	local Owner = (plr == Players.LocalPlayer)
	
	local Velocity = 0
	
	if Anbimation:FindFirstChild("Velocity") then
		Velocity = Anbimation:FindFirstChild("Velocity").Value
	else
		Velocity = 0.05
	end
	
	if data.Current then
		data.Current:Stop()
	end
	if valuestop[char.Name] then
		if Owner then
			BasicRemote:FireServer({Action = "AttackDestroy"})
		end
	end
	
	valuestop[char.Name] = true
	
	if Owner then
		data.Current = track
		track:Play()
		char:SetAttribute("DoingEmote", true)
		BasicRemote:FireServer({Action = "AttackD", walkspeed = Velocity, jumpforce = 0})
	end
	
	task.spawn(function()
		for i, v in pairs(Anbimation:GetChildren()) do
			if v:IsA("ModuleScript") and v.Name == "Function" then
				local scrippt = require(v)

				scrippt.Act(track, char)
			end
		end
	end)

	track.Ended:Connect(function()
		if data.Current == track then
			data.Current = nil
		end
		
		task.wait(0.1)

		if not data.Current and valuestop[char.Name] then
			valuestop[char.Name] = nil
			char:SetAttribute("DoingEmote", nil)
			if Owner then
				BasicRemote:FireServer({Action = "AttackDestroy"})
			end
		end
	end)
end

this line is what im talking about that changes everything:

	if Owner then
		data.Current = track
		track:Play()
		char:SetAttribute("DoingEmote", true)
		BasicRemote:FireServer({Action = "AttackD", walkspeed = Velocity, jumpforce = 0})
	end

without change it:
(it supposedly be drinking a gasoline thingy)

if i take out the play track:

	track:Play()
	if Owner then
		data.Current = track
		char:SetAttribute("DoingEmote", true)
		BasicRemote:FireServer({Action = "AttackD", walkspeed = Velocity, jumpforce = 0})
	end

(i forgot to put away the “data.Current = track”, but if you can see it plays 2 times)
how i make play the animation, without playing 2 times in other clients, and still be able to see the vizuals across all clients?

and the client that is doing the emotes, is looks perfect, i couldnt record it because i was using my phone for this (alt account)

helloooo???
anyone’?

Are you by chance replicating the Animation to the server through a RemoteEvent?

bro, holy complexity for playing animations

animations created in studio or server are automaticly replicated when they are played.

If you play the Animation on the Humanoid’s animator, it’ll be replicated to the server and to other clients automatically as well

uhhh
i think?, i dont romember, let me check

yeah sorry, i just wanted to pre load the animations and things

ok guys, i think you were right asking if i was using a remoteEvent to “Shoot” the animations, yes just to throw a stringvalue, so the client can detect the stringvalue added.
since @real_ryanx @Fietowski asking

i notice it because i was doing another thing wich is just doing an ult move and i saw this

now how exacly works the emote thing?:

first the UI clicking a buttom:

-- Function to handle button clicks for emotes
local function setupWheel()
	for _, v in pairs(wheel:GetDescendants()) do
		if v:IsA("TextButton") then
			v.MouseButton1Down:Connect(function()
				Yes:deselect()
				wheel.Visible = false
				if checked.canattackb(Player) then
					return
				end
				if Check(Player.Character) then
					return
				end
				Remote:FireServer(slotTable["slot" .. v.Name])
			end)
		elseif v:IsA("StringValue") then
			local slotNumber = string.match(v.Name, "%d+")
			if slotNumber and Emotes:FindFirstChild("Slot" .. slotNumber) then
				local slotValue = Emotes["Slot" .. slotNumber].Value
				v.Value = slotValue
				updateSlot(slotNumber, slotValue)
			end
		end
	end
end

the remotevent things

	if Check(player.Character) then
		return
	end
	if mod.canattackb2(player) then
		return
	end
	
	--Emott.playEmote(player.Character, String)
	local value = Instance.new("StringValue")
	value.Value = String
	value.Name = "Emote"
	value.Parent = player.Character:WaitForChild("Values")
	game:GetService("Debris"):AddItem(value, 0.1)
end)
remotee4.OnServerEvent:Connect(function(player)
	--Emott:StopEmote(player.Character)
	local value = Instance.new("StringValue")
	value.Name = "StopEmote"
	value.Parent = player.Character:WaitForChild("Values")
	game:GetService("Debris"):AddItem(value, 0.1)
end)

the detection folder values (StarterPlayerScripts):

	local Values: Folder = char:WaitForChild("Values")
	
	Values.ChildAdded:Connect(function(child)
		if (player.Character and player:DistanceFromCharacter(char:GetPivot().Position) < 100) then

			local Plrrr = game:GetService("Players"):GetPlayerFromCharacter(char)
			if child:IsA("StringValue") then
				if child.Name == "HitVfx" then
					local tablee = {
						char = char;
						ifstatement = child.Value;
						strongard = child:GetAttribute("strong");
						soundid = child:GetAttribute("soundid");
						volume = child:GetAttribute("volume");
					}
					Mold2.Vfx(tablee)
					
					if child.Value == "Block" then
						if child:GetAttribute("strong") == true then
							local anim = OtherAnims.Perfect
							if anim then anim:Play(0.01, 2, 0.8) end
						else
							local ran = BlockAnims[math.random(1, #BlockAnims)]
							if ran then ran:Play(0.01, 1) end
						end
					else
						if child.Value == "Miss" then return end
						local check = child:GetAttribute("WithAnims")
						if check == true then
							local ran = HitsAnims[math.random(1, #HitsAnims)]
							if ran then ran:Play(0.01, 1) end
						end
					end
				elseif child.Name == "Grab" then
					local anim = GrabAnimations[child.Value]
					if anim then
						anim:Play()
					else
						local animation = grabs:FindFirstChild(child.Value)
						if animation then
							local Anim = animator:LoadAnimation(animation)
							Anim:Play()
							GrabAnimations[animation.Name] = Anim
						end
					end
				elseif child.Name == "Emote" then
					EmotesModule.playEmote(char, child.Value)
				elseif child.Name == "StopEmote" then
					EmotesModule.stopEmote(char)
				end
			end
		end
	end)

and the function that i showed before with the animations playing, now why using animator instead of Humanoid???, well to make the story short, basicly some stuff with the animation and not able to stopping it, specially for npcs in my game, and trying to change animation and moves from server to client.
i actually didnt know that animator can replicated server, or maybe i didnt romember it, so with this knowledge, should i shoot it to the client the stringvalues???, or what, idk what should i do, i kinda know or i dont know the awnser for this, what you guys think?

Animations played on the client side are automatically replicated to the server when played on the Humanoid’s Animator, you don’t need a remote to replicate it.