Advertisement
InTesting

(Local Script) Double Jump Testing

Jun 21st, 2019
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.98 KB | None | 0 0
  1. local char = owner.Character
  2. local hum = char:FindFirstChildWhichIsA'Humanoid'
  3. local lleg = char:FindFirstChild('Left Leg')
  4. local rleg = char:FindFirstChild('Right Leg')
  5. local player = owner
  6. local mouse = player:GetMouse()
  7. local head = char:FindFirstChild('Head')
  8.  
  9. local doublejump = true
  10.  
  11.  
  12. mouse.KeyDown:Connect(function(key)
  13.     if tonumber( string.byte(key) )==32 and hum.FloorMaterial==Enum.Material.Air and
  14.         hum:GetState()==Enum.HumanoidStateType.Freefall and doublejump==true and
  15.         workspace:FindFirstChild('∞jump',true)==nil then
  16.         local stop = false
  17.         doublejump = false
  18.         local part = Instance.new("Part",char)
  19.         part.Name = '∞jump'
  20.         part.Size = Vector3.new(4,4,4)
  21.         part.CFrame = head.CFrame + Vector3.new(0,-5.7,0)
  22.         part.Anchored = true
  23.         wait()
  24.        
  25.         if part then
  26.             part.CanCollide = false
  27.             part:Destroy()
  28.         end
  29.         while true do
  30.             wait(.1)
  31.             if hum.FloorMaterial~=Enum.Material.Air then
  32.                 doublejump = true
  33.                 break
  34.             end
  35.         end
  36.        
  37.     end
  38. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement