Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would I move a player to a certain point without letting him control the player?

Asked by
shakran 23
8 years ago

Like I know how to move the player using player.Character.Humanoid:moveto() but how can I move the player without letting him interfere. For example if I move a player to a brick using the function. The user controling the player can break out of it by going in a different direction. I want to stop the user from controling his/her player until he reaches that certain brick. How would I do this?

1
You could possibly disable the control script in the Player's PlayerScripts until the player reaches the part, then enable the script again. theofficialsy 36 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

I'm guessing something like...

01wait(0.5)
02local PlayerService = game:GetService("Players")
03local Player = PlayerService.LocalPlayer
04local ControlScript = Player.PlayerScripts:WaitForChild("ControlScript")
05local MasterControl = ControlScript:WaitForChild("MasterControl")
06function DCS () --Disable Control Scripts
07    ControlScript.Disabled = true
08    MasterControl.Disabled = true
09    for_,v in pairs (MasterControl:GetChildren())
10        v.Disabled = true
11    end
12end
13 
14function ECS () --Enable Control Scripts
15    ControlScript.Disabled = false
16    MasterControl.Disabled = false
17    for_,v in pairs (MasterControl:GetChildren())
18        v.Disabled = false
19    end
20end

should work, if it does, accept the answer :p

Ad

Answer this question