Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local plr = game:GetService("Players").LocalPlayer
- local Char = script.Parent
- local FirstJump = false
- local SecondJump = false
- local JumpForce = Char.Humanoid.JumpPower
- local mouse = plr:GetMouse()
- ---[[DISABLE_PLAYER_JUMP_ABILITY]]--- --This section simply disabled the player's ability to jump.
- function ResetEvent()
- Event2 = Char.Humanoid.Changed:Connect(function(prop)
- if prop == "Jump" then
- Char.Humanoid.Jump = false
- ResetEvent()
- Event2:Disabled
- end
- end)
- end
- Event = Char.Humanoid.Changed:Connect(function(prop)
- if prop == "Jump" then
- Char.Humanoid.Jump = false
- ResetEvent()
- Event:Disabled
- end
- end)
- ---[[END_DISABLE_PLAYER_JUMP_ABILITY_BLOCK]]---
- plr:GetService("UseInputService").InputBegan:Connect(function(input)
- if input = 32 then
- if SecondJump == false then
- if FirstJump == false then
- local CF = CFrame.new(Char.Torso.Position, mouse.hit.p)
- local LookVector = CF.lookVector
- Char.Torso.Velocity = LookVector * JumpForce
- FirstJump = true
- Event = Char["Right Leg"].Touched:Connect(function(part)
- if part ~= Char.Torso or part ~= Char["Left Leg"] or part ~= Char["Right Arm"] or part ~- Char["Left Arm"] then
- FirstJump = false
- SecondJump = false
- Event:Disconnect()
- end
- end)
- elseif FirstJump == true and SecondJump == false then
- local CF = CFrame.new(Char.Torso.Position, mouse.hit.p)
- local LookVector = CF.lookVector
- Char.Torso.Velocity = LookVector * JumpForce
- SecondJump = true
- Event2 = Char["Right Leg"].Touched:Connect(function(part)
- if part ~= Char.Torso or part ~= Char["Left Leg"] or part ~= Char["Right Arm"] or part ~= Char["Left Arm"] then
- SecondJump = false
- FirstJump = false
- Event2:Disconnect()
- end
- end)
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement