How should I make a handcuff system that detains a player?

How should I make a handcuff system that detains a player? I want the player to get welded to the one who handcuffs him. Which option would be better?

Option1: When the player clicks with handcuffs equipped check the Mouse.Target (local script), if he has a humanoid (check with the local script), weld it to the player who clicked him with a remote event

Option2: When the player clicks with handcuffs equipped check the Mouse.Target with a Remote Function, if he has a Humanoid return true or something, another Remote Event to weld him to the player who cuffed him.

Which option would work? Or does one of them even work? Thank you!

2 Likes

When clicked with handcuffs fire a remote event with the mouse.Target, on the server check if the player that sent the request is actually eligible to do such action and check if they actually have the tool or whatever you’re using.

On the server after confirming that they’re allowed to do that action, give network ownership of the target to the player that’s making the action (target.Character.PrimaryPart:SetNetworkOwner(actionMaker)), then either keep on cframing or like you said weld it to the player.

That’s what I could think of right now.

4 Likes

Make sure if you set network ownership, you give the player back their network ownership after they’re done getting dragged around by the handcuffs to prevent big input lag.

2 Likes

I perfer using animations then welds as its quicker, more easy, etc overall better and easy to change them if you dislike something.

3 Likes

What do you mean? Don’t you need to like weld him to the player or something? What do you mean with animations?

Would Humanoid:MoveTo(HandcufferPosition * CFrame.new(0,10,0) or something like that not be better?

2 Likes