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

How to make a seat that makes the player stand instead of sit?

Asked by
par1d 19
4 years ago

I'm wondering how you'd make a seat that doesn't make the player sit, but instead keep the player standing. e.g. for train drivers. How would I do this?

1 answer

Log in to vote
2
Answered by 4 years ago

You will have to use a way to put the player into the "driving train state" e.g pressing a button or touching a brick.

You will then have to freeze the player. I use this but it's not recommended because when roblox changes their control modules (the modules that the player uses to control their character and camera) then the whole thing would break but this is the only way that works for me, so be careful when you are using it:

local MasterControl = require(game.Players.LocalPlayer:WaitForChild("PlayerScripts")
    :WaitForChild("PlayerModule"):WaitForChild("ControlModule"))

MasterControl:Enable()  -- this will enable it. which it already is by default

MasterControl:Disable() -- this will disable it

You can add more stuff like making sure the character is in the right CFrame (just add a brick that will be the reference for when the player is in the "train driving state" like a brick looking at the driving wheel) and maybe making sure the player is not sitting etc.

And don't forget to get make a way of disabling that state (important thing to note is that disabling ControlModule will also disable jumping).

You will then be listening to input when the player is in the "driving state" and apply forces (or however you move the train) but that's out of the scope of this answer.

Ad

Answer this question