1 | local player = game.Players.LocalPlayer |
2 | humanoid = player.Character:WaitForChild( "Humanoid" ) |
3 | player.CameraMode = "LockFirstPerson" |
4 | player.CameraMaxZoomDistance = 0 |
5 | humanoid.Changed:connect( function () |
6 | if humanoid.Jump then |
7 | humanoid.Jump = false |
8 | end |
9 | end ) |
I have this in a LocalScript. It's supposed to disable the character jumping and lock them into First Person View, however it's very buggy online and sometimes won't work at all.
I'v found a few glitches with the script and fixed them up for you. It now locks the person into LockFirstPerson and disables jumping. Have it in a LocalScript inside StarterPack.
01 | local Player = game.Players.LocalPlayer |
02 | repeat wait() until Player.Character ~ = nil ; |
03 | local Character = Player.Character |
04 | local Humanoid = Character:WaitForChild( "Humanoid" ); |
05 |
06 | local LastJump = time(); |
07 | Humanoid.Changed:connect( function () |
08 | game:GetService( 'Players' ).LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson |
09 | if Humanoid.Jump then |
10 | Humanoid.Jump = false ; |
11 | end |
12 | end ) |
It's because you're too slow -__-. If you're checking if it's jumping then you're obviously too late to make it stop jumping.
1 | local player = game.Players.LocalPlayer |
2 | if not player.Character then player.CharacterAdded:wait() end |
3 | humanoid = player.Character:WaitForChild( "Humanoid" ) |
4 |
5 | player.CameraMode = "LockFirstPerson" |
6 | player.CameraMaxZoomDistance = 0 |
7 | humanoid.Changed:connect( function () |
8 | humanoid.Jump = false |
9 | end ) |