View difference between Paste ID: ajBP66Hb and 3gR7UuqW
SHOW: | | - or go back to the newest paste.
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
9+
speed = 3
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"
21+
m.MeshId = "http://www.roblox.com/asset/?id=430342962"
22-
m.Scale = Vector3.new(5, 5, 5)
22+
m.Scale = Vector3.new(1, 1, 1)
23-
m.TextureId = "http://www.roblox.com/asset/?id=70264191"
23+
m.TextureId = "http://www.roblox.com/asset/?id=102396382"
24
return p
25
end
26
pl = game.Players.LocalPlayer
27
cam = game.Workspace.CurrentCamera
28
mouse = pl:GetMouse()
29
pcall(function() game.Workspace[pl.Name .. "Heli"]:Destroy() end)
30
loadheli()
31
heli = game.Workspace[pl.Name .. "Heli"]
32
mf = false
33
mb = false
34
tl = false
35
tr = false
36
gu = false
37
gd = false
38
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
39
if mb == true then h.CFrame = h.CFrame * CFrame.new(0, 0, speed) end
40
if tl == true then h.CFrame = h.CFrame * CFrame.Angles(0, turnspeed, 0) end
41
if tr == true then h.CFrame = h.CFrame * CFrame.Angles(0, 0 - turnspeed, 0) end
42
if gu == true then h.CFrame = h.CFrame + Vector3.new(0, vspeed, 0) end
43
if gd == true then h.CFrame = h.CFrame + Vector3.new(0, 0 - vspeed, 0) end
44
end
45
end
46
end)
47
coroutine.resume(movement, heli)
48
h = Instance.new("Hint", game.Workspace)
49
h.Text = ""
50
candosmoke = false
51
spos = nil
52
spos3 = nil
53
pcall(function() spos = game.Workspace.Base.CFrame spos3 = game.Workspace.Base.Position base = game.Workspace.Base candosmoke = true end)
54
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
55
 
56
if candosmoke == false then else
57
smoke = coroutine.create(function(h, b)
58
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
59
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
60
if h.Position.y < spos3.y + 15 then
61
for i= 1, 8 do wait() h[i .. "s"]:GetChildren()[1].Enabled = true end else
62
for i= 1, 8 do wait() h[i .. "s"]:GetChildren()[1].Enabled = false end end
63
end end)
64
coroutine.resume(smoke, heli, base)
65
end
66
mchar = coroutine.create(function(c)
67
while true do wait() if isinheli == true then pcall(function()
68
c.Torso.Anchored = true
69
c.Torso.CFrame = heli.CFrame * CFrame.new(0, -1.8, -8)
70
end) end end end)
71
coroutine.resume(mchar, pl.Character)
72
dawooh = coroutine.create(function()
73
while true do wait() if isinheli == true then else
74
mf = false
75
mb = false
76
tl = false
77
tr = false
78
gu = false
79
gd = false
80
ucs = false end end end)
81
coroutine.resume(dawooh)
82
cam.CameraSubject = heli
83
cam.CameraType = Enum.CameraType.Track
84
cam.FieldOfView = 80
85
mouse.KeyDown:connect(function(key)
86
k = string.byte(key)
87
if k == 17 then --[[Up arrow]]
88
mf = true
89
end
90
if k == 18 then --[[Down arrow]]
91
mb = true
92
end
93
if k == 20 then --[[Left arrow]]
94
tl = true
95
end
96
if k == 19 then --[[Right arrow]]
97
tr = true
98
end
99
if key == "w" then
100
gu = true
101
end
102
if key == "s" then
103
gd = true
104
end
105
end)
106
 
107
mouse.KeyUp:connect(function(key)
108
k = string.byte(key)
109
if k == 17 then --[[Up arrow]]
110
mf = false
111
end
112
if k == 18 then --[[Down arrow]]
113
mb = false
114
end
115
if k == 20 then --[[Left arrow]]
116
tl = false
117
end
118
if k == 19 then --[[Right arrow]]
119
tr = false
120
end
121
if key == "w" then
122
gu = false
123
end
124
if key == "s" then
125
gd = false
126
end
127
end)
128
occupied = false
129
ucs = false
130
heli.Touched:connect(function(c)
131
if c.Parent.Name == pl.Name then
132
isinheli = true
133
else
134
if occupied == false then else return end
135
if c.Parent:FindFirstChild("Humanoid") ~= nil then else return end
136
occupied = true
137
ucs = true
138
while ucs == true do wait()
139
pcall(function() c.Parent.Torso.Anchored = true c.Parent.Torso.CFrame = heli.CFrame end) end
140
pcall(function()
141
c.Parent.Torso.CFrame = c.Parent.Torso.CFrame * CFrame.Angles(0, math.pi / 2, 0)
142
c.Parent.Torso.CFrame = c.Parent.Torso.CFrame * CFrame.new(0, 0, 0 - 7)
143
c.Parent.Torso.Anchored = false
144
occupied = false
145
end)
146
end
147
end)
148
 
149
pl.Chatted:connect(function(msg)
150
lmsg = string.lower(msg)
151
if lmsg == "eject" then ucs = false end
152
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
153
cam.CameraSubject = pl.Character.Head
154
cam.CameraType = Enum.CameraType.Track end
155
end)