To be exact, I need to detect if a player is seated the makes a function to cause cursor (CursorFreed) and after that, how to detect if player is not seated which cause to bring back locked first person again, similar to onTouch and TouchEnded. Some advice here?
How to make Seated function that makes cursor moves freely in first person?
1 answer
So, the easist way to do this is using a custom camera script, and using the humaniod's seated property
http://wiki.roblox.com/index.php?title=API:Class/Humanoid/Seated http://wiki.roblox.com/index.php?title=Camera_manipulation
So this is what you do. Create a script that using the .changed event to detect when the seated property of a humanoid is changed. Then check if the seated property is true. If so copy a script from somewhere where it wont work (maybe player gui) and put it into the player.
The script will be a script that makes the camera stay in the players head. This will give a first person perspective and let the player move the cursor.
Now, when the .changed event is fired and humanoid.seated = false, then set the camera's camera type back to default so that the player can use roblox's default camera behavior
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
No, no.... Use a .Changed event on the Seat itself. Then, check if the property is "Occupant" and if it is, then that means that somebody has either gotten up or sat down. To check that just simply check if "Occupant" == nil and if it doesn't equal nil, then that means someone has just sat down... Otherwise, someone just got up...
thanks
Oh whoops XD. I always forget that you dont use .Changed on the actual property, but what i'm trying to do is asumming this is all made in a local script