How can I make a script so two people are chained and linked together?

Greetings! I recently played a ROBLOX game titled “Death Penalty” and noticed an intriguing feature in a new mode. In this mode, two players are randomly selected and linked together. Intriguingly, if one player dies, the other follows suit. They are bound by a realistic chain, and if one player remains stationary while the other ventures far enough, the chain drags the stationary player along.

Could someone guide me on how to script such a mechanism?

1 Like

use wielding so that they can be glued to each other

2 Likes

Did you even read the topic above your reply?
:woman_facepalming:

1 Like

As Crxstle said, the chain between the player would just be made of a weld with a chain model, ropes, etc.

For the system you would probably use something like :GetPlayers() to get a table of current players, then randomly select 2 using something like math.random().

Then when one player dies one way to have the other player die at the same time would be using a BindableEvent to communicate that one player died and to kill the other player.

Hopefully this gave you a general idea on how to script the system you’re looking for!

3 Likes

If you just use a weld, you’ll end up with buggy movement as one client has network ownership over both characters. I personally have not tried anything like this myself, but creating the rope on each client seperately should keep things smooth between clients.

4 Likes

To prevent a network ownership mess (mentioned by the last reply), create a line between the players on the server and create a part. You can either make a chain that uses this part as reference or make it transparent and emit chain particles to give the illusion of a solid chain. Then just use the magnitude (distance between players) to bound them on the server side, maybe give a strong backwards force that matches their movement when they try to escape.

2 Likes