MrWiggles1029

ROBLOX Helicopter

Sep 2nd, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.01 KB | None | 0 0
  1. --[[Helicopter - Made 100% by EthanComputerMad - Prototype
  2. THIS IS A LOCALSCRIPT
  3. COMMANDS:
  4. SAY EJECT TO EJECT YOUR PASSENGER
  5. SAY LEAVE TO GET OUT
  6. TO GET IN OR LET A PASSENGER IN APPROACH THE MIDDLE OF THE HELICOPTER
  7. ]]
  8. wait(1)
  9. speed = 1
  10. turnspeed = math.pi / 90
  11. vspeed = 1
  12. isinheli = true
  13. function loadheli()
  14. p = Instance.new("Part", game.Workspace)
  15. p.Name = game.Players.LocalPlayer.Name .. "Heli"
  16. p.Anchored = true
  17. p.CFrame = CFrame.new(game.Players.LocalPlayer.Character.Torso.CFrame.X, game.Players.LocalPlayer.Character.Torso.CFrame.Y, game.Players.LocalPlayer.Character.Torso.CFrame.Z) + Vector3.new(0, 30, 0)
  18. p.Size = Vector3.new(6, 2.4, 5)
  19. m = Instance.new("SpecialMesh", p)
  20. m.MeshType = Enum.MeshType.FileMesh
  21. m.MeshId = "http://www.roblox.com/asset/?id=70264208"
  22. m.Scale = Vector3.new(5, 5, 5)
  23. m.TextureId = "http://www.roblox.com/asset/?id=70264191"
  24. return p
  25. end
  26. pl = game.Players.LocalPlayer
  27. mouse = pl:GetMouse()
  28. pcall(function() game.Workspace[pl.Name .. "Heli"]:Destroy() end)
  29. loadheli()
  30. heli = game.Workspace[pl.Name .. "Heli"]
  31. mf = false
  32. mb = false
  33. tl = false
  34. tr = false
  35. gu = false
  36. gd = false
  37. movement = coroutine.create(function(h) while true do wait() if isinheli == true then if mf == true then h.CFrame = h.CFrame * CFrame.new(0, 0, 0 - speed) end
  38. if mb == true then h.CFrame = h.CFrame * CFrame.new(0, 0, speed) end
  39. if tl == true then h.CFrame = h.CFrame * CFrame.Angles(0, turnspeed, 0) end
  40. if tr == true then h.CFrame = h.CFrame * CFrame.Angles(0, 0 - turnspeed, 0) end
  41. if gu == true then h.CFrame = h.CFrame + Vector3.new(0, vspeed, 0) end
  42. if gd == true then h.CFrame = h.CFrame + Vector3.new(0, 0 - vspeed, 0) end
  43. end
  44. end
  45. end)
  46. coroutine.resume(movement, heli)
  47. h = Instance.new("Hint", game.Workspace)
  48. h.Text = ""
  49. candosmoke = false
  50. spos = nil
  51. spos3 = nil
  52. pcall(function() spos = game.Workspace.Base.CFrame spos3 = game.Workspace.Base.Position base = game.Workspace.Base candosmoke = true end)
  53. if spos == nil then pcall(function() spos = game.Workspace["CLWorldFile - Really dont remove"].Base.CFrame spos3 = game.Workspace["CLWorldFile - Really dont remove"].Base.Position base = game.Workspace["CLWorldFile - Really dont remove"].Base candosmoke = true end) end
  54.  
  55. if candosmoke == false then else
  56. smoke = coroutine.create(function(h, b)
  57. for i= 1, 8 do p = Instance.new("Part", h) p.Anchored = true p.CanCollide = false p.Transparency = 1 p.Name = i .. "s" s = Instance.new("Smoke", p) s.Enabled = false s.RiseVelocity = 5 s.Opacity = 0.3 s.Color = Color3.new(153 / 255, 102 / 255, 51 / 255) s.Name = "S" end
  58. while true do wait() for i= 1, 8 do h[i .. "s"].CFrame = CFrame.new(Vector3.new(h.Position.x, b.Position.y, h.Position.z)) * CFrame.Angles(math.pi / 2, 0, math.pi / 4 * (i - 1)) end
  59. if h.Position.y < spos3.y + 15 then
  60. for i= 1, 8 do wait() h[i .. "s"]:GetChildren()[1].Enabled = true end else
  61. for i= 1, 8 do wait() h[i .. "s"]:GetChildren()[1].Enabled = false end end
  62. end end)
  63. coroutine.resume(smoke, heli, base)
  64. end
  65. mchar = coroutine.create(function(c)
  66. while true do wait() if isinheli == true then pcall(function()
  67. c.Torso.Anchored = true
  68. c.Torso.CFrame = heli.CFrame * CFrame.new(0, -1.8, -8)
  69. end) end end end)
  70. coroutine.resume(mchar, pl.Character)
  71. dawooh = coroutine.create(function()
  72. while true do wait() if isinheli == true then else
  73. mf = false
  74. mb = false
  75. tl = false
  76. tr = false
  77. gu = false
  78. gd = false
  79. ucs = false end end end)
  80. coroutine.resume(dawooh)
  81. mouse.KeyDown:connect(function(key)
  82. k = string.byte(key)
  83. if k == "w" then --[[Up arrow]]
  84. mf = true
  85. end
  86. if k == "s" then --[[Down arrow]]
  87. mb = true
  88. end
  89. if k == "a" then --[[Left arrow]]
  90. tl = true
  91. end
  92. if k == "d" then --[[Right arrow]]
  93. tr = true
  94. end
  95. if key == 17 then
  96. gu = true
  97. end
  98. if key == 18 then
  99. gd = true
  100. end
  101. end)
  102.  
  103. mouse.KeyUp:connect(function(key)
  104. k = string.byte(key)
  105. if k == "w" then --[[Up arrow]]
  106. mf = false
  107. end
  108. if k == "s" then --[[Down arrow]]
  109. mb = false
  110. end
  111. if k == "a" then --[[Left arrow]]
  112. tl = false
  113. end
  114. if k == "d" then --[[Right arrow]]
  115. tr = false
  116. end
  117. if key == 17 then
  118. gu = false
  119. end
  120. if key == 18 then
  121. gd = false
  122. end
  123. end)
  124. occupied = false
  125. ucs = false
  126. heli.Touched:connect(function(c)
  127. if c.Parent.Name == pl.Name then
  128. isinheli = true
  129. else
  130. if occupied == false then else return end
  131. if c.Parent:FindFirstChild("Humanoid") ~= nil then else return end
  132. occupied = true
  133. ucs = true
  134. while ucs == true do wait()
  135. pcall(function() c.Parent.Torso.Anchored = true c.Parent.Torso.CFrame = heli.CFrame end) end
  136. pcall(function()
  137. c.Parent.Torso.CFrame = c.Parent.Torso.CFrame * CFrame.Angles(0, math.pi / 2, 0)
  138. c.Parent.Torso.CFrame = c.Parent.Torso.CFrame * CFrame.new(0, 0, 0 - 7)
  139. c.Parent.Torso.Anchored = false
  140. occupied = false
  141. end)
  142. end
  143. end)
  144.  
  145. pl.Chatted:connect(function(msg)
  146. lmsg = string.lower(msg)
  147. if lmsg == "eject" then ucs = false end
  148. if lmsg == "leave" then isinheli = false pl.Character.Torso.CFrame = pl.Character.Torso.CFrame * CFrame.Angles(0, math.pi / 2, 0) pl.Character.Torso.CFrame = pl.Character.Torso.CFrame * CFrame.new(0, 0, 0 - 5) pl.Character.Torso.Anchored = false
  149. end)
Add Comment
Please, Sign In to add comment