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

Is there a way to disable player control WITHOUT setting the WalkSpeed to 0?

Asked by 6 years ago

So, I've created a cutscene where players walk in, but I don't want them to DIRECTLY control the character, since I'm just using Humanoid:MoveTo() to walk them to the place I want them to go. But I've looked on many websites, and I can't seem to find a solution to this problem.

If anyone knows a solution to this, I would be happy to hear it.

Thanks!

0
0
So then all I would have to do to connect it back is to bind it back? NeonicPlasma 181 — 6y
0
Yep. For more info about this i would look at the Roblox scripts. User#5423 17 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

Hey PickUpTheBeat1,

What you are trying to do is very simple. All you need to do is just disable the ControlScript, which is located under PlayerScripts, which is under the Player. Then, you enable it when you want them to be able to control the character.

Here is an example:

local plrs = game:GetService("Players");
local plr = plrs.LocalPlayer;

function turn_it_off(plr)

    local plr_srps = plr:WaitForChild("PlayerScripts");
    local control = plr_srps:WaitForChild("ControlScript");

    control.Disabled = true;
end;

plrs.PlayerAdded:Connect(turn_it_off);

for _, player in next, plrs:GetPlayers() do
    turn_it_off(player);
end

Well, I hope I helped and have a nice day/night!

~~ KingLoneCat

0
Alright, thanks for the help! NeonicPlasma 181 — 6y
Ad

Answer this question