Help with a detain system

Hey developers! I am currently creating a handcuff/detain system in which a player can be moved by another player without the cuffed player having any control. But, I can’t seem to figure out how to accomplish making the player stay in front of the detainer and move smoothly on both the server and the client.

I’ve looked at some already-made tools in the toolbox doing this but the only issue with these is that it’s very buggy and disorganized so to speak.

Any help or suggestions would be much appreciated, thanks!

6 Likes

Hi!

What I recommend is using the RenderStepped function and putting in an if statement inside to detect if a player is cuffed or not. If a player cuffs another player, get the cuffed player’s HumanoidRootPart and equal it to the cuffer’s HumanoidRootPart plus however distance you want to make it (the distance between the cuffed and the cuffer). This should be a server script so it updates for everyone in the game.

Let me know if you have any questions!

You could maybe set the network ownership of the player who is being detained to the player who is detaining, then give back network ownership to the original owner when exiting the handcuffs. I believe it would improve the syncronization.

How could I use this with Tiom’s suggestion?