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
7 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 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago

I'm guessing something like...

wait(0.5)
local PlayerService = game:GetService("Players")
local Player = PlayerService.LocalPlayer
local ControlScript = Player.PlayerScripts:WaitForChild("ControlScript")
local MasterControl = ControlScript:WaitForChild("MasterControl")
function DCS () --Disable Control Scripts
    ControlScript.Disabled = true
    MasterControl.Disabled = true
    for_,v in pairs (MasterControl:GetChildren())
        v.Disabled = true
    end
end

function ECS () --Enable Control Scripts
    ControlScript.Disabled = false
    MasterControl.Disabled = false
    for_,v in pairs (MasterControl:GetChildren())
        v.Disabled = false
    end
end

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

Ad

Answer this question