Advertisement
Guest User

Inf jump script

a guest
Aug 21st, 2020
21,483
1
Never
5
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.74 KB | None | 1 0
  1.  
  2. local Player = game:GetService'Players'.LocalPlayer;
  3. local UIS = game:GetService'UserInputService';
  4.  
  5. _G.JumpHeight = 50;
  6.  
  7. function Action(Object, Function) if Object ~= nil then Function(Object); end end
  8.  
  9. UIS.InputBegan:connect(function(UserInput)
  10.     if UserInput.UserInputType == Enum.UserInputType.Keyboard and UserInput.KeyCode == Enum.KeyCode.Space then
  11.         Action(Player.Character.Humanoid, function(self)
  12.             if self:GetState() == Enum.HumanoidStateType.Jumping or self:GetState() == Enum.HumanoidStateType.Freefall then
  13.                 Action(self.Parent.HumanoidRootPart, function(self)
  14.                     self.Velocity = Vector3.new(0, _G.JumpHeight, 0);
  15.                 end)
  16.             end
  17.         end)
  18.     end
  19. end)
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement