Duo emotes won't work (Can't find Player2)

So I have this nice emotes system which works pretty well. Though for an upcoming update, I decided to make dual emotes (emotes that you can do with another player), and so I coded it. When tested, the first player (aka the initiator) gets the animation., yet the second one doesn’t.

ServerScript (only important snippets):

while task.wait(1) do
	counter -= 1
		
	if counter > 0 then
		setPrompt.Triggered:Connect(function(trigger)
			if player.Name == trigger.Name then
			else
				trigger.Character.HumanoidRootPart.CFrame = facePart.CFrame
				trigger.Character.Humanoid.WalkSpeed = 0
				trigger.Character.Humanoid.AutoRotate = false
				relayEvent:FireClient(player, "Player1") --This one works.
				relayEvent:FireClient(trigger, "Player2") --This one doesn't?
				setPrompt:Destroy()
			end
		end)
	elseif counter <= 0 then
		for i, parts in pairs(char:GetChildren()) do
			if parts.Name == "FacePart" then
				parts:Destroy()
			end
		end
		for i, prompts in pairs(char.Torso:GetChildren()) do
			if prompts:IsA("ProximityPrompt") then
				prompts:Destroy()
			end
		end
		char.Humanoid.WalkSpeed = 16
		char.Humanoid.AutoRotate = true
		counter = 5
		break
	end
end

LocalScript (only important snippets):

grpEmote:FireServer(emoteN)
local dualCheck = dualEmotes:GetChildren()

relayEvent.OnClientEvent:Connect(function(who)
	print(who) --only prints for Player1, never Player2
	if who == "Player1" then
		loadedAnim:Play()
	elseif who == "Player2" then
		local newEmoteN = string.gsub(emoteN, " 2P", "")
		print(newEmoteN)
		for i, nameAnim in pairs(dualCheck) do
			if nameAnim.Name == newEmoteN and nameAnim:IsA("Animation") then
				local dualAnim = char:WaitForChild("Humanoid"):LoadAnimation(nameAnim)
				Player.Character:WaitForChild("Humanoid").AutoRotate = false
				Player.Character:WaitForChild("Humanoid").WalkSpeed = 0
				dualAnim:Play()
			end
		end
	end
end)

It’s supposed to work, yet I do not know what’s wrong. I’ve searched a lot about topics relating to this, to no avail. Any help is appreciated! Let me know if you want access to the full script.

Did you try printing the trigger and player onto the console? This might not be much but it should help to see if its even firing to an existing player.

Also, can you reveal a little bit more of the server script? Like above the loop

Tried it out, it printed both Player1 and Player2 (in terms of in-game names at a server test)
Though, what’s confusing is the fact that in the client-side, it never prints out for Player2, only Player1.

Extended version of ServerScript:

emoteEvent3.OnServerEvent:Connect(function(player, emoteN)
	local char = player.Character
	local hRP = char.HumanoidRootPart
	char.Humanoid.WalkSpeed = 0
	char.Humanoid.AutoRotate = false
	
	task.wait(1)
	
	local counter
	local setPrompt = Instance.new("ProximityPrompt")
	local facePart = Instance.new("Part")
	facePart.Name = "FacePart"
	facePart.Transparency = 0.5
	facePart.CanCollide = false
	facePart.Anchored = true
	facePart.CFrame = hRP.CFrame * CFrame.new(0, 0, -4)
	facePart.Orientation = hRP.Orientation + Vector3.new(0,180,0)
	facePart.Parent = player.Character
	
	setPrompt.Parent = player.Character:WaitForChild("Torso")
	setPrompt.RequiresLineOfSight = false
	setPrompt.MaxActivationDistance = 7
	--setPrompt.Style = Enum.ProximityPromptStyle.Custom
	setPrompt.ActionText = emoteN
	setPrompt.ObjectText = "pair."
	
	counter = 3
	while task.wait(1) do
		counter -= 1
		
		if counter > 0 then
			setPrompt.Triggered:Connect(function(trigger)
				if player.Name == trigger.Name then
				else
					trigger.Character.HumanoidRootPart.CFrame = facePart.CFrame
					trigger.Character.Humanoid.WalkSpeed = 0
					trigger.Character.Humanoid.AutoRotate = false
					relayEvent:FireClient(player, "Player1")
					print(player)
					relayEvent:FireClient(trigger, "Player2")
					print(trigger)
					setPrompt:Destroy()
				end
			end)
		elseif counter <= 0 then
			for i, parts in pairs(char:GetChildren()) do
				if parts.Name == "FacePart" then
					parts:Destroy()
				end
			end
			for i, prompts in pairs(char.Torso:GetChildren()) do
				if prompts:IsA("ProximityPrompt") then
					prompts:Destroy()
				end
			end
			char.Humanoid.WalkSpeed = 16
			char.Humanoid.AutoRotate = true
			counter = 5
			break
		end
	end
end)