Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --To you this script make a local script and put it in starterGUI
- --[[
- Put me in StarterGui or StarterPack :)
- ]]
- local Player = game.Players.LocalPlayer
- repeat wait() until Player.Character -- Yield until the Player's Character is no longer nil
- local Character = Player.Character
- local Humanoid = Character:WaitForChild("Humanoid")
- local UserInputService = game:GetService("UserInputService")
- local currentJump
- local debounce = true
- local DoubleJumpVelocity = 100 -- 50 is a normal ROBLOX jump
- function jumpRayDown()
- local nR = Ray.new(Character.Torso.Position,Vector3.new(0,-1,0).unit*4)
- local hR,pR=game.Workspace:FindPartOnRay(nR,Character)
- if hR~=nil then
- return true
- end
- return false
- end
- Humanoid.Changed:connect(
- function(Property)
- if Property == "Jump" and debounce == true and Humanoid.Sit==false then
- currentJump=true
- debounce = false
- newConnection = Player:GetMouse().KeyDown:connect(function(key)
- if key:lower():byte()==32 and currentJump and Character.Torso.Velocity.y>-30 then
- currentJump=false
- for i, v in pairs(Character:GetChildren()) do
- if v:isA("BasePart") then
- v.Velocity = Vector3.new(v.Velocity.x,DoubleJumpVelocity,v.Velocity.z)
- end
- end
- end
- end)
- spawn(function()
- repeat wait() until jumpRayDown()==true
- debounce = true
- currentJump = false
- if type(newConnection)=="function" then
- newConnection:disconnect()
- end
- end)
- elseif Property == "Jump" and Humanoid.Sit==true then
- Humanoid.Jump=false
- end
- end
- )
Add Comment
Please, Sign In to add comment