SHOW:
|
|
- or go back to the newest paste.
1 | -- Rideket | |
2 | -- @Acecateer | |
3 | ||
4 | -- Acecateer Rideket | |
5 | ||
6 | wait(0.5) | |
7 | ||
8 | --[[ Missile properties ]]-- | |
9 | local currentSpeed = 0 | |
10 | local ejectedSpeed = 0 | |
11 | local maxSpeed = 350 | |
12 | - | local increaseTime = 1 |
12 | + | local increaseTime = 0 |
13 | local increaseIncrement = 10 | |
14 | - | local decreaseTime = 350 |
14 | + | local decreaseTime = 0 |
15 | local decreaseIncrement = 15 | |
16 | local collisionSpeed = 100 | |
17 | local doPrints = false | |
18 | local Color = false | |
19 | local speedGauge = true | |
20 | ||
21 | local Player = game.Players.LocalPlayer | |
22 | local Mouse = Player:GetMouse() | |
23 | Mouse.TargetFilter = workspace | |
24 | local mousePos | |
25 | repeat wait() until Player.Character:IsDescendantOf(workspace) | |
26 | local Character = Player.Character | |
27 | repeat wait() until Character:FindFirstChild("Humanoid") | |
28 | local Humanoid = Character.Humanoid | |
29 | Humanoid:WaitForChild("Animator"):Destroy() | |
30 | ||
31 | -- Services | |
32 | local InputService = game:GetService("UserInputService") | |
33 | local RunService = game:GetService("RunService") | |
34 | ||
35 | -- Set up character variables | |
36 | local bodyParts = {} | |
37 | local Joints = {} | |
38 | ||
39 | local scanCharacter = function() | |
40 | Scan = function(Target) | |
41 | for _, child in pairs(Target:GetChildren()) do | |
42 | if child:IsA("Part") then | |
43 | bodyParts[child.Name] = child | |
44 | if #child:GetChildren() > 0 then | |
45 | Scan(child) | |
46 | end | |
47 | elseif child:IsA("Motor6D") then | |
48 | Joints[child.Name] = child | |
49 | end | |
50 | end | |
51 | end | |
52 | Scan(Character) | |
53 | end | |
54 | scanCharacter() | |
55 | ||
56 | local fromRootC0, fromRootC1 = Joints["RootJoint"].C0, Joints["RootJoint"].C1 | |
57 | local fromNeck = Joints["Neck"].C1 | |
58 | local fromLeftShoulder = Joints["Left Shoulder"].C1 | |
59 | local fromRightShoulder = Joints["Right Shoulder"].C1 | |
60 | local fromLeftHip = Joints["Left Hip"].C1 | |
61 | local fromRightHip = Joints["Right Hip"].C1 | |
62 | ||
63 | local Seat = Instance.new("Seat", Character) | |
64 | Seat.Transparency = 1 | |
65 | Seat.CanCollide = false | |
66 | Seat.FormFactor = Enum.FormFactor.Custom | |
67 | Seat.Size = Vector3.new(1, 0.5, 1) | |
68 | local seatWeld = Instance.new("Weld", Seat) | |
69 | seatWeld.Part0 = Seat | |
70 | seatWeld.Part1 = bodyParts["Torso"] | |
71 | seatWeld.C1 = CFrame.new(0, -0.8, 0) * CFrame.Angles(math.pi/2, 0, 0) | |
72 | ||
73 | local lastSeatChar | |
74 | local preLeftJoint, preRightJoint | |
75 | Seat.Changed:connect(function(Property) | |
76 | if Property == "Occupant" and Seat.Occupant then | |
77 | lastSeatChar = Seat.Occupant.Parent | |
78 | local Torso = lastSeatChar:FindFirstChild("Torso") | |
79 | if Torso then | |
80 | local LeftJoint = Torso["Left Hip"] | |
81 | local RightJoint = Torso["Right Hip"] | |
82 | preLeftJoint = LeftJoint.C1 | |
83 | preRightJoint = RightJoint.C1 | |
84 | LeftJoint.C1 = LeftJoint.C1 * CFrame.Angles(math.rad(25), 0, 0) | |
85 | RightJoint.C1 = RightJoint.C1 * CFrame.Angles(math.rad(25), 0, 0) | |
86 | end | |
87 | elseif not Seat.Occupant and lastSeatChar then | |
88 | local Torso = lastSeatChar:FindFirstChild("Torso") | |
89 | if Torso then | |
90 | local LeftJoint = Torso["Left Hip"] | |
91 | local RightJoint = Torso["Right Hip"] | |
92 | LeftJoint.C1 = preLeftJoint | |
93 | RightJoint.C1 = preRightJoint | |
94 | end | |
95 | end | |
96 | end) | |
97 | ||
98 | createMissile = function() | |
99 | local Ejected = false | |
100 | ||
101 | Humanoid.Jump = true; wait(0.3) | |
102 | ||
103 | local Missile = Instance.new("Part", Character) | |
104 | Missile.Name = "Missile" | |
105 | if Color then Missile.BrickColor = Color end | |
106 | Missile.FormFactor = Enum.FormFactor.Custom | |
107 | Missile.Size = Vector3.new(1.56, 1.37, 5.65) | |
108 | ||
109 | local Mesh = Instance.new("SpecialMesh", Missile) | |
110 | Mesh.MeshId = "http://www.roblox.com/asset/?id=103970395" | |
111 | if not Color then Mesh.TextureId = "http://www.roblox.com/asset/?id=103967643" end | |
112 | Mesh.Scale = Vector3.new(4, 4, 4) | |
113 | ||
114 | local EmitterPart = Instance.new("Part", Character) | |
115 | EmitterPart.Name = "SmokeEmitter" | |
116 | EmitterPart.CanCollide = false | |
117 | EmitterPart.Transparency = 1 | |
118 | EmitterPart.FormFactor = Enum.FormFactor.Custom | |
119 | EmitterPart.Size = Vector3.new(0.2, 0.2, 0.2) | |
120 | ||
121 | local EmitterWeld = Instance.new("Weld", Missile) | |
122 | EmitterWeld.Part0 = Missile | |
123 | EmitterWeld.Part1 = EmitterPart | |
124 | EmitterWeld.C0 = CFrame.Angles(math.pi/2, 0, 0) | |
125 | EmitterWeld.C1 = CFrame.new(0, -Missile.Size.Z/2, 0) | |
126 | ||
127 | local Smoke = Instance.new("ParticleEmitter", EmitterPart) | |
128 | Smoke.Enabled = false | |
129 | Smoke.Size = NumberSequence.new(0.8) | |
130 | Smoke.Texture = "rbxassetid://518532451" | |
131 | Smoke.Lifetime = NumberRange.new(0.5, 1) | |
132 | Smoke.Rate = 25 | |
133 | Smoke.Rotation = NumberRange.new(-15, 15) | |
134 | Smoke.RotSpeed = NumberRange.new(50) | |
135 | Smoke.Speed = NumberRange.new(5, 10) | |
136 | Smoke.VelocitySpread = 30 | |
137 | ||
138 | Joints["RootJoint"].C0 = fromRootC0 * CFrame.Angles(math.pi/2, 0, 0) | |
139 | Joints["RootJoint"].C1 = fromRootC1 * CFrame.new(0, 3, 0) | |
140 | local Weld = Instance.new("Weld", bodyParts["Torso"]) | |
141 | Weld.Part0 = bodyParts["Torso"] | |
142 | Weld.Part1 = Missile | |
143 | Weld.C0 = CFrame.new(0, 0, -1) | |
144 | Weld.C1 = CFrame.Angles(-math.pi/2, 0, 0) | |
145 | ||
146 | -- Set up posture! | |
147 | local currentLeftShoulder, currentRightShoulder = Joints["Left Shoulder"].C1, Joints["Right Shoulder"].C1 | |
148 | local currentLeftHip, currentRightHip = Joints["Left Hip"].C1, Joints["Right Hip"].C1 | |
149 | local currentNeck = Joints["Neck"].C1 | |
150 | local toNeck = fromNeck * CFrame.new(0, 0.25, 0) * CFrame.Angles(math.rad(80), 0, 0) | |
151 | local toLeftShoulder = fromLeftShoulder * CFrame.new(-0.3, 0, 0.5) * CFrame.Angles(math.pi/2, math.rad(120), 0) | |
152 | local toRightShoulder = fromRightShoulder * CFrame.new(0.3, 0, 0.5) * CFrame.Angles(math.pi/2, -math.rad(120), 0) | |
153 | local toLeftHip = fromLeftHip * CFrame.new(0.5, -0.5, 0) * CFrame.Angles(math.rad(30), math.rad(40), math.rad(20)) | |
154 | local toRightHip = fromRightHip * CFrame.new(-0.5, -0.5, 0) * CFrame.Angles(math.rad(30), -math.rad(40), -math.rad(20)) | |
155 | spawn(function() | |
156 | for i = 0, 1, 0.1 do | |
157 | Joints["Neck"].C1 = currentNeck:lerp(toNeck, i) | |
158 | Joints["Left Shoulder"].C1 = currentLeftShoulder:lerp(toLeftShoulder, i) | |
159 | Joints["Right Shoulder"].C1 = currentRightShoulder:lerp(toRightShoulder, i) | |
160 | Joints["Left Hip"].C1 = currentLeftHip:lerp(toLeftHip, i) | |
161 | Joints["Right Hip"].C1 = currentRightHip:lerp(toRightHip, i) | |
162 | RunService.RenderStepped:wait() | |
163 | end | |
164 | end) | |
165 | ||
166 | local EjectAnimation = function() | |
167 | local currentLeftShoulder, currentRightShoulder = Joints["Left Shoulder"].C1, Joints["Right Shoulder"].C1 | |
168 | local currentLeftHip, currentRightHip = Joints["Left Hip"].C1, Joints["Right Hip"].C1 | |
169 | local currentRootC0, currentRootC1 = Joints["RootJoint"].C0, Joints["RootJoint"].C1 | |
170 | local currentNeck = Joints["Neck"].C1 | |
171 | local toRootC0, toRootC1 = fromRootC0, fromRootC1 | |
172 | local toLeftShoulder = fromLeftShoulder * CFrame.new(0, 0.5, 0.5) * CFrame.Angles(math.rad(120), math.rad(30), 0) | |
173 | local toRightShoulder = fromRightShoulder * CFrame.new(0, 0.5, 0.5) * CFrame.Angles(math.rad(120), -math.rad(30), 0) | |
174 | local toLeftHip = fromLeftHip * CFrame.new(0, -0.3, -0.1) * CFrame.Angles(math.rad(20), 0, 0) | |
175 | local toRightHip = fromRightHip * CFrame.new(0, -0.3, -0.1) * CFrame.Angles(math.rad(20), 0, 0) | |
176 | for i = 0, 1, 0.1 do | |
177 | Joints["Neck"].C1 = currentNeck:lerp(fromNeck, i) | |
178 | Joints["RootJoint"].C0 = currentRootC0:lerp(toRootC0, i) | |
179 | Joints["RootJoint"].C1 = currentRootC1:lerp(toRootC1, i) | |
180 | Joints["Left Shoulder"].C1 = currentLeftShoulder:lerp(toLeftShoulder, i) | |
181 | Joints["Right Shoulder"].C1 = currentRightShoulder:lerp(toRightShoulder, i) | |
182 | Joints["Left Hip"].C1 = currentLeftHip:lerp(toLeftHip, i) | |
183 | Joints["Right Hip"].C1 = currentRightHip:lerp(toRightHip, i) | |
184 | RunService.RenderStepped:wait() | |
185 | end | |
186 | end | |
187 | ||
188 | -- Set up HUD | |
189 | local HUD = Instance.new("ScreenGui", Player.PlayerGui) | |
190 | HUD.Name = "HUD" | |
191 | local ActivateFrame = Instance.new("Frame", HUD) | |
192 | ActivateFrame.Name = "ActivateFrame" | |
193 | ActivateFrame.Position = UDim2.new(1, -150, 1, -50) | |
194 | ActivateFrame.Size = UDim2.new(0, 150, 0, 50) | |
195 | ActivateFrame.Style = "RobloxRound" | |
196 | local Button = Instance.new("TextButton", ActivateFrame) | |
197 | Button.Name = "Button" | |
198 | Button.Position = UDim2.new(0, -8, 0, -8) | |
199 | Button.Size = UDim2.new(1, 16, 1, 16) | |
200 | Button.Style = "RobloxRoundDropdownButton" | |
201 | Button.Text = "" | |
202 | local buttonText = Instance.new("TextLabel", Button) | |
203 | buttonText.ZIndex = 2 | |
204 | buttonText.Name = "Text" | |
205 | buttonText.BackgroundTransparency = 1 | |
206 | buttonText.Position = UDim2.new(0, -5, 0, -5) | |
207 | buttonText.Size = UDim2.new(1, 10, 1, 10) | |
208 | buttonText.Font = Enum.Font.SourceSansBold | |
209 | buttonText.TextScaled = true | |
210 | buttonText.Text = "BOOM" | |
211 | buttonText.TextColor3 = Color3.new() | |
212 | buttonText.TextTransparency = 0.2 | |
213 | local Shadow = buttonText:Clone() | |
214 | Shadow.Parent = Button | |
215 | Shadow.Name = "Shadow" | |
216 | Shadow.Position = UDim2.new(0, -3, 0, -3) | |
217 | Shadow.ZIndex = 1 | |
218 | Shadow.TextColor3 = Color3.new(116/255, 116/255, 116/255) | |
219 | ||
220 | if speedGauge then | |
221 | local speedFrame = ActivateFrame:Clone() | |
222 | speedFrame.Position = UDim2.new(1, -305, 1, -50) | |
223 | local speedButton = speedFrame:WaitForChild("Button") | |
224 | speedButton.Active = false | |
225 | speedButton.AutoButtonColor = false | |
226 | speedButtonText = speedButton:WaitForChild("Text") | |
227 | speedButtonText.Text = "0 Studs/s" | |
228 | speedShadow = speedButton:WaitForChild("Shadow") | |
229 | speedShadow.Text = "0 Studs/s" | |
230 | speedFrame.Parent = HUD | |
231 | end | |
232 | ||
233 | local Activated = true | |
234 | Button.Style = "RobloxRoundButton" | |
235 | buttonText.Text = "no-buum" | |
236 | Shadow.Text = "Un-Activate" | |
237 | ||
238 | Button.MouseButton1Click:connect(function() | |
239 | if not Activated then | |
240 | Activated = true | |
241 | Button.Style = "RobloxRoundButton" | |
242 | buttonText.Text = "Un-Activate" | |
243 | Shadow.Text = "Un-Activate" | |
244 | else | |
245 | Activated = false | |
246 | Button.Style = "RobloxRoundDropdownButton" | |
247 | buttonText.Text = "BOOM" | |
248 | Shadow.Text = "Activate" | |
249 | end | |
250 | end) | |
251 | ||
252 | -- Fly away stanley, be free! | |
253 | local bodyGyro = Instance.new("BodyGyro", Missile) | |
254 | bodyGyro.maxTorque = Vector3.new(400000, 400000, 400000) | |
255 | bodyGyro.P = 6000 | |
256 | bodyGyro.cframe = Missile.CFrame | |
257 | ||
258 | local bodyPos = Instance.new("BodyPosition", Missile) | |
259 | bodyPos.maxForce = Vector3.new(100000, 100000, 100000) | |
260 | bodyPos.P = 1000 | |
261 | bodyPos.position = bodyParts["Torso"].Position | |
262 | ||
263 | local Sound = Instance.new("Sound", Missile) | |
264 | Sound.SoundId = "rbxassetid://229425359" | |
265 | Sound.Looped = true | |
266 | ||
267 | local lastTick = tick() | |
268 | local Connection1 = InputService.InputBegan:connect(function(Input) | |
269 | if Input.UserInputType == Enum.UserInputType.MouseButton1 or Input.UserInputType == Enum.UserInputType.Touch then | |
270 | Sound:Play(); Smoke.Enabled = true | |
271 | RunService:UnbindFromRenderStep("Stopping") | |
272 | RunService:BindToRenderStep("Flying", 1, function() | |
273 | local currentTick = tick() | |
274 | if currentTick - lastTick >= increaseTime and currentSpeed < maxSpeed then | |
275 | currentSpeed = currentSpeed + increaseIncrement | |
276 | if currentSpeed > maxSpeed then currentSpeed = maxSpeed end | |
277 | if doPrints then print("Increased speed!", "Current speed: "..currentSpeed) end | |
278 | if speedGauge then | |
279 | speedButtonText.Text = currentSpeed .. " Studs/s" | |
280 | speedShadow.Text = currentSpeed .. " Studs/s" | |
281 | end | |
282 | lastTick = currentTick | |
283 | end | |
284 | mousePos = Mouse.Hit.p | |
285 | bodyGyro.cframe = CFrame.new(Missile.Position, mousePos) | |
286 | bodyPos.position = Missile.Position + (mousePos - Missile.Position).unit * currentSpeed | |
287 | end) | |
288 | end | |
289 | end) | |
290 | ||
291 | local Connection2 = InputService.InputEnded:connect(function(Input) | |
292 | if Input.UserInputType == Enum.UserInputType.MouseButton1 or Input.UserInputType == Enum.UserInputType.Touch then | |
293 | Sound:Stop(); Smoke.Enabled = false | |
294 | RunService:UnbindFromRenderStep("Flying") | |
295 | RunService:BindToRenderStep("Stopping", 1, function() | |
296 | local currentTick = tick() | |
297 | if currentTick - lastTick >= decreaseTime and currentSpeed > 0 then | |
298 | currentSpeed = currentSpeed - decreaseIncrement | |
299 | if currentSpeed < 0 then currentSpeed = 0 end | |
300 | if doPrints then print("Decreased speed!", "Current speed: "..currentSpeed) end | |
301 | if speedGauge then | |
302 | speedButtonText.Text = currentSpeed .. " Studs/s" | |
303 | speedShadow.Text = currentSpeed .. " Studs/s" | |
304 | end | |
305 | lastTick = currentTick | |
306 | end | |
307 | mousePos = Mouse.Hit.p | |
308 | bodyGyro.cframe = CFrame.new(Missile.Position, mousePos) | |
309 | bodyPos.position = Missile.Position + (mousePos - Missile.Position).unit * currentSpeed | |
310 | end) | |
311 | end | |
312 | end) | |
313 | ||
314 | local killConnections = function(Destroy) | |
315 | RunService:UnbindFromRenderStep("Flying") | |
316 | RunService:UnbindFromRenderStep("Stopping") | |
317 | if Connection1 and Connection2 then Connection1:disconnect(); Connection2:disconnect() end | |
318 | if Destroy then Missile:Destroy(); EmitterPart:Destroy() end | |
319 | end | |
320 | ||
321 | local Explode = function(Missile, isEjected) | |
322 | local Explosion = Instance.new("Explosion") | |
323 | Explosion.BlastRadius = 50 | |
324 | Explosion.DestroyJointRadiusPercent = 20 | |
325 | Explosion.Position = Missile.Position | |
326 | Explosion.Parent = workspace | |
327 | ||
328 | local boomPart = Instance.new("Part", workspace) | |
329 | boomPart.Name = "Boom" | |
330 | boomPart.Transparency = 1 | |
331 | boomPart.Anchored = true | |
332 | boomPart.CanCollide = false | |
333 | boomPart.FormFactor = Enum.FormFactor.Custom | |
334 | boomPart.Size = Vector3.new(0.2, 0.2, 0.2) | |
335 | boomPart.Position = Missile.Position | |
336 | local Boom = Instance.new("Sound", boomPart) | |
337 | Boom.SoundId = "rbxassetid://165969964" | |
338 | Boom:Play() | |
339 | game:GetService("Debris"):AddItem(boomPart, 1) | |
340 | ||
341 | if isEjected then | |
342 | Missile:Destroy(); EmitterPart:Destroy() | |
343 | else | |
344 | killConnections(true) | |
345 | end | |
346 | end | |
347 | ||
348 | local MissileCon = Missile.Touched:connect(function(Hit) | |
349 | if Activated and not Hit:IsDescendantOf(Character) and Hit.CanCollide and (currentSpeed >= collisionSpeed or (Ejected and ejectedSpeed >= collisionSpeed)) then | |
350 | Explode(Missile) | |
351 | end | |
352 | end) | |
353 | ||
354 | if Humanoid.Health <= 0 then killConnections(true) end | |
355 | Humanoid.Died:connect(function() killConnections(true) end) | |
356 | ||
357 | local Connection3 | |
358 | Connection3 = InputService.InputBegan:connect(function(Input) | |
359 | if Input.KeyCode == Enum.KeyCode.E and currentSpeed >= 100 then | |
360 | Connection3:disconnect() | |
361 | killConnections() | |
362 | MissileCon:disconnect() | |
363 | Ejected = true | |
364 | ||
365 | local ejectedMissile = Missile | |
366 | ejectedMissile.Touched:connect(function(Hit) | |
367 | if not Hit:IsDescendantOf(Character) and Hit.CanCollide then | |
368 | Explode(ejectedMissile, true) | |
369 | end | |
370 | end) | |
371 | ||
372 | local ejectedBodyPos = bodyPos | |
373 | ejectedSpeed = currentSpeed | |
374 | currentSpeed = 0 | |
375 | local toPos = mousePos | |
376 | Weld:Destroy() | |
377 | HUD:Destroy() | |
378 | game:GetService("Debris"):AddItem(ejectedMissile, 5); game:GetService("Debris"):AddItem(EmitterPart, 5) | |
379 | local Ejected = RunService.RenderStepped:connect(function() | |
380 | ejectedBodyPos.position = ejectedMissile.Position + (toPos - ejectedMissile.Position).unit * ejectedSpeed | |
381 | end) | |
382 | wait(0.1) | |
383 | bodyParts["Torso"].Velocity = Vector3.new(0, 100, 0) | |
384 | EjectAnimation() | |
385 | wait(0.5) | |
386 | createMissile() | |
387 | end | |
388 | end) | |
389 | end | |
390 | createMissile() |