Script prints, but does not execute anything

  1. On a remote event being fired, the player will be handcuffed with welds.

  2. The script won’t execute, but will print.

  3. I have tried variations of the script to fix it.

	print("recieved")
	if player.Team == game.Teams.Police then
			if value == "c" then
			if target.cValue.Value == false then
			player.PlayerGui.InteractiveMenu.Frame.g.Visible = true
					print("cuffed")
					target.cValue.Value = true
				print(target.Name)
				print("Test")
				local Weld1 = Instance.new("Weld")
				Weld1.Name = "Tool_Weld2"
				Weld1.Part0 = target.Torso
				Weld1.Part1 = target['Right Arm']
				Weld1.Parent = target.Torso
				Weld1.C1 = CFrame.new(-1 * .65, -.35, -.35) * CFrame.fromEulerAnglesXYZ(math.rad(17.5), math.rad(0), math.rad(-1 * -40))
				local Weld2 = Instance.new("Weld")
				Weld2.Name = "Tool_Weld3"
				Weld2.Part0 = target.Torso
				Weld2.Part1 = target['Left Arm']
				Weld2.Parent = target.Torso
				Weld2.C1 = CFrame.new(1 * .65, -.35, -.35) * CFrame.fromEulerAnglesXYZ(math.rad(17.5), math.rad(0), math.rad(1 * -40))
	local Animation = Instance.new("Animation")
				Animation.AnimationId = "rbxassetid://9048615510"


	local Handcuffed = player.Character:WaitForChild("Humanoid"):LoadAnimation(Animation)
				target.Humanoid.WalkSpeed = 8


	
	
					
					if target.cValue.Value == true then

				target.cValue.Value = false
				player.PlayerGui.InteractiveMenu.Frame.g.Visible = false

				target.Humanoid.WalkSpeed = 16
				target.Torso["Tool_Weld2"]:Destroy()
				target.Torso["Tool_Weld3"]:Destroy()
			endgame.ReplicatedStorage.InteractionEvent.OnServerEvent:Connect(function(player, target, value)
	print("recieved")
	if player.Team == game.Teams.Police then
			if value == "c" then
			if target.cValue.Value == false then
			player.PlayerGui.InteractiveMenu.Frame.g.Visible = true
					print("cuffed")
					target.cValue.Value = true
				print(target.Name)
				print("Test")
				local Weld1 = Instance.new("Weld")
				Weld1.Name = "Tool_Weld2"
				Weld1.Part0 = target.Torso
				Weld1.Part1 = target['Right Arm']
				Weld1.Parent = target.Torso
				Weld1.C1 = CFrame.new(-1 * .65, -.35, -.35) * CFrame.fromEulerAnglesXYZ(math.rad(17.5), math.rad(0), math.rad(-1 * -40))
				local Weld2 = Instance.new("Weld")
				Weld2.Name = "Tool_Weld3"
				Weld2.Part0 = target.Torso
				Weld2.Part1 = target['Left Arm']
				Weld2.Parent = target.Torso
				Weld2.C1 = CFrame.new(1 * .65, -.35, -.35) * CFrame.fromEulerAnglesXYZ(math.rad(17.5), math.rad(0), math.rad(1 * -40))
	local Animation = Instance.new("Animation")
				Animation.AnimationId = "rbxassetid://9048615510"


	local Handcuffed = player.Character:WaitForChild("Humanoid"):LoadAnimation(Animation)
				target.Humanoid.WalkSpeed = 8


	
	
					
					if target.cValue.Value == true then

				target.cValue.Value = false
				player.PlayerGui.InteractiveMenu.Frame.g.Visible = false

				target.Humanoid.WalkSpeed = 16
				target.Torso["Tool_Weld2"]:Destroy()
				target.Torso["Tool_Weld3"]:Destroy()
			end

Where does it stop printing? You’re printing multiple things.

Actually, it doesn’t even stop when I check if the cValue is true, which should not happen. Should I add a wait(1), then make the cValue true?

Doing this makes it wait 1 second, but then uncuffs him after the one second.

I was able to fix my issue by adding a variable in the script and changing that instead of the player’s variable.