Here's the server side script as the local script just fires the event:
local RemoteEvent = script.Parent.RemoteEvent local Using = false local TargetTorso function CheckForChar(Part) if Part.Parent:IsA'Model' and Part.Parent:FindFirstChildOfClass'Humanoid' then local Char = Part.Parent local Torso if Char:FindFirstChild("Torso") then Torso = Char.Torso else Torso = Char.UpperTorso end TargetTorso = Torso return Char end end function CheckForTorso(player) local Char = player.Character if Char:FindFirstChild("Torso") then return Char.Torso else return Char.UpperTorso end end RemoteEvent.OnServerEvent:Connect(function(player, one, two) if one == 'Cuff' then local Target = CheckForChar(two) local PlayerTorso = CheckForTorso(player) if Target then Using = true RemoteEvent:FireClient(player, 'Use') spawn(function() while Using and wait() do TargetTorso.Anchored = true TargetTorso.CFrame = PlayerTorso.CFrame * CFrame.new( 0, 0, -2.5 ) end end) end elseif one == 'UnCuff'then Using = false wait() TargetTorso.Anchored = false end end)
Just re-name the Target's humanoid, that prevents resetting. Try something like this:
Char.Humanoid.Name = "Target"
And rename it back to "Humanoid" to allow the player to reset again