Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Player = game:GetService'Players'.LocalPlayer;
- local UIS = game:GetService'UserInputService';
- _G.JumpHeight = 50;
- function Action(Object, Function) if Object ~= nil then Function(Object); end end
- UIS.InputBegan:connect(function(UserInput)
- if UserInput.UserInputType == Enum.UserInputType.Keyboard and UserInput.KeyCode == Enum.KeyCode.Space then
- Action(Player.Character.Humanoid, function(self)
- if self:GetState() == Enum.HumanoidStateType.Jumping or self:GetState() == Enum.HumanoidStateType.Freefall then
- Action(self.Parent.HumanoidRootPart, function(self)
- self.Velocity = Vector3.new(0, _G.JumpHeight, 0);
- end)
- end
- end)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement