I am trying trying to Disable the Jump for the character, but I am not totally sure how I can, so I tried doing this;
1 | plr = game:service( "Players" ).LocalPlayer |
2 | repeat wait( 0 ) until plr.Character~ = nil |
3 | function oc() |
4 | plr.Character:FindFirstChild( "Humanoid" ).Jump = false |
5 | end |
6 | plr.Character.Jumping:connect(oc) |
Did I do it correctly or does it not work?
01 | function OnEntered(Player) |
02 | while Player.Character = = nil do |
03 | wait() |
04 | end |
05 | end |
06 | function OnRespawned(Character) |
07 | local Torso = Character:findFirstChild( "Torso" ) |
08 | if Torso ~ = nil then |
09 | local AntiJump = Instance.new( "BodyPosition" ) |
10 | AntiJump.Parent = Torso |
11 | AntiJump.position = Vector 3. new ( 0 , 6 , 0 ) |
12 | AntiJump.maxForce = Vector 3. new ( 0 , 10000000000 , 0 ) |
13 | end |
14 | end |
15 | game.Players.ChildAdded:connect(OnEntered) |
16 | game.Workspace.ChildAdded:connect(OnRespawned) |
OR just put this in a LocalScript inside the PlayerGui
1 | return wait() until game.Players.LocalPlayer.Character.Humanoid |
2 | game.Players.LocalPlayers.Character.Humanoid.Changed:connect( function () |
3 | game.Players.LocalPlayers.Character.Humanoid.Jump = false |
4 | end ) |
Much simpler.