Advertisement
Nitrobullet

Helicopter Script - EthanComputerMad

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