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