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!
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.
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.