Cuff system optimalization

Hi yall! I have made a handcuff sytem by welding two players together. But this dosen’t work properly because the cuffed player can still move his character so it created weird laggy effect.

Today I readed this forum post about using CFRAMES and teleport the cuffed infront the police officer again and again.

But they discussed performance here and using client side instead of server side however they didnt come to simple conclusion, what is to better use for performance.

Because teleporting player infront another player could be a demanding task while in loop.
Multiply the loop by amount of police officer in the game and you got a lag dissaster. And I want to use the teleporting system on things like stretcher and spine board.

Is there anyone that know anything about my problem? And how to implement the cframe teleportation for best performance? Thanks.

you can fix the moving method with the weld cuff by setting the cuffed players humanoid.PlatformStand to true

1 Like

I did that but the cuffed player can still affect the officer movement.

maybe try to set cuffed player walkspeed & jumppower to 0

Set Humanoid.AutoRotate to false

I would say you have two main options here, both would work.

Option 1 is to lock movement by disabling humanoid properties

humanoid.WalkSpeed = 0
humanoid.JumpPower = 0
humanoid.AutoRotate = false
humanoid.PlatformStand = true

Option 2 is to disable the players input module

local Players = game:GetService("Players")
local player = Players.LocalPlayer

local PlayerModule = require(player:WaitForChild("PlayerScripts"):WaitForChild("PlayerModule"))
local Controls = PlayerModule:GetControls()
Controls:Disable()