Advertisement
_James

Hoverpad

Jul 23rd, 2017
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.32 KB | None | 0 0
  1. local RunService = game:GetService("RunService")
  2. local UIS = game:GetService("UserInputService")
  3. local Camera = workspace.CurrentCamera
  4.  
  5. local V3 = Vector3.new
  6.  
  7. local Client = game.Players.LocalPlayer
  8. local Appearance = Client.Character or Client.CharacterAdded:wait()
  9. local Humanoid = Appearance:WaitForChild("Humanoid")
  10. local Torso = Appearance:WaitForChild("HumanoidRootPart")
  11. local Locked = false
  12. local Pad
  13.  
  14. function createpad()
  15.     Pad             = Instance.new("Part")
  16.     Pad.Name        = "Hover Pad"
  17.     Pad.BrickColor  = BrickColor.White()
  18.     Pad.CFrame      = Torso.CFrame - V3(0,3,0)
  19.     Pad.Size        = V3(6.2, .2, 6.2)
  20.     Pad.Anchored    = true
  21.     Pad.CanCollide  = false
  22.     Pad.Material    = "Neon"
  23.     Pad.Parent      = Camera
  24.    
  25.     stand               = Instance.new("Part")
  26.     stand.Transparency  = 1
  27.     stand.Anchored      = true
  28.     stand.CanCollide    = true
  29.     stand.Size          = V3(3, .4, 3)
  30.     stand.Parent        = Pad
  31.    
  32.     Instance.new("CylinderMesh", Pad)
  33. end
  34.  
  35. UIS.InputBegan:connect(function(Input, Chatting)
  36.     if Input.KeyCode == Enum.KeyCode.Space and not Chatting then
  37.         press = true
  38.         Locked = false
  39.         game.Debris:AddItem(Pad, 0)
  40.        
  41.         bv = Torso:FindFirstChild("BodyVelocity")
  42.         if not bv then
  43.             bv=Instance.new("BodyVelocity", Torso)
  44.             bv.Velocity=Vector3.new(0,105,0)
  45.             bv.MaxForce=Vector3.new(0,10^4,0)
  46.         end
  47.         repeat wait() until not press
  48.         bv:Destroy()
  49.     end
  50. end)
  51.  
  52. UIS.InputBegan:connect(function(Input, Chatting)
  53.     if Input.KeyCode == Enum.KeyCode.E and not Chatting then
  54.         Locked = true
  55.         game.Debris:AddItem(bv, 0)
  56.         if Torso then
  57.             local Height    = Torso.Position.Y
  58.             local BP        = Instance.new("BodyPosition")
  59.             BP.MaxForce     = V3(0, 10^9, 0)
  60.             BP.Position     = V3(0, Height, 0)
  61.             BP.Parent       = Torso
  62.             game.Debris:AddItem(Pad, 0)
  63.             createpad()
  64.            
  65.             repeat RunService.RenderStepped:wait()
  66.                 local Pos       = Torso.Position
  67.                 local Pos       = Pos - V3(0, 3.2, 0)
  68.                 Pad.CFrame      = CFrame.new(Pos)
  69.                 stand.CFrame    = CFrame.new(Pos)
  70.             until not Locked
  71.             BP:Destroy()
  72.         end
  73.     end
  74. end)
  75.  
  76. UIS.InputBegan:connect(function(Input, Chatting)
  77.     if Input.KeyCode == Enum.KeyCode.R and not Chatting then
  78.         Locked = not Locked
  79.     end
  80. end)
  81.  
  82. UIS.InputEnded:connect(function(Input, Chatting)
  83.     if Input.KeyCode == Enum.KeyCode.Space and not Chatting and press then
  84.         press = false
  85.         if not Locked then
  86.             game.Debris:AddItem(Pad, 0)
  87.         end
  88.     end
  89. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement