Detained player can control the user

https://gyazo.com/8b95ad60bfc77d36431850aa0f8211e2

I am making a detain tool however when the player is older than the other player then the other player can control the player, I need to reset in order to control the other player without lag.

I was thinking if theres a way to make the other player completely weightless in order for the player to control the other player wether its young or not.

WeldConstraint.Part0 = Tool.Handle
WeldConstraint.Part1 = Target.HumanoidRootPart

I have tried using a while loop and RunService but it has a delay.

Which RunService event did you use? They all run at different times during a frame, so it may be helpful to play around with all three and see if any of the others work better.

Here’s a helpful chart which shows what event runs when:


(Since this is physics-related, I’d assume Stepped is the best choice.)

2 Likes

I used RenderStepped. is there a way to make the Players Part have no weight though. I tried setting massless to true but didnt work, I kinda prefer Welding but okay ill try each one of them.

Weird, RenderStepped should work fine too. This is probably related to how welding players can be weird due to Network Ownership. You could try setting the ownership of the detained player to nil (and setting it back once they’re free), but that might have other issues.

3 Likes

Wdym ownership of the detained player? Like

Target.PrimaryPart:SetNetworkOwnership(nil)

??

1 Like

Yeah, set the network ownership of each part of their character to nil, just like that. This makes it controlled by the server, which would hopefully get rid of the delay you were talking about.

2 Likes

In the humanoid of the player, there is a property called “PlatformStand” Enabling that on the detained player should fix all of your issues. There is no need to set the player to massless. However, you do need to set the network owner of the detained player to the detaining player. Do not forget when you release the detained player, to reset the network ownership as well.

2 Likes

Is that for welding or RunService?

That does not have anything to do with RunService. The only thing with the weld that you have to worry about is network ownership. I have found that when using a weld, ensure that you change the network ownership before messing with the weld. For example. If you are welding the player to another player. Set the network ownership of the detained player to nil before doing anything else. That should cause it to not lag while moving the detained player.

1 Like