Advertisement
Herobrinekid2

Double jump

Jan 25th, 2022
1,220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.80 KB | None | 0 0
  1. local H = script.Parent:WaitForChild("Humanoid")
  2. local Context = game:GetService("ContextActionService")
  3.  
  4. local Jumped = 0
  5.  
  6.  
  7.  
  8. game:GetService("UserInputService").InputBegan:Connect(function(I)
  9.     if I.KeyCode == Enum.KeyCode.Space then
  10.    
  11.         if H:GetState() == Enum.HumanoidStateType.Freefall then
  12.            
  13.             script.Parent.HumanoidRootPart.Velocity = script.Parent.HumanoidRootPart.CFrame.upVector * 60
  14.            
  15.             local C = game.ReplicatedStorage.Part:Clone()
  16.             C.Position = script.Parent.UpperTorso.Position + Vector3.new(0, - 3, 0)
  17.             C.Parent = game.Workspace
  18.            
  19.             script["boing sound effect!!"]:Play()
  20.            
  21.             task.spawn(function()
  22.                 C.ParticleEmitter.Enabled = true
  23.                 task.wait(.2)
  24.                 C.ParticleEmitter.Enabled = false
  25.             end)
  26.            
  27.             task.wait(.5)
  28.             C:Destroy()
  29.            
  30.         end
  31.        
  32.     end
  33. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement