Animation playing on everyone

  1. What do you want to achieve? I need it so my animation will not play on both the client and the person being cuffed.

  2. What is the issue? it is playing on both the person arresting and being arrested.

  3. What solutions have you tried so far? Tried making it only load in that humanoid.

local folder = rs:WaitForChild("remotes")
game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(char)
		repeat wait()until char.Head
		local newValue = Instance.new("BoolValue", char)
		newValue.Name = "HandcuffValue"
		newValue.Value = false
		char.Parent = game.Workspace:WaitForChild("Players")

	end)
end)

	
local Player = game.Players.LocalPlayer
local Animation = game.Workspace.Animation
local Players = game:GetService("Players")




Players.PlayerAdded:Connect(function(Player)
	repeat wait() until Player.Character
	local Character = Player.Character
	local Humanoid = Character.Humanoid
	local AnimationTrack = Humanoid:LoadAnimation(Animation)
















folder.handcuff.OnServerEvent:Connect(function(player,p)
		AnimationTrack:Play()
		wait(1)  
		AnimationTrack:Stop()
	p.HandcuffValue.Value = true
	p.Humanoid.WalkSpeed = 8

Change that to

	player.Character.HandcuffValue.Value = true
	player.Character.Humanoid.WalkSpeed = 8

Also, I wouldn’t recommend having 2 PlayerAdded events, you just only need the OnServerEvent Event so that it’ll easily detect who first fired the event