ContextActionService Freezes all Player controls in the server?
Hello.
I am currently making a block where if it is hit, it freezes the charater controls and makes the player move. This does work however it disables controls for every other player in the server. I have been attempting to fix this for hours but I had absolutely 0 luck.
Here is the script I am using:
02 | local ContextActionService = game:GetService( "ContextActionService" ) |
04 | local Players = game:GetService( "Players" ) |
09 | local AutoWalk = workspace.Map.Rooms.Downstairs [ "Room 1" ] .AutoWalk_Stairs |
11 | local FreezeCharacter = "DisengageControls" |
14 | local DestinationPoint = Vector 3. new(- 20.209 , 3.29 , - 480.929 ) |
19 | local function AutoWalkOnTouch(CharacterBodyPart) |
20 | local Humanoid = CharacterBodyPart.Parent:FindFirstChildWhichIsA( "Humanoid" ) |
22 | if not (Debounce) then |
25 | Humanoid.JumpPower = 0 |
27 | ContextActionService:BindAction( |
31 | return Enum.ContextActionResult.Sink |
35 | unpack (Enum.PlayerActions:GetEnumItems()) |
38 | Humanoid:MoveTo(DestinationPoint) |
40 | ContextActionService:UnbindAction(FreezeCharacter) |
49 | AutoWalk.Touched:Connect(AutoWalkOnTouch) |
If anybody could help me with this, it would be great.
Thanks