I am working on a project that is like a waiting simulator, and I need this code!
Thanks!
I am working on a project that is like a waiting simulator, and I need this code!
Thanks!
Hi promaster1111,
Players > Player > PlayerScripts > CameraScript
###Just disable that script. So, the code would look something like this:
####Local Script Inside StarterGui
local players = game:GetService("Players");
local player = players.LocalPlayer;
local cam_script = player:WaitForChild("PlayerScripts"):WaitForChild("CameraScript");
cam_script.Disabled = true;
###As for how to make players sit in a seat, I recommend disabling the control script, so that players can't control the Character, and then teleporting them to the seat. So, the ControlScript is located in PlayerScripts as well. It's specific location is:
Players > Player > PlayerScripts > ControlScript
###Just disable that script and you should be able to restrict the Players' movement, and then you just teleport the player to the seat using CFrame. Here's how it would look in code.
####Local Script Inside StarterGui
local players = game:GetService("Players");
local player = players.LocalPlayer;
local char = player.Character or player.CharacterAdded:Wait();
local root = char:WaitForChild("HumanoidRootPart");
local seat = workspace.Seat; -- This is the seat.
local control_script = player:WaitForChild("PlayerScripts"):WaitForChild("ControlScript");
control_script.Disabled = true;
root.CFrame = seat.CFrame;
##Hope I helped and have a wonderful day/night.
Thanks,
Best regards,
~~ KingLoneCat
This discussion is preserved as it was. New answers, comments, and votes are closed.
8 comments
Btw, if you want to allow players to be able to move again and move their camera, just make the scripts' Disabled property false.
Good answer.
Thanks.
Thanks!
No problem.
Wait, should local seat = workspace.Seat; have a capital W?
Wait, YOU SPELLED MY NAME WRONG?! I'M SO MAD RIGHT NOW! YOU FORGOT A 1!
Never use capital W when addressing just the workspace. You don't need to use it unless you're doing like game.Workspace. But, you can just say workspace. Also, sorry for the misspell. Usually I use the first part of peoples' name not the whole thing.