the player who cuffs needs to hold the other one. Can anyone help me ?
COMMUNITY QUESTION
Help me please: I want to make cuffs that hold a player, can you help me?
1 answer
Local Script in StarterGui, have a StringValue under this named "Captured"
local player = game.Players.LocalPlayer
local remote = game.ReplicatedStorage.RemoteEvent
local debounce = true
game:GetService("UserInputService").InputBegan:Connect(function(inputObject, gameProcessedEvent)
if inputObject.KeyCode == Enum.KeyCode.E and player.TeamColor == BrickColor.new("Really blue") then
if debounce == false then return end
debounce = false
for i, v in pairs(game.Players:GetPlayers()) do
local c = workspace:FindFirstChild(v.Name)
if c ~= nil and c:FindFirstChild("Humanoid") ~= nil and v.TeamColor == BrickColor.new("Really red") then
local magnitude = (player.Character.HumanoidRootPart.Position - c.HumanoidRootPart.Position).magnitude
if script.Captured.Value == "" and magnitude <= 10 then
script.Captured.Value = v.Name
remote:FireServer("Arrest", v.Name)
elseif script.Captured.Value == v.Name then
script.Captured.Value = ""
remote:FireServer("Release", v.Name)
wait(5)
end
end
wait()
end
debounce = true
end
end)
Server Script
local remote = game.ReplicatedStorage.RemoteEvent
remote.OnServerEvent:Connect(function(player, msg, criminal)
if msg == "Arrest" then
local p = workspace:FindFirstChild(player.Name)
local c = workspace:FindFirstChild(criminal)
c.Humanoid.WalkSpeed = 0
c.Humanoid.JumpPower = 0
local weld = Instance.new("Weld", c)
weld.Part0 = p.HumanoidRootPart
weld.Part1 = c.HumanoidRootPart
weld.C0 = CFrame.new(0, 0, 5)
elseif msg == "Release" then
local c = workspace:FindFirstChild(criminal)
c.Weld:Destroy()
c.Humanoid.WalkSpeed = 16
c.Humanoid.JumpPower = 50
end
end)
In order to make sure the player's key press is accounted for on the Server, I used a Remote Event in Replicated Storage named "Remote Event"
For this example, the difference between the criminal and the police is the Team Color
Using a Weld on the players will make them move with each other, and since we want the criminal to be unable to move, we set their humanoid properties to 0 on the server (then the police can drag the person where they like).
Pressing "E" in this example sets off the event to both arrest and release the criminal.
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
Not a requesting site
So when the person cuffs another you want the cuffed person to be unable to move themselves and the police person to force the other player to move?
Make the player cuffed walkspeed 0 and jump power 0, you can then use repeat CFrame to position the player where the officer is until the officer releases the criminal or whatev