View difference between Paste ID: U3d9F3yP and jTXy9SVd
SHOW: | | - or go back to the newest paste.
1
2
--https://github.com/Mokiros/roblox-FE-compatibility
3
if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
4
local Player,game,owner = owner,game
5
local RealPlayer = Player
6
do
7
	print("FE Compatibility code V2 by Mokiros")
8
	local RealPlayer = RealPlayer
9
	script.Parent = RealPlayer.Character
10
11
	--Fake event to make stuff like Mouse.KeyDown work
12
	local Disconnect_Function = function(this)
13
		this[1].Functions[this[2]] = nil
14
	end
15
	local Disconnect_Metatable = {__index={disconnect=Disconnect_Function,Disconnect=Disconnect_Function}}
16
	local FakeEvent_Metatable = {__index={
17
		Connect = function(this,f)
18
			local i = tostring(math.random(0,10000))
19
			while this.Functions[i] do
20
				i = tostring(math.random(0,10000))
21
			end
22
			this.Functions[i] = f
23
			return setmetatable({this,i},Disconnect_Metatable)
24
		end
25
	}}
26
	FakeEvent_Metatable.__index.connect = FakeEvent_Metatable.__index.Connect
27
	local function fakeEvent()
28
		return setmetatable({Functions={}},FakeEvent_Metatable)
29
	end
30
31
	--Creating fake input objects with fake variables
32
    local FakeMouse = {Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
33
    FakeMouse.keyUp = FakeMouse.KeyUp
34
    FakeMouse.keyDown = FakeMouse.KeyDown
35
	local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
36
	local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
37
		CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
38
	end}
39
	--Merged 2 functions into one by checking amount of arguments
40
	CAS.UnbindAction = CAS.BindAction
41
42
	--This function will trigger the events that have been :Connect()'ed
43
	local function TriggerEvent(self,ev,...)
44
		for _,f in pairs(self[ev].Functions) do
45
			f(...)
46
		end
47
	end
48
	FakeMouse.TriggerEvent = TriggerEvent
49
	UIS.TriggerEvent = TriggerEvent
50
51
	--Client communication
52
	local Event = Instance.new("RemoteEvent")
53
	Event.Name = "UserInput_Event"
54
	Event.OnServerEvent:Connect(function(plr,io)
55
	    if plr~=RealPlayer then return end
56
		FakeMouse.Target = io.Target
57
		FakeMouse.Hit = io.Hit
58
		if not io.isMouse then
59
			local b = io.UserInputState == Enum.UserInputState.Begin
60
			if io.UserInputType == Enum.UserInputType.MouseButton1 then
61
				return FakeMouse:TriggerEvent(b and "Button1Down" or "Button1Up")
62
			end
63
			if io.UserInputType == Enum.UserInputType.MouseButton2 then
64
				return FakeMouse:TriggerEvent(b and "Button2Down" or "Button2Up")
65
			end
66
			for _,t in pairs(CAS.Actions) do
67
				for _,k in pairs(t.Keys) do
68
					if k==io.KeyCode then
69
						t.Function(t.Name,io.UserInputState,io)
70
					end
71
				end
72
			end
73
			FakeMouse:TriggerEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
74
			UIS:TriggerEvent(b and "InputBegan" or "InputEnded",io,false)
75
	    end
76
	end)
77
	Event.Parent = NLS([==[local Event = script:WaitForChild("UserInput_Event")
78
	local Mouse = owner:GetMouse()
79
	local UIS = game:GetService("UserInputService")
80
	local input = function(io,RobloxHandled)
81
		if RobloxHandled then return end
82
		--Since InputObject is a client-side instance, we create and pass table instead
83
		Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
84
	end
85
	UIS.InputBegan:Connect(input)
86
	UIS.InputEnded:Connect(input)
87
	local h,t
88
	--Give the server mouse data every second frame, but only if the values changed
89
	--If player is not moving their mouse, client won't fire events
90
	local HB = game:GetService("RunService").Heartbeat
91
	while true do
92
		if h~=Mouse.Hit or t~=Mouse.Target then
93
			h,t=Mouse.Hit,Mouse.Target
94
			Event:FireServer({isMouse=true,Target=t,Hit=h})
95
		end
96
		--Wait 2 frames
97
		for i=1,2 do
98
			HB:Wait()
99
		end
100
	end]==],script)
101
102
	----Sandboxed game object that allows the usage of client-side methods and services
103
	--Real game object
104
	local RealGame = game
105
106
	--Metatable for fake service
107
	local FakeService_Metatable = {
108
		__index = function(self,k)
109
			local s = rawget(self,"_RealService")
110
			if s then
111
				return typeof(s[k])=="function"
112
				and function(_,...)return s[k](s,...)end or s[k]
113
			end
114
		end,
115
		__newindex = function(self,k,v)
116
			local s = rawget(self,"_RealService")
117
			if s then s[k]=v end
118
		end
119
	}
120
	local function FakeService(t,RealService)
121
		t._RealService = typeof(RealService)=="string" and RealGame:GetService(RealService) or RealService
122
		return setmetatable(t,FakeService_Metatable)
123
	end
124
125
	--Fake game object
126
	local FakeGame = {
127
		GetService = function(self,s)
128
			return rawget(self,s) or RealGame:GetService(s)
129
		end,
130
		Players = FakeService({
131
			LocalPlayer = FakeService({GetMouse=function(self)return FakeMouse end},Player)
132
		},"Players"),
133
		UserInputService = FakeService(UIS,"UserInputService"),
134
		ContextActionService = FakeService(CAS,"ContextActionService"),
135
		RunService = FakeService({
136
			_btrs = {},
137
			RenderStepped = RealGame:GetService("RunService").Heartbeat,
138
			BindToRenderStep = function(self,name,_,fun)
139
				self._btrs[name] = self.Heartbeat:Connect(fun)
140
			end,
141
			UnbindFromRenderStep = function(self,name)
142
				self._btrs[name]:Disconnect()
143
			end,
144
		},"RunService")
145
	}
146
	rawset(FakeGame.Players,"localPlayer",FakeGame.Players.LocalPlayer)
147
	FakeGame.service = FakeGame.GetService
148
	FakeService(FakeGame,game)
149
	--Changing owner to fake player object to support owner:GetMouse()
150
	game,owner = FakeGame,FakeGame.Players.LocalPlayer
151
end
152
153
local Player = game:GetService("Players").LocalPlayer
154
local Character = Player.Character
155
local Mouse = Player:GetMouse()
156
local Camera = game:GetService("Workspace").CurrentCamera
157
local Humanoid = Character:findFirstChild("Humanoid")
158
local Torso = Character.Torso
159
local PlayerGui = Player.PlayerGui
160
local Torso = Character:findFirstChild("Torso")
161
local Head = Character:findFirstChild("Head")
162
local RootPart = Character:findFirstChild("HumanoidRootPart")
163
local Root = RootPart.RootJoint
164
local Sides = {"Left","Right"}
165
local Arms = {Character["Left Arm"],Character["Right Arm"]}
166
local Legs = {Character["Left Leg"],Character["Right Leg"]}
167
168
local Bits = {}
169
local Disposables = {}
170
local Discs = {}
171
172
local DiscSpin = 0
173
local Spread = 1.25
174
local RateTop = 1
175
local RateBot = 1
176
local Distance = 0.5
177
local ExtendTop = 1
178
local ExtendBot = 1 
179
local CurrentFrame = 1
180
local Lift = 0
181
local Accel = 1
182
local TurnAngle = 0
183
local rofTop = 1
184
local rofBot = 1
185
local Flutter = 0
186
187
local Front = false
188
local Back = false
189
local Left = false
190
local Right = false
191
local AddSub = false
192
local ChargeHeld = false
193
local BoostHeld = false
194
local BeamHeld = false
195
local AbsDefHeld = false
196
local ExtendGrowthTop = false
197
local ExtendGrowthBot = false
198
local UpdateAnim = true
199
200
201
local CurrentAnimation = "Idle"
202
local LastAnimation = "Idle"
203
local MobilityType = "Float"
204
local ColorGlobe = "White"
205
local ColorBlades = "Black"
206
local xmove,zmove
207
208
local LastBeam = tick()
209
210
if Torso then
211
    for _,v in pairs(Torso:children()) do
212
        if v:IsA("BodyGyro") or v:IsA("BodyVelocity") then
213
            v:Destroy();
214
        end
215
    end
216
end
217
218
local Energy = {}
219
local TotalEnergy = 1000
220
local CurrentEnergy = 1000
221
222
pcall(function()
223
	PlayerGui.EnergyMeter:Destroy()
224
end)
225
if Player.Name == "modFrost" then
226
	ColorGlobe = "Bright orange"
227
end
228
229
local FlapSound = Instance.new("Sound", Torso)
230
FlapSound.Name = "Flap"
231
FlapSound.SoundId = "http://www.roblox.com/asset/?id=257002377"
232
FlapSound.Volume = 1
233
234
local EnergyMeter = Instance.new("ScreenGui", PlayerGui)
235
EnergyMeter.Name = "EnergyMeter"
236
local Bar = Instance.new("Frame", EnergyMeter)
237
Bar.Size = UDim2.new(0,200,0,10)
238
Bar.Position = UDim2.new(1,-205,1,-15)
239
Bar.BorderSizePixel = 0
240
Bar.BackgroundColor = BrickColor.new("Really black")
241
Bar.BackgroundTransparency = 0.5
242
local Text = Instance.new("TextLabel", Bar)
243
Text.Text = "Energy"
244
Text.TextColor = BrickColor.new("White")
245
Text.BackgroundTransparency = 1
246
Text.Size = UDim2.new(1,0,1,0)
247
Text.Position = UDim2.new(0,0,-1,-10)
248
Text.TextXAlignment = "Left"
249
Text.FontSize = "Size12"
250
local EnergyFill = Instance.new("Frame", Bar)
251
EnergyFill.Size = UDim2.new(0,0,1,-5)
252
EnergyFill.Position = UDim2.new(0,2.5,0,2.5)
253
EnergyFill.BorderSizePixel = 0
254
EnergyFill.BackgroundColor = BrickColor.new(ColorGlobe)
255
EnergyFill.BackgroundTransparency = 0.25
256
257
local ChargeMeter = Instance.new("ScreenGui", PlayerGui)
258
ChargeMeter.Name = "EnergyMeter"
259
local ChargeBar = Instance.new("Frame", ChargeMeter)
260
ChargeBar.Size = UDim2.new(0,200,0,10)
261
ChargeBar.Position = UDim2.new(0.5,-102.5,0.8,-5)
262
ChargeBar.BorderSizePixel = 0
263
ChargeBar.BackgroundColor = BrickColor.new("Really black")
264
ChargeBar.BackgroundTransparency = 0.5
265
local ChargeFill = Instance.new("Frame", ChargeBar)
266
ChargeFill.Size = UDim2.new(0,0,1,-5)
267
ChargeFill.Position = UDim2.new(0,2.5,0,2.5)
268
ChargeFill.BorderSizePixel = 0
269
ChargeFill.BackgroundColor = BrickColor.new("Bright blue")
270
ChargeFill.BackgroundTransparency = 0.25
271
ChargeBar.Visible = false
272
273
local function _Part(Parent,canc,anc,tr,ref,mat,color,size, meshtype, scale)
274
	local part = Instance.new("Part", Parent)
275
	part.Transparency = tr
276
	part.Anchored = anc
277
	part.TopSurface = 10
278
	part.BottomSurface = 10
279
	part.LeftSurface = 10
280
	part.RightSurface = 10
281
	part.FrontSurface = 10
282
	part.BackSurface = 10
283
	part.Locked = true
284
	part.formFactor = 3
285
	part.Reflectance = ref
286
	part.Material = mat
287
	part.CanCollide = canc
288
	part.Size = Vector3.new(size[1],size[2],size[3])
289
	part.BrickColor = BrickColor.new(color)
290
	local mesh
291
	if meshtype == "BlockMesh" then
292
		mesh = Instance.new("BlockMesh", part)
293
	elseif meshtype == "CylinderMesh" then
294
		mesh = Instance.new("CylinderMesh", part)
295
	else
296
		mesh = Instance.new("SpecialMesh", part)
297
		mesh.MeshType = meshtype
298
	end
299
	mesh.Name = "Mesh"
300
	mesh.Scale = Vector3.new(scale[1],scale[2],scale[3])
301
	return part
302
end
303
304
local function _Weld(Parent, p0, c1, c0)
305
	local weld = Instance.new("Motor", Parent)
306
	weld.Part1 = Parent
307
	weld.Part0 = p0
308
	weld.C1 = c1
309
	weld.C0 = c0
310
	weld.Name = "Weld"
311
	return weld
312
end
313
314
local Main = Character:findFirstChild("Main") or Instance.new("Model", Character)
315
Main.Name = "Main"
316
Main:ClearAllChildren()
317
318
pcall(function() Character["Head"]["face"]:Destroy() end)
319
320
for _,Hat in pairs(Character:GetChildren()) do
321
	if Hat:IsA("Accoutrement") then
322
		Hat:Destroy()
323
	end
324
end
325
326
for _,Part in pairs(Character:GetChildren()) do
327
	if Part:IsA("BasePart") then
328
		Part.Transparency = 1
329
	end
330
end
331
332
local function GenF(Part, Cframe, Color)
333
	local A = _Part(Main,false,false,0,0,"SmoothPlastic",Color,{0.05,0.5,0.05},"BlockMesh",{1,1,0.5})
334
	_Weld(A, Part, CFrame.new(), Cframe)
335
	local B = _Part(Main,false,false,0,0,"SmoothPlastic",Color,{0.2,0.2,0.3},"BlockMesh",{1,0.5,1})
336
	_Weld(B, A, CFrame.new(), CFrame.new(0,-0.2,0.2))
337
	local C = _Part(Main,false,false,0,0,"SmoothPlastic",Color,{0.2,0.2,0.2},"BlockMesh",{1,0.5,1})
338
	_Weld(C, A, CFrame.new(), CFrame.new(0,-0.025,0.15))
339
end
340
341
local Down = _Part(Main,false,false,1,1,"SmoothPlastic","Black",{1,1,1},"Brick",{1,1,1})
342
_Weld(Down, Torso, CFrame.Angles(math.rad(90),0,0), CFrame.new())
343
344
local AnchorPart = _Part(Main,false,false,0.1,0,"Neon",ColorGlobe,{0.8,0.8,0.8},"Sphere",{1,1,1})
345
_Weld(AnchorPart, Character["Right Arm"], CFrame.new(0,1.5,0), CFrame.new())
346
347
local AnchorPart2 = _Part(Main,false,false,0.1,0,"Neon",ColorGlobe,{0.8,0.8,0.8},"Sphere",{1,1,1})
348
_Weld(AnchorPart2, Character["Left Arm"], CFrame.new(0,1.5,0), CFrame.new())
349
350
local AnchorPart3 = _Part(Main,false,false,0.1,0,"Neon",ColorGlobe,{0.8,0.8,0.8},"Sphere",{1,1,1})
351
_Weld(AnchorPart3, Character["Right Leg"], CFrame.new(0,1.5,0), CFrame.new())
352
353
local AnchorPart4 = _Part(Main,false,false,0.1,0,"Neon",ColorGlobe,{0.8,0.8,0.8},"Sphere",{1,1,1})
354
_Weld(AnchorPart4, Character["Left Leg"], CFrame.new(0,1.5,0), CFrame.new())
355
356
--Back
357
358
local AnchorPart5 = _Part(Main,false,false,0.1,0,"Neon",ColorGlobe,{0.6,0.6,0.6},"Sphere",{1,1,1})
359
_Weld(AnchorPart5, Character.Torso, CFrame.new(0.75,-0.5,-1), CFrame.new())
360
361
local AnchorPart6 = _Part(Main,false,false,0.1,0,"Neon",ColorGlobe,{0.6,0.6,0.6},"Sphere",{1,1,1})
362
_Weld(AnchorPart6, Character.Torso, CFrame.new(-0.75,-0.5,-1), CFrame.new())
363
364
local AnchorPart7 = _Part(Main,false,false,0.1,0,"Neon",ColorGlobe,{0.4,0.4,0.4},"Sphere",{1,1,1})
365
_Weld(AnchorPart7, Character.Torso, CFrame.new(0.5,0.25,-0.8), CFrame.new())
366
367
local AnchorPart8 = _Part(Main,false,false,0.1,0,"Neon",ColorGlobe,{0.4,0.4,0.4},"Sphere",{1,1,1})
368
_Weld(AnchorPart8, Character.Torso, CFrame.new(-0.5,0.25,-0.8), CFrame.new())
369
370
local WingLeft = _Part(Main,false,false,0,0,"SmoothPlastic",ColorBlades,{0.2,2,1},"Wedge",{1,1,1})
371
local WingLeftMain = _Weld(WingLeft, AnchorPart5, CFrame.new(), CFrame.new())
372
local WingLeftP1 = _Part(Main,false,false,0,0,"SmoothPlastic",ColorBlades,{0.2,2,1},"Wedge",{1,1,1})
373
_Weld(WingLeftP1, WingLeft, CFrame.new(0,-2,0) * CFrame.Angles(math.rad(180),0,0), CFrame.new())
374
local WingLeftD = _Part(Main,false,false,0,0,"SmoothPlastic",ColorGlobe,{1,1,1},"FileMesh",{0.25,1.8*2,0.45*2})
375
WingLeftD.Mesh.MeshId = "rbxassetid://9756362"
376
_Weld(WingLeftD, WingLeft, CFrame.new(0,1,-0.25) * CFrame.Angles(math.rad(-15),0,0), CFrame.new())
377
table.insert(Bits, {Side = true; Weld = WingLeftMain; Series = 0;Type = "Wing"})
378
379
local WingRight = _Part(Main,false,false,0,0,"SmoothPlastic",ColorBlades,{0.2,2,1},"Wedge",{1,1,1})
380
local WingRightMain = _Weld(WingRight, AnchorPart6, CFrame.new(), CFrame.new())
381
local WingRightP1 = _Part(Main,false,false,0,0,"SmoothPlastic",ColorBlades,{0.2,2,1},"Wedge",{1,1,1})
382
_Weld(WingRightP1, WingRight, CFrame.new(0,-2,0) * CFrame.Angles(math.rad(180),0,0), CFrame.new())
383
local WingRightD = _Part(Main,false,false,0,0,"SmoothPlastic",ColorGlobe,{1,1,1},"FileMesh",{0.25,1.8*2,0.45*2})
384
WingRightD.Mesh.MeshId = "rbxassetid://9756362"
385
_Weld(WingRightD, WingRight, CFrame.new(0,1,-0.25) * CFrame.Angles(math.rad(-15),0,0), CFrame.new())
386
table.insert(Bits, {Side = false; Weld = WingRightMain; Series = 0;Type = "Wing"})
387
388
local WingLeftLower = _Part(Main,false,false,0,0,"SmoothPlastic",ColorBlades,{0.2,1.5,0.5},"Wedge",{1,1,1})
389
local WingLeftLowerMain = _Weld(WingLeftLower, AnchorPart7, CFrame.new(), CFrame.new())
390
local WingLeftLowerP1 = _Part(Main,false,false,0,0,"SmoothPlastic",ColorBlades,{0.2,1.5,0.5},"Wedge",{1,1,1})
391
_Weld(WingLeftLowerP1, WingLeftLower, CFrame.new(0,-1.5,0) * CFrame.Angles(math.rad(180),0,0), CFrame.new())
392
local WingLeftLowerD = _Part(Main,false,false,0,0,"SmoothPlastic",ColorGlobe,{1,1,1},"FileMesh",{0.25,2.8,0.45})
393
WingLeftLowerD.Mesh.MeshId = "rbxassetid://9756362"
394
_Weld(WingLeftLowerD, WingLeftLower, CFrame.new(0,0.75,-0.15) * CFrame.Angles(math.rad(-10),0,0), CFrame.new())
395
table.insert(Bits, {Side = true; Weld = WingLeftLowerMain; Series = 0;Type = "WingLow"})
396
397
local WingRightLower = _Part(Main,false,false,0,0,"SmoothPlastic",ColorBlades,{0.2,1.5,0.5},"Wedge",{1,1,1})
398
local WingRightLowerMain = _Weld(WingRightLower, AnchorPart8, CFrame.new(), CFrame.new())
399
local WingRightLowerP1 = _Part(Main,false,false,0,0,"SmoothPlastic",ColorBlades,{0.2,1.5,0.5},"Wedge",{1,1,1})
400
_Weld(WingRightLowerP1, WingRightLower, CFrame.new(0,-1.5,0) * CFrame.Angles(math.rad(180),0,0), CFrame.new())
401
local WingRightLowerD = _Part(Main,false,false,0,0,"SmoothPlastic",ColorGlobe,{1,1,1},"FileMesh",{0.25,2.8,0.45})
402
WingRightLowerD.Mesh.MeshId = "rbxassetid://9756362"
403
_Weld(WingRightLowerD, WingRightLower, CFrame.new(0,0.75,-0.15) * CFrame.Angles(math.rad(-10),0,0), CFrame.new())
404
table.insert(Bits, {Side = false; Weld = WingRightLowerMain; Series = 0;Type = "WingLow"})
405
406
for i = 1, 6, 1 do
407
	local TriP1 = _Part(Main,false,false,0,0,"SmoothPlastic",ColorBlades,{0.2,1,0.5},"Wedge",{1,1,1})
408
	local Main = _Weld(TriP1, AnchorPart, CFrame.new(), CFrame.new())
409
	local TriP2 = _Part(Main,false,false,0,0,"SmoothPlastic",ColorBlades,{0.2,1,0.5},"Wedge",{1,1,1})
410
	_Weld(TriP2, TriP1, CFrame.new(0,-1,0) * CFrame.Angles(math.rad(180),0,0), CFrame.new())
411
	local DiamondB = _Part(Main,false,false,0,0,"SmoothPlastic",ColorGlobe,{1,1,1},"FileMesh",{0.25,1.8,0.45})
412
	DiamondB.Mesh.MeshId = "rbxassetid://9756362"
413
	_Weld(DiamondB, TriP1, CFrame.new(0,0.5,-0.125) * CFrame.Angles(math.rad(-15),0,0),CFrame.new())
414
	table.insert(Bits, {Side = false; Weld = Main; Series = i;Type = "Top"})
415
end
416
417
for i = 1, 6, 1 do
418
	local TriP1 = _Part(Main,false,false,0,0,"SmoothPlastic",ColorBlades,{0.2,1,0.5},"Wedge",{1,1,1})
419
	local Main = _Weld(TriP1, AnchorPart2, CFrame.new(), CFrame.new())
420
	local TriP2 = _Part(Main,false,false,0,0,"SmoothPlastic",ColorBlades,{0.2,1,0.5},"Wedge",{1,1,1})
421
	_Weld(TriP2, TriP1, CFrame.new(0,-1,0) * CFrame.Angles(math.rad(180),0,0), CFrame.new())
422
	local DiamondB = _Part(Main,false,false,0,0,"SmoothPlastic",ColorGlobe,{1,1,1},"FileMesh",{0.25,1.8,0.45})
423
	DiamondB.Mesh.MeshId = "rbxassetid://9756362"
424
	_Weld(DiamondB, TriP1, CFrame.new(0,0.5,-0.125) * CFrame.Angles(math.rad(-15),0,0),CFrame.new())
425
	table.insert(Bits, {Side = true; Weld = Main; Series = i;Type = "Top"})
426
end
427
428
for i = 1, 6, 1 do
429
	local TriP1 = _Part(Main,false,false,0,0,"SmoothPlastic",ColorBlades,{0.2,1,0.5},"Wedge",{1,1,1})
430
	local Main = _Weld(TriP1, AnchorPart3, CFrame.new(), CFrame.new())
431
	local TriP2 = _Part(Main,false,false,0,0,"SmoothPlastic",ColorBlades,{0.2,1,0.5},"Wedge",{1,1,1})
432
	_Weld(TriP2, TriP1, CFrame.new(0,-1,0) * CFrame.Angles(math.rad(180),0,0), CFrame.new())
433
	local DiamondB = _Part(Main,false,false,0,0,"SmoothPlastic",ColorGlobe,{1,1,1},"FileMesh",{0.25,1.8,0.45})
434
	DiamondB.Mesh.MeshId = "rbxassetid://9756362"
435
	_Weld(DiamondB, TriP1, CFrame.new(0,0.5,-0.125) * CFrame.Angles(math.rad(-15),0,0),CFrame.new())
436
	table.insert(Bits, {Side = false; Weld = Main; Series = i;Type = "Bot"})
437
end
438
439
for i = 1, 6, 1 do
440
	local TriP1 = _Part(Main,false,false,0,0,"SmoothPlastic",ColorBlades,{0.2,1,0.5},"Wedge",{1,1,1})
441
	local Main = _Weld(TriP1, AnchorPart4, CFrame.new(), CFrame.new())
442
	local TriP2 = _Part(Main,false,false,0,0,"SmoothPlastic",ColorBlades,{0.2,1,0.5},"Wedge",{1,1,1})
443
	_Weld(TriP2, TriP1, CFrame.new(0,-1,0) * CFrame.Angles(math.rad(180),0,0), CFrame.new())
444
	local DiamondB = _Part(Main,false,false,0,0,"SmoothPlastic",ColorGlobe,{1,1,1},"FileMesh",{0.25,1.8,0.45})
445
	DiamondB.Mesh.MeshId = "rbxassetid://9756362"
446
	_Weld(DiamondB, TriP1, CFrame.new(0,0.5,-0.125) * CFrame.Angles(math.rad(-15),0,0),CFrame.new())
447
	table.insert(Bits, {Side = true; Weld = Main; Series = i;Type = "Bot"})
448
end
449
450
--[[local WingAnchor = _Part(Main,false,false,1,0,"SmoothPlastic",ColorBlades,{1,1,1},"BlockMesh",{1,1,1})
451
_Weld(WingAnchor, Character.Torso, CFrame.new(0.5,-0.5,-1), CFrame.new())
452
local LengthWing1 = _Part(Main,false,false,0,0,"SmoothPlastic",ColorBlades,{0.3,1.5,0.3},"BlockMesh",{1,1,1})
453
_Weld(LengthWing1, WingAnchor, CFrame.new(0.5,-0.55,0.35) * CFrame.Angles(math.rad(290),math.rad(45),0), CFrame.new())
454
local WingAnchor2 = _Part(Main,false,false,1,0,"SmoothPlastic",ColorBlades,{1,1,1},"BlockMesh",{1,1,1})
455
_Weld(WingAnchor2, LengthWing1, CFrame.new(0,-0.75,0), CFrame.new())
456
local LengthWing2 = _Part(Main,false,false,0,0,"SmoothPlastic",ColorBlades,{0.3,1.5,0.3},"BlockMesh",{1,1,1})
457
_Weld(LengthWing2, WingAnchor2, CFrame.new(0,-0.6,0) * CFrame.Angles(math.rad(350),0,0), CFrame.new())
458
local WingAnchor3 = _Part(Main,false,false,1,0,"SmoothPlastic",ColorBlades,{1,1,1},"BlockMesh",{1,1,1})
459
_Weld(WingAnchor3, LengthWing2, CFrame.new(0,-0.75,0), CFrame.new())
460
local LengthWing3 = _Part(Main,false,false,0,0,"SmoothPlastic",ColorBlades,{0.3,1.5,0.3},"BlockMesh",{1,1,1})
461
_Weld(LengthWing3, WingAnchor3, CFrame.new(0,-0.6,0) * CFrame.Angles(math.rad(-10),0,0), CFrame.new())
462
local WingAnchor4 = _Part(Main,false,false,1,0,"SmoothPlastic",ColorBlades,{1,1,1},"BlockMesh",{1,1,1})
463
_Weld(WingAnchor4, LengthWing3, CFrame.new(0,-0.75,0), CFrame.new())
464
local LengthWing4 = _Part(Main,false,false,0,0,"SmoothPlastic",ColorBlades,{0.3,1.5,0.3},"BlockMesh",{1,1,1})
465
_Weld(LengthWing4, WingAnchor4, CFrame.new(0,-0.6,0) * CFrame.Angles(math.rad(-15),0,0), CFrame.new())
466
]]-- Scrapped for now...
467
468
--[[Body]]--
469
470
local BHead = _Part(Main,false,false,0,0,"SmoothPlastic",ColorBlades,{1,1,1},"Head",{1.25,1.25,1.25})
471
_Weld(BHead,Head,CFrame.new(),CFrame.new())
472
local BHelm = _Part(Main,false,false,0,0,"SmoothPlastic",ColorGlobe,{1,1,1},"FileMesh",{1,1,1})
473
BHelm.Mesh.MeshId = "rbxassetid://17438747"
474
_Weld(BHelm,BHead,CFrame.new(0,-0.2,0),CFrame.new())
475
local BHelm2 = _Part(Main,false,false,0,0,"SmoothPlastic",ColorBlades,{1,1,1},"FileMesh",{0.95,0.97,0.95})
476
BHelm2.Mesh.MeshId = "rbxassetid://17438747"
477
_Weld(BHelm2,BHelm,CFrame.new(0,0,-0.02),CFrame.new())
478
local EyeL = _Part(Main,false,false,0,0,"Neon",ColorGlobe,{1,1,1},"Sphere",{0.25,0.075,0.075})
479
_Weld(EyeL,Head,CFrame.new(0.2,0.25,0.55)*CFrame.Angles(0,math.rad(40),0),CFrame.new())
480
local EyeR = _Part(Main,false,false,0,0,"Neon",ColorGlobe,{1,1,1},"Sphere",{0.25,0.075,0.075})
481
_Weld(EyeR,Head,CFrame.new(-0.2,0.25,0.55)*CFrame.Angles(0,math.rad(-40),0),CFrame.new())
482
local Mouth = _Part(Main,false,false,0,0,"Neon",ColorGlobe,{1,1,1},"Sphere",{0.25,0.075,0.075})
483
_Weld(Mouth,Head,CFrame.new(0,0.45,0.53),CFrame.new())
484
local BTorso = _Part(Main,false,false,0,0,"SmoothPlastic",ColorBlades,{1,1,1},"FileMesh",{1,0.4,1})
485
BTorso.Mesh.MeshId = "rbxasset://fonts\\torso.mesh"
486
_Weld(BTorso,Torso,CFrame.new(0,-0.45,0),CFrame.new())
487
local BTorso2 = _Part(Main,false,false,0,0,"SmoothPlastic",ColorBlades,{1,1,1},"FileMesh",{0.85,0.6,0.85})
488
BTorso2.Mesh.MeshId = "rbxasset://fonts\\torso.mesh"
489
_Weld(BTorso2,BTorso,CFrame.new(0,0.8,0),CFrame.new())
490
local BTorsoCore = _Part(Main,false,false,0,0,"Neon",ColorGlobe,{1,1,1},"Sphere",{0.5,0.5,0.5})
491
_Weld(BTorsoCore, Torso, CFrame.new(0,-0.5,0.4),CFrame.new())
492
local BTorsoCoreDisc = _Part(Main,false,false,0,0,"SmoothPlastic","Medium stone grey",{1,1,1},"FileMesh",{0.525,0.525,0.2})
493
BTorsoCoreDisc.Mesh.MeshId = "rbxassetid://3270017"
494
_Weld(BTorsoCoreDisc, BTorsoCore, CFrame.new(0,0,0.1),CFrame.new())
495
local BNeck = _Part(Main,false,false,0,0,"SmoothPlastic",ColorBlades,{1,1,1},"Head",{0.8,1,0.8})
496
_Weld(BNeck,Head,CFrame.new(0,0.8,0),CFrame.new())
497
498
for i=1,3 do
499
	local BTorsoAb = _Part(Main,false,false,0,0,"SmoothPlastic","Medium stone grey",{1,1,1},"FileMesh",{0.2,0.075,0.2})
500
	BTorsoAb.Mesh.MeshId = "rbxasset://fonts\\torso.mesh"
501
	_Weld(BTorsoAb, Torso, CFrame.new(-0.5,-0.3 + 0.3*i,0.35)*CFrame.Angles(0,0,math.rad(15)),CFrame.new())
502
end
503
for i=1,3 do
504
	local BTorsoAb = _Part(Main,false,false,0,0,"SmoothPlastic","Medium stone grey",{1,1,1},"FileMesh",{0.2,0.075,0.2})
505
	BTorsoAb.Mesh.MeshId = "rbxasset://fonts\\torso.mesh"
506
	_Weld(BTorsoAb, Torso, CFrame.new(0.5,-0.3 + 0.3*i,0.35)*CFrame.Angles(0,0,math.rad(-15)),CFrame.new())
507
end
508
509
local function Arm(bool)
510
	local Limb, Offset
511
	if bool then
512
		Limb = Character["Left Arm"]
513
		Offset = 0.52
514
	else
515
		Limb = Character["Right Arm"]
516
		Offset = -0.52
517
	end
518
519
	local ShldrL = _Part(Main,false,false,0,0,"SmoothPlastic",ColorBlades,{1,1,1},"FileMesh",{1,0.35,1})
520
	ShldrL.Mesh.MeshId = "rbxasset://fonts\\rightarm.mesh"
521
	_Weld(ShldrL,Limb,CFrame.new(0,-0.6,0),CFrame.new())
522
	local ShldrL2 = _Part(Main,false,false,0,0,"SmoothPlastic",ColorBlades,{1,1,1},"FileMesh",{0.85,0.5,0.85})
523
	ShldrL2.Mesh.MeshId = "rbxasset://fonts\\rightarm.mesh"
524
	_Weld(ShldrL2,Limb,CFrame.new(0,0.2,0),CFrame.new())
525
	local ShldrL3 = _Part(Main,false,false,0,0,"SmoothPlastic",ColorBlades,{1,1,1},"FileMesh",{0.75,0.2,0.75})
526
	ShldrL3.Mesh.MeshId = "rbxasset://fonts\\rightarm.mesh"
527
	_Weld(ShldrL3,Limb,CFrame.new(0,0.85,0),CFrame.new())
528
	local ShldrL4 = _Part(Main,false,false,0,0,"SmoothPlastic","Really black",{1,1,1},"FileMesh",{0.5,0.05,0.5})
529
	ShldrL4.Mesh.MeshId = "rbxasset://fonts\\rightarm.mesh"
530
	_Weld(ShldrL4,ShldrL3,CFrame.new(0,0.16,0),CFrame.new())
531
	--X Pat--
532
	local ShldrLD = _Part(Main,false,false,0,0,"SmoothPlastic",ColorGlobe,{1,1,1},"FileMesh",{1.1,0.03,1.35})
533
	ShldrLD.Mesh.MeshId = "rbxasset://fonts\\rightarm.mesh"
534
	_Weld(ShldrLD,Limb,CFrame.new(0,0,0),CFrame.Angles(math.rad(45),0,0))
535
	local ShldrLD2 = _Part(Main,false,false,0,0,"SmoothPlastic",ColorGlobe,{1,1,1},"FileMesh",{1.1,0.03,1.35})
536
	ShldrLD2.Mesh.MeshId = "rbxasset://fonts\\rightarm.mesh"
537
	_Weld(ShldrLD2,Limb,CFrame.new(0,0,0),CFrame.Angles(math.rad(-45),0,0))
538
	local ShldrLDB = _Part(Main,false,false,0,0,"SmoothPlastic",ColorGlobe,{1,1,1},"FileMesh",{1.35,0.03,1.1})
539
	ShldrLDB.Mesh.MeshId = "rbxasset://fonts\\rightarm.mesh"
540
	_Weld(ShldrLDB,Limb,CFrame.new(0,0,0),CFrame.Angles(0,0,math.rad(45)))
541
	local ShldrLD2B = _Part(Main,false,false,0,0,"SmoothPlastic",ColorGlobe,{1,1,1},"FileMesh",{1.35,0.03,1.1})
542
	ShldrLD2B.Mesh.MeshId = "rbxasset://fonts\\rightarm.mesh"
543
	_Weld(ShldrLD2B,Limb,CFrame.new(0,0,0),CFrame.Angles(0,0,math.rad(-45)))
544
545
	local Disc = _Part(Main,false,false,0,0,"SmoothPlastic",ColorGlobe,{1,1,1},"FileMesh",{0.55,0.55,0.55})
546
	Disc.Mesh.MeshId = "rbxassetid://47260990"
547
	_Weld(Disc, ShldrL, CFrame.new(0,0,Offset),CFrame.Angles(0,math.rad(90),0))
548
	--3270017
549
	local DiscC = _Part(Main,false,false,0,0,"SmoothPlastic",ColorBlades,{1,1,1},"FileMesh",{0.55,0.55,0.1})
550
	DiscC.Mesh.MeshId = "rbxassetid://3270017"
551
	_Weld(DiscC, Disc, CFrame.new(),CFrame.new())
552
553
	table.insert(Discs, Disc)
554
end
555
556
local function Leg(bool)
557
	local Limb, Offset
558
	if bool then
559
		Limb = Character["Left Leg"]
560
		Offset = 0.5
561
	else
562
		Limb = Character["Right Leg"]
563
		Offset = -0.5
564
	end
565
	local LegL = _Part(Main,false,false,0,0,"SmoothPlastic",ColorBlades,{1,1,1},"FileMesh",{0.95,0.35,0.95})
566
	LegL.Mesh.MeshId = "rbxasset://fonts\\leftleg.mesh"
567
	_Weld(LegL,Limb,CFrame.new(0,-0.7,0),CFrame.new())
568
	local LegL2 = _Part(Main,false,false,0,0,"SmoothPlastic",ColorBlades,{1,1,1},"FileMesh",{0.85,0.5,0.85})
569
	LegL2.Mesh.MeshId = "rbxasset://fonts\\leftleg.mesh"
570
	_Weld(LegL2,Limb,CFrame.new(0,0.15,0),CFrame.new())
571
	local LegL3 = _Part(Main,false,false,0,0,"SmoothPlastic",ColorBlades,{1,1,1},"FileMesh",{0.75,0.2,0.75})
572
	LegL3.Mesh.MeshId = "rbxasset://fonts\\leftleg.mesh"
573
	_Weld(LegL3,Limb,CFrame.new(0,0.85,0),CFrame.new())
574
	local LegL4 = _Part(Main,false,false,0,0,"SmoothPlastic","Really black",{1,1,1},"FileMesh",{0.5,0.05,0.5})
575
	LegL4.Mesh.MeshId = "rbxasset://fonts\\leftleg.mesh"
576
	_Weld(LegL4,LegL3,CFrame.new(0,0.16,0),CFrame.new())
577
	local LegL5 = _Part(Main,false,false,0,0,"SmoothPlastic","Medium stone grey",{1,1,1},"FileMesh",{0.9,0.2,0.9})
578
	LegL5.Mesh.MeshId = "rbxasset://fonts\\leftleg.mesh"
579
	_Weld(LegL5,LegL2,CFrame.new(0,0,0),CFrame.new())
580
581
	local MiniRocket = _Part(Main,false,false,0,0,"SmoothPlastic","Medium stone grey",{1,1,1},"FileMesh",{0.2,0.2,0.2})
582
	MiniRocket.Mesh.MeshId = "rbxasset://fonts\\leftleg.mesh"
583
	_Weld(MiniRocket,LegL5,CFrame.new(Offset,0,0),CFrame.new())
584
	local MiniRocket2 = _Part(Main,false,false,0,0,"SmoothPlastic","Really black",{1,1,1},"BlockMesh",{0.125,0.1,0.125})
585
	_Weld(MiniRocket2,LegL5,CFrame.new(Offset,0.16,0),CFrame.new())
586
end
587
588
Arm(true)
589
Arm(false)
590
Leg(true)
591
Leg(false)
592
593
--Spin Disc 22768172
594
--[[Done]]--
595
596
local Welds = {
597
	ArmW = {
598
		Left = Instance.new("Weld",Character);
599
		Right = Instance.new("Weld",Main);
600
	};
601
	LegW = {
602
		Left = Instance.new("Weld",Main);
603
		Right = Instance.new("Weld",Main);
604
	};
605
	HeadW = {
606
		Middle = Instance.new("Weld",Main);
607
	};
608
}
609
local RWelds = {
610
	ArmW = {
611
		Left = Torso["Left Shoulder"];
612
		Right = Torso["Right Shoulder"];
613
	};
614
	LegW = {
615
		Left = Torso["Left Hip"];
616
		Right = Torso["Right Hip"];
617
	};
618
	HeadW = {
619
		Middle = Torso["Neck"];
620
	};
621
}
622
623
local LA,RA = Welds.ArmW.Left,Welds.ArmW.Right
624
local LL,LR = Welds.LegW.Left,Welds.LegW.Right
625
local HD = Welds.HeadW.Middle
626
local LAD = CFrame.new(-1.5,0.5,0)
627
local RAD = CFrame.new(1.5,0.5,0)
628
local HDD = CFrame.new(0,-1.5,0)
629
local LLD = CFrame.new(0.5,2,0)
630
local RLD = CFrame.new(-0.5,2,0)
631
local RootD = CFrame.Angles(-1.57,0,-3.15)
632
Welds.ArmW.Left.C1,Welds.ArmW.Left.C0,Welds.ArmW.Left.Part0 = CFrame.new(0, 0.5, 0),CFrame.new(-1.5, 0.5, 0),Torso
633
Welds.ArmW.Right.C1,Welds.ArmW.Right.C0,Welds.ArmW.Right.Part0 = CFrame.new(0, 0.5, 0),CFrame.new(1.5, 0.5, 0),Torso
634
Welds.LegW.Left.C1,Welds.LegW.Left.Part0 = LLD,Torso
635
Welds.LegW.Right.C1,Welds.LegW.Right.Part0 = RLD,Torso 
636
Welds.HeadW.Middle.C1,Welds.HeadW.Middle.Part0 = HDD,Torso
637
638
local CurrentLeftArm = LAD
639
local CurrentRightArm = RAD
640
local CurrentLeftLeg = LLD
641
local CurrentRightLeg = RLD
642
643
local function lerp(a, b, c)
644
    return a+(b-a)*c
645
end
646
647
local function AnimLerp(c1, c2, al)
648
    local com1 = {c1.X,c1.Y,c1.Z,c1:toEulerAnglesXYZ()}
649
    local com2 = {c2.X,c2.Y,c2.Z,c2:toEulerAnglesXYZ()}
650
    for i,v in pairs(com1) do 
651
    	com1[i] = lerp(v,com2[i],al) 
652
   	end
653
    return CFrame.new(com1[1],com1[2],com1[3]) * CFrame.Angles(select(4,unpack(com1)))
654
end
655
656
local _Arm = function(side,tf)
657
	local Arm = nil
658
	local Weld = nil
659
	local RWeld = nil
660
	for _,S in pairs(Sides) do
661
		if side:lower() == S:lower() then
662
			for _,A in pairs(Arms) do
663
				if A.Name:lower():find(side:lower()) then
664
					Arm = A
665
					Weld = Welds.ArmW[S]
666
					RWeld = RWelds.ArmW[S]
667
				end
668
			end
669
		end
670
	end
671
	if Arm and Weld and RWeld then
672
		if tf then
673
			Weld.Part1 = Arm
674
			RWeld.Part1 = nil
675
		elseif not tf then
676
			Weld.Part1 = nil
677
			RWeld.Part1 = Arm
678
		else
679
			print("Error")
680
		end
681
	end
682
end
683
684
local _Leg = function(side,tf)
685
	local Leg = nil
686
	local Weld = nil
687
	local RWeld = nil
688
	for _,S in pairs(Sides) do
689
		if side:lower() == S:lower() then
690
			for _,A in pairs(Legs) do
691
				if A.Name:lower():find(side:lower()) then
692
					Leg = A
693
					Weld = Welds.LegW[S]
694
					RWeld = RWelds.LegW[S]
695
				end
696
			end
697
		end
698
	end
699
	if Leg and Weld and RWeld then
700
		if tf then
701
			Weld.Part1 = Leg
702
			RWeld.Part1 = nil
703
		elseif not tf then
704
			Weld.Part1 = nil
705
			RWeld.Part1 = Leg
706
		else
707
			print("Error")
708
		end
709
	end
710
end
711
712
local _Head = function(tf)
713
	local Head = nil
714
	local Weld = nil
715
	local RWeld = nil
716
	Head = Character["Head"]
717
	Weld = Welds.HeadW.Middle
718
	RWeld = RWelds.HeadW.Middle
719
	if Head and Weld and RWeld then
720
		if tf then
721
			Weld.Part1 = Head
722
			RWeld.Part1 = nil
723
		elseif not tf then
724
			Weld.Part1 = nil
725
			RWeld.Part1 = Head
726
		else
727
			print("Error")
728
		end
729
	end 
730
end
731
732
pcall(function()
733
    Character.Animate.Disabled = true
734
end)
735
if Humanoid then
736
    Humanoid.PlatformStand = true
737
end
738
pcall(function()
739
    Torso.Velocity = Variables.Momentum
740
end)
741
742
local Rotate = Instance.new("BodyGyro",Torso)
743
Rotate.P = 10^6
744
Rotate.maxTorque = Vector3.new(Rotate.P,Rotate.P,Rotate.P)
745
Rotate.cframe = Torso.CFrame
746
747
local Move = Instance.new("BodyPosition",Torso)
748
Move.maxForce = Vector3.new(1,1,1)*(10^6)
749
Move.position = Torso.CFrame.p
750
751
local function LaserBeam()
752
	UpdateAnim = false
753
	CurrentAnimation = "DisableHandAnim"
754
	rofTop = 6
755
	for i=0,1,0.1 do
756
		RA.C0 = AnimLerp(CurrentRightArm, RAD * CFrame.Angles(math.rad(75),0,math.rad(-20)), i)
757
	    LA.C0 = AnimLerp(CurrentLeftArm, LAD * CFrame.Angles(math.rad(75),0,math.rad(20)), i)
758
	    wait()
759
	end
760
761
	ChargeBar.Visible = true;
762
763
	local Charge = 0
764
	local Downt = _Part(Main,false,true,0,0,"Neon",ColorGlobe,{1,1,1},"Sphere",{1,1,1})
765
	local Effect = Instance.new("ParticleEmitter", Downt)
766
	Effect.Texture = "rbxassetid://283631720"
767
	Effect.VelocitySpread = 0
768
	Effect.Acceleration = Vector3.new(0,0,0)
769
	Effect.Color = ColorSequence.new(Downt.BrickColor.Color,Downt.BrickColor.Color)
770
	Effect.Speed = NumberRange.new(0)
771
	Effect.Lifetime = NumberRange.new(1,1)
772
	Effect.Rate = 60
773
	Effect.Transparency = NumberSequence.new(0.5,0.8)
774
	Effect.Rotation = NumberRange.new(1,2)
775
776
	while BeamHeld do
777
		Charge = Charge + 1
778
		CurrentEnergy = CurrentEnergy - 1.5
779
		Downt.Mesh.Scale = Downt.Mesh.Scale + Vector3.new(0.02,0.02,0.02)
780
		Downt.CFrame = RootPart.CFrame + (RootPart.CFrame.lookVector * 4)
781
		Effect.Size = NumberSequence.new(Downt.Mesh.Scale.X)
782
		ChargeFill.Size = UDim2.new(Charge/100,-5,1,-5)
783
		wait()
784
		if Charge >= 100 or CurrentEnergy <= 0 then
785
			CurrentEnergy = CurrentEnergy <= 0 and 0 or CurrentEnergy
786
			break
787
		end
788
	end
789
790
	Downt.Anchored = false
791
	Downt.Size = Downt.Mesh.Scale
792
	Downt.Mesh.Scale = Vector3.new(1,1,1)
793
794
	local Velocity = Instance.new("BodyVelocity", Downt)
795
	Velocity.maxForce = Vector3.new(1e7,1e7,1e7)
796
	Velocity.P = 1e7
797
	Velocity.Velocity = (Mouse.Hit.p - Downt.CFrame.p)
798
--[[
799
	--CurrentEnergy = CurrentEnergy <= 0 and 0 or CurrentEnergy - (1.5*Charge)
800
	local Face = Torso.CFrame.lookVector
801
	local Ray = Ray.new(Downt.CFrame.p, (Mouse.Hit.p - Downt.CFrame.p).unit*750)
802
	local Object,Pos = game:GetService("Workspace"):findPartOnRay(Ray, Character)
803
	local Distance = (Pos - Downt.CFrame.p).magnitude
804
	local DrawRay = _Part(Main,false,true,0,0,"Neon",ColorGlobe,{1,1,1},"Cylinder",{Distance,Downt.Mesh.Scale.X,Downt.Mesh.Scale.X})
805
	DrawRay.CFrame = CFrame.new(Pos, Downt.CFrame.p) * CFrame.new(0,0,-Distance/2) * CFrame.Angles(0,math.rad(270),0)
806
807
	local ExplodePart = _Part(Main,false,true,0,0,"Neon",ColorGlobe,{1,1,1},"Sphere",{1,1,1})
808
	ExplodePart.CFrame = CFrame.new(Pos.X,Pos.Y,Pos.Z)
809
810
	local Ignore = {}
811
812
	ExplodePart.Touched:connect(function(Object)
813
		if Object.Parent and Object.Parent:IsA("Model") then
814
			local Model = Object.Parent
815
			if Model:findFirstChild("Humanoid") and not Ignore[Model.Name] and Model.Name ~= Character.Name then
816
				Ignore[Model.Name] = true;
817
				local Humanoid = Model:findFirstChild("Humanoid")
818
				Humanoid:TakeDamage(0.75*Charge)
819
			end
820
		end
821
	end)
822
823
	for i=0,1,0.1 do
824
		wait()
825
		DrawRay.Transparency = i
826
		Downt.Transparency = i
827
		ExplodePart.Size = ExplodePart.Size + Vector3.new(0.04*Charge,0.04*Charge,0.04*Charge)
828
		ExplodePart.CFrame = CFrame.new(Pos.X,Pos.Y,Pos.Z)
829
		ExplodePart.Transparency = i
830
	end
831
	Effect:Destroy()
832
	game:GetService("Debris"):AddItem(DrawRay, 1)
833
	game:GetService("Debris"):AddItem(ExplodePart, 1)]]
834
	game:GetService("Debris"):AddItem(Downt, 10)
835
	UpdateAnim = true
836
	ChargeBar.Visible = false
837
	LastBeam = tick()
838
end
839
840
local function AbsoluteDefence()
841
	UpdateAnim = false
842
843
	while AbsDefHeld do
844
845
		wait()
846
	end
847
848
849
	UpdateAnim = true
850
end
851
852
local function ThrowBlades()
853
	--[[local Thrown = {}
854
	for i,Bit in pairs(Bits) do
855
		if Bit.Type == "Top" then
856
			table.insert(Thrown, {Side = Bit.Side; Weld = Bit.Weld; Series = Bit.Series; Type = Bit.Type})
857
			table.remove(Bits, i)
858
		end
859
	end
860
	]]-- *Construction*
861
end
862
863
Mouse.KeyDown:connect(function(Key)
864
	if Key == "w" then
865
		Front = true
866
	end
867
    if Key == "a" then
868
    	Left = true
869
    end
870
    if Key == "s" then
871
    	Back = true
872
    end
873
    if Key == "q" then
874
    	BoostHeld = not BoostHeld
875
    	if BoostHeld then
876
    		Accel = 3
877
    	else
878
    		Accel = 1
879
    	end
880
    end
881
    if Key == "d" then
882
    	Right = true
883
    end
884
    if Key:byte() == 50 then
885
    	if MobilityType == "Float" then
886
    		MobilityType = "Fly"
887
    	elseif MobilityType == "Fly" then
888
    		MobilityType = "Ground"
889
    	elseif MobilityType == "Ground" then
890
    		MobilityType = "Float"
891
    	end
892
    end
893
    if Key == "h" then
894
    	if CurrentEnergy <= 0 then
895
    		return
896
    	end
897
    	AbsDefHeld = true
898
    	AbsoluteDefence()
899
    end
900
    if Key == "f" then
901
    	if CurrentEnergy <= 0 or tick()-LastBeam <= 1 then
902
			return
903
		end
904
    	BeamHeld = true
905
    	LaserBeam()
906
    end
907
    if Key == "q" then
908
    	ThrowBlades()
909
    end
910
	while BoostHeld do
911
		wait()
912
		CurrentEnergy = CurrentEnergy <= 0 and 0 or CurrentEnergy - 0.5
913
		if CurrentEnergy <= 0 then
914
			break
915
		end
916
	end
917
    if Key == "g" then
918
    	ChargeHeld = true
919
		UpdateAnim = false
920
		CurrentAnimation = "DisableHandAnim"
921
		rofTop = 15
922
		for i=0,1,0.1 do
923
			wait()
924
			AnchorPart.Weld.C1 = AnimLerp(AnchorPart.Weld.C1, CFrame.new(0,3,0), i)
925
			AnchorPart2.Weld.C1 = AnimLerp(AnchorPart2.Weld.C1, CFrame.new(0,3,0), i)
926
			RA.C0 = AnimLerp(RA.C0, RAD * CFrame.Angles(math.rad(160),0,math.rad(10)), i)
927
			LA.C0 = AnimLerp(LA.C0, LAD * CFrame.Angles(math.rad(160),0,math.rad(-10)), i)
928
		end
929
930
    	while ChargeHeld do
931
    		wait()
932
    		local NRG = _Part(Main,false,true,0,0,"SmoothPlastic",ColorGlobe,{0.2,0.2,0.2},"Sphere",{1,1,1})
933
    		NRG.CFrame = AnchorPart.CFrame * CFrame.new(math.random(-2.5,2.5),math.random(-2.5,2.5),math.random(-2.5,2.5))
934
    		local NRGB = _Part(Main,false,true,0,0,"SmoothPlastic",ColorGlobe,{0.2,0.2,0.2},"Sphere",{1,1,1})
935
    		NRGB.CFrame = AnchorPart2.CFrame * CFrame.new(math.random(-2.5,2.5),math.random(-2.5,2.5),math.random(-2.5,2.5))
936
    		table.insert(Energy, NRG)
937
    		table.insert(Energy, NRGB)
938
    		for i,nrg in pairs(Energy) do
939
    			nrg.Transparency = nrg.Transparency + 0.05
940
    			nrg.Mesh.Scale = nrg.Mesh.Scale + Vector3.new(0.1,0.1,0.1)
941
    			nrg.CFrame = CFrame.new(nrg.CFrame.p, AnchorPart.CFrame.p) * CFrame.Angles(0,0,-math.pi/2)
942
    			if nrg.Transparency >= 1 then
943
    				table.remove(Energy, i)
944
    				nrg:Destroy()
945
    			end
946
    		end
947
    		CurrentEnergy = CurrentEnergy >= TotalEnergy and TotalEnergy or CurrentEnergy + 10
948
    	end
949
950
		for i=0,1,0.1 do
951
			wait()
952
			AnchorPart.Weld.C1 = AnimLerp(AnchorPart.Weld.C1, CFrame.new(0,1.5,0), i)
953
			AnchorPart2.Weld.C1 = AnimLerp(AnchorPart2.Weld.C1, CFrame.new(0,1.5,0), i)
954
			for x,nrg in pairs(Energy) do
955
    			nrg.Transparency = nrg.Transparency + 0.15
956
    			nrg.Mesh.Scale = nrg.Mesh.Scale + Vector3.new(0.2,0.2,0.2)
957
    			nrg.CFrame = CFrame.new(nrg.CFrame.p, AnchorPart.CFrame.p) * CFrame.Angles(0,0,-math.pi/2)
958
    			if nrg.Transparency >= 1 then
959
    				table.remove(Energy, x)
960
    				nrg:Destroy()
961
    			end
962
    		end
963
		end
964
		UpdateAnim = true
965
    end
966
end)
967
968
Mouse.KeyUp:connect(function(Key)
969
	if Key == "w" then
970
		Front = false
971
	end
972
    if Key == "a" then
973
    	Left = false
974
    end
975
    if Key == "s" then
976
    	Back = false
977
    end
978
    if Key == "d" then
979
    	Right = false
980
    end
981
    if Key == "f" then
982
    	BeamHeld = false
983
    end
984
    if Key == "h" then
985
    	AbsDefHeld = false
986
    end
987
    if Key == "g" then
988
    	ChargeHeld = false
989
    end
990
    if Key == "0" then
991
    	BoostHeld = false
992
    end
993
end)
994
995
_Arm("Left", true)
996
_Arm("Right", true)
997
_Leg("Left", true)
998
_Leg("Right", true)
999
_Head(true)
1000
1001
game:GetService("RunService").Stepped:connect(function()
1002
	EnergyFill.Size = UDim2.new(CurrentEnergy/TotalEnergy,-5,1,-5)
1003
	RateTop = RateTop + rofTop
1004
	if RateTop >= 360 then
1005
		RateTop = 1
1006
	end
1007
1008
	RateBot = RateBot + rofBot
1009
	if RateBot >= 360 then
1010
		RateBot = 1
1011
	end
1012
1013
1014
	if AddSub == false then
1015
		CurrentFrame = CurrentFrame + 0.01
1016
		if CurrentFrame >= 1 then
1017
			AddSub = true
1018
		end
1019
	elseif AddSub == true then
1020
		CurrentFrame = CurrentFrame - 0.01
1021
		if CurrentFrame <= 0 then
1022
			AddSub = false
1023
		end
1024
	end
1025
1026
	DiscSpin = DiscSpin + 0.1
1027
	for _,Disc in pairs(Discs) do
1028
		Disc.Weld.C0 = CFrame.Angles(0,math.rad(90),DiscSpin)
1029
	end
1030
1031
	if ExtendGrowthTop == false and CurrentAnimation == "Idle" then
1032
		ExtendTop = ExtendTop + 1/2
1033
		if ExtendTop >= 25 then
1034
			ExtendGrowthTop = true
1035
		end
1036
	elseif ExtendGrowthTop == true and CurrentAnimation == "Idle" then
1037
		ExtendTop = ExtendTop - 1/2
1038
		if ExtendTop <= -10 then
1039
			ExtendGrowthTop = false
1040
		end
1041
	elseif CurrentAnimation == "Forward" or CurrentAnimation == "Backward" or CurrentAnimation == "SwivelRight" or CurrentAnimation == "SwivelLeft" then
1042
		ExtendTop = ExtendTop >= 40 and 40 or ExtendTop + 2
1043
	elseif CurrentAnimation == "DisableHandAnim" then
1044
		ExtendTop = ExtendTop >= 50 and 50 or ExtendTop + 2
1045
	end
1046
1047
	if ExtendGrowthBot == false and (CurrentAnimation == "Idle" or CurrentAnimation == "DisableHandAnim") then
1048
		ExtendBot = ExtendBot + 1/2
1049
		if ExtendBot >= 25 then
1050
			ExtendGrowthBot = true
1051
		end
1052
	elseif ExtendGrowthBot == true and (CurrentAnimation == "Idle" or CurrentAnimation == "DisableHandAnim") then
1053
		ExtendBot = ExtendBot - 1/2
1054
		if ExtendBot <= -10 then
1055
			ExtendGrowthBot = false
1056
		end
1057
	elseif CurrentAnimation == "Forward" or CurrentAnimation == "Backward" or CurrentAnimation == "SwivelRight" or CurrentAnimation == "SwivelLeft" then
1058
		ExtendBot = ExtendBot >= 40 and 40 or ExtendBot + 2
1059
	end
1060
1061
	if Front and not Back then
1062
		xmove = 3
1063
		if UpdateAnim then
1064
			CurrentAnimation = "Forward"
1065
		end
1066
	elseif Back and not Front then
1067
		xmove = -3
1068
		if UpdateAnim then
1069
			CurrentAnimation = "Backward"
1070
		end
1071
	else
1072
		xmove = 0
1073
		if UpdateAnim then
1074
			CurrentAnimation = "Idle"
1075
		end
1076
	end
1077
1078
	if Left and not Right then
1079
		if xmove == 0 and UpdateAnim then
1080
			CurrentAnimation = "SwivelLeft"
1081
		end
1082
		ymove = 3
1083
	elseif Right and not Left then
1084
		if xmove == 0 and UpdateAnim then
1085
			CurrentAnimation = "SwivelRight"
1086
		end
1087
		ymove = -3
1088
	else
1089
		ymove = 0
1090
		if xmove == 0 and UpdateAnim then
1091
			CurrentAnimation = "Idle"
1092
		end
1093
	end
1094
1095
	if LastAnimation ~= CurrentAnimation then
1096
		CurrentFrame = 0
1097
		AddSub = false
1098
	end
1099
1100
	for _,Info in pairs(Bits) do
1101
		local Side = Info.Side
1102
		local Series = Info.Series
1103
		local Weld = Info.Weld
1104
		local Type = Info.Type
1105
		local Extend = 1
1106
		local MyRate = 1
1107
1108
		if Type == "Top" then
1109
			Extend = ExtendTop
1110
			MyRate = RateTop + 30
1111
		elseif Type == "Bot" then
1112
			Extend = ExtendBot
1113
			MyRate = RateBot
1114
		else
1115
1116
		end
1117
1118
		if CurrentAnimation == "Idle" or CurrentAnimation == "DisableHandAnim" then
1119
			if Type == "Wing" or Type == "WingLow" then
1120
				if Type == "WingLow" then
1121
					Weld.C1 = AnimLerp(Weld.C1, CFrame.new(Side == true and -0.5 or 0.5,1.65,0.5) * CFrame.Angles(math.rad(65 + Lift*3),math.rad((Side == true and 30 + Lift*2 or -30 - Lift*2)),0), CurrentFrame)
1122
				else
1123
					Weld.C1 = AnimLerp(Weld.C1, CFrame.new(0,1.8,0.5) * CFrame.Angles(math.rad(65 + Lift*3),math.rad((Side == true and 30 + Lift*2 or -30 - Lift*2)),0), CurrentFrame)
1124
				end
1125
			else
1126
				Weld.C1 = CFrame.new(0,0,Spread) * CFrame.Angles(math.rad(-Extend),math.rad(60*Series + (Side == true and -MyRate or MyRate)),0) * CFrame.new(0,Distance,0)
1127
			end
1128
		elseif CurrentAnimation == "Forward" or CurrentAnimation == "Backward" then
1129
			if Type == "Wing" or Type == "WingLow" then
1130
				if Type == "WingLow" then
1131
					Weld.C1 = AnimLerp(Weld.C1, CFrame.new(Side == true and -0.5 or 0.5,1.65,0.5) * CFrame.Angles(math.rad(65 + Lift*10),math.rad((Side == true and 30 + Lift*2 or -30 - Lift*2)),0), CurrentFrame)
1132
				else
1133
					Weld.C1 = AnimLerp(Weld.C1, CFrame.new(0,1.8,0.5) * CFrame.Angles(math.rad(65 + Lift*10),math.rad((Side == true and 30 + Lift*2 or -30 - Lift*2)),0), CurrentFrame)
1134
				end
1135
			else
1136
				Weld.C1 = CFrame.new(0,0,Spread) * CFrame.Angles(math.rad(-Extend),math.rad(60*Series + (Side == true and -MyRate or MyRate)),0) * CFrame.new(0,Distance,0)
1137
			end
1138
		elseif CurrentAnimation == "SwivelLeft" then
1139
			if Type == "Wing" or Type == "WingLow" then
1140
				if Type == "WingLow" then
1141
					Weld.C1 = AnimLerp(Weld.C1, CFrame.new(Side == true and -0.5 or 0.5,1.65,0.5) * CFrame.Angles(math.rad(65 + Lift*3),math.rad((Side == true and 50 or -10)),0), CurrentFrame)
1142
				else
1143
					Weld.C1 = AnimLerp(Weld.C1, CFrame.new(0,1.8,0.5) * CFrame.Angles(math.rad(65 + Lift*3),math.rad((Side == true and 50 or -10)),0), CurrentFrame)
1144
				end
1145
			else
1146
				Weld.C1 = CFrame.new(0,0,Spread) * CFrame.Angles(math.rad(-Extend),math.rad(60*Series + (Side == true and -MyRate or MyRate)),0) * CFrame.new(0,Distance,0)
1147
			end
1148
		elseif CurrentAnimation == "SwivelRight" then
1149
			if Type == "Wing" or Type == "WingLow" then
1150
				if Type == "WingLow" then
1151
					Weld.C1 = AnimLerp(Weld.C1, CFrame.new(Side == true and -0.5 or 0.5,1.65,0.5) * CFrame.Angles(math.rad(65 + Lift*3),math.rad((Side == true and 10 or -50)),0), CurrentFrame)
1152
				else
1153
					Weld.C1 = AnimLerp(Weld.C1, CFrame.new(0,1.8,0.5) * CFrame.Angles(math.rad(65 + Lift*3),math.rad((Side == true and 10 or -50)),0), CurrentFrame)
1154
				end
1155
			else
1156
				Weld.C1 = CFrame.new(0,0,Spread) * CFrame.Angles(math.rad(-Extend),math.rad(60*Series + (Side == true and -MyRate or MyRate)),0) * CFrame.new(0,Distance,0)
1157
			end
1158
		else
1159
			Weld.C1 = CFrame.new(0,0,Spread) * CFrame.Angles(math.rad(-Extend),math.rad(60*Series + (Side == true and -MyRate or MyRate)),0) * CFrame.new(0,Distance,0)
1160
		end
1161
	end
1162
1163
	TurnAngle = TurnAngle + ymove
1164
1165
	Rotate.cframe = CFrame.new()*CFrame.Angles(0,math.rad(TurnAngle),0)
1166
1167
	local Ray = Ray.new(Torso.CFrame.p,Down.CFrame.lookVector*15)
1168
	local Part,Pos = game:GetService("Workspace"):findPartOnRay(Ray,Character)
1169
	local Distance = (Pos - Torso.CFrame.p).magnitude
1170
	local Face = Torso.CFrame.lookVector
1171
1172
	if Part and Pos then
1173
		local sides = Enum.NormalId:GetEnumItems();
1174
		local default = Vector3.new(0,1,0)
1175
		for i,v in pairs(sides) do
1176
			sides[i] = Vector3.FromNormalId(v)
1177
		end
1178
		if Part:IsA("Part") then
1179
			if Part.Shape.Name == "Ball" then
1180
				sides = {}
1181
				default = Part.CFrame:vectorToObjectSpace(Pos-Part.Position).unit
1182
			elseif Part.Shape.Name == "Cylinder" then
1183
				sides = {Vector3.new(1,0,0),Vector3.new(-1,0,0)}
1184
				default = (Part.CFrame:vectorToObjectSpace(Pos-Part.Position)*Vector3.new(0,1,1)).unit
1185
			end
1186
		elseif Part:IsA("WedgePart") then
1187
			sides = {Vector3.new(1,0,0),Vector3.new(-1,0,0),Vector3.new(0,-1,0),Vector3.new(0,0,-1)}
1188
			default = Vector3.new(0,1,-Part.Size.Y/Part.Size.Z).unit
1189
		end
1190
		local obs,siz,sidevector = Part.CFrame:pointToObjectSpace(Pos),Part.Size/2
1191
		for i,v in pairs(sides) do
1192
			if (obs*v/(siz*v+Vector3.new(1,1,1)*1e-7)):isClose(v,.01) then
1193
				sidevector = v
1194
				break
1195
			end
1196
		end
1197
		if not sidevector then sidevector = default end
1198
		if sidevector then
1199
			local cf = CFrame.new(Pos,Pos+Part.CFrame:vectorToWorldSpace(sidevector)) * CFrame.Angles(-math.pi/2,0,0)
1200
			Move.position = Vector3.new(cf.X,cf.Y + 6 + Lift,cf.Z) + Vector3.new(Face.X,0,Face.Z)*Accel*xmove
1201
			Move.maxForce = Vector3.new(1e7,1e7,1e7)
1202
		end
1203
	else
1204
		Move.maxForce = Vector3.new(1e7,0,1e7)
1205
		Move.position = Vector3.new(Torso.CFrame.X,Torso.CFrame.Y,Torso.CFrame.Z) + Vector3.new(Face.X,0,Face.Z)*Accel*xmove
1206
	end
1207
1208
    CurrentLeftArm = LA.C0
1209
    CurrentRightArm = RA.C0 
1210
    CurrentRightLeg = LR.C1
1211
    CurrentLeftLeg = LL.C1
1212
1213
    if math.floor(Lift+0.5) == 3 then
1214
    	--FlapSound:Play()
1215
    end
1216
1217
	if CurrentAnimation == "Idle" then
1218
		rofTop = 1
1219
		rofBot = 1
1220
	    RA.C0 = AnimLerp(CurrentRightArm, RAD * CFrame.Angles(math.rad(0),0,math.rad(25 + Lift*2)), CurrentFrame)
1221
	    LA.C0 = AnimLerp(CurrentLeftArm, LAD * CFrame.Angles(math.rad(0),0,math.rad(-25 - Lift*2)), CurrentFrame)
1222
	    LR.C1 = AnimLerp(CurrentRightLeg, RLD * CFrame.Angles(0,0,math.rad(-7.5 + Lift)), CurrentFrame)
1223
	    LL.C1 = AnimLerp(CurrentLeftLeg, LLD * CFrame.Angles(0,0,math.rad(7.5 - Lift)), CurrentFrame)
1224
	elseif CurrentAnimation == "Forward" then
1225
		rofTop = 6
1226
		rofBot = 6
1227
	    RA.C0 = AnimLerp(CurrentRightArm, RAD * CFrame.Angles(math.rad(-15),0,math.rad(30)), CurrentFrame)
1228
	    LA.C0 = AnimLerp(CurrentLeftArm, LAD * CFrame.Angles(math.rad(-15),0,math.rad(-30)), CurrentFrame)
1229
	    LR.C1 = AnimLerp(CurrentRightLeg, RLD * CFrame.Angles(math.rad(15),0,math.rad(-7.5)), CurrentFrame)
1230
	    LL.C1 = AnimLerp(CurrentLeftLeg, LLD * CFrame.Angles(math.rad(15),0,math.rad(7.5)), CurrentFrame)
1231
	elseif CurrentAnimation == "Backward" then
1232
		rotTop = -6
1233
		rofBot = -6
1234
	    RA.C0 = AnimLerp(CurrentRightArm, RAD * CFrame.Angles(math.rad(15),0,math.rad(20)), CurrentFrame)
1235
	    LA.C0 = AnimLerp(CurrentLeftArm, LAD * CFrame.Angles(math.rad(15),0,math.rad(-20)), CurrentFrame)
1236
	    LR.C1 = AnimLerp(CurrentRightLeg, RLD * CFrame.Angles(math.rad(-15),0,math.rad(-7.5)), CurrentFrame)
1237
	    LL.C1 = AnimLerp(CurrentLeftLeg, LLD * CFrame.Angles(math.rad(-15),0,math.rad(7.5)), CurrentFrame)
1238
	elseif CurrentAnimation == "SwivelLeft" then
1239
		rofTop = 3
1240
		rofBot = 3
1241
	    RA.C0 = AnimLerp(CurrentRightArm, RAD * CFrame.Angles(math.rad(15),0,math.rad(25)), CurrentFrame)
1242
	    LA.C0 = AnimLerp(CurrentLeftArm, LAD * CFrame.Angles(math.rad(-15),0,math.rad(-25)), CurrentFrame)
1243
	    LR.C1 = AnimLerp(CurrentRightLeg, RLD * CFrame.Angles(math.rad(-10),0,math.rad(-7.5)), CurrentFrame)
1244
	    LL.C1 = AnimLerp(CurrentLeftLeg, LLD * CFrame.Angles(math.rad(10),0,math.rad(7.5)), CurrentFrame)
1245
	elseif CurrentAnimation == "SwivelRight" then
1246
		rofTop = -3
1247
		rofBot = -3
1248
	    RA.C0 = AnimLerp(CurrentRightArm, RAD * CFrame.Angles(math.rad(-15),0,math.rad(25)), CurrentFrame)
1249
	    LA.C0 = AnimLerp(CurrentLeftArm, LAD * CFrame.Angles(math.rad(15),0,math.rad(-25)), CurrentFrame)
1250
	    LR.C1 = AnimLerp(CurrentRightLeg, RLD * CFrame.Angles(math.rad(10),0,math.rad(-7.5)), CurrentFrame)
1251
	    LL.C1 = AnimLerp(CurrentLeftLeg, LLD * CFrame.Angles(math.rad(-10),0,math.rad(7.5)), CurrentFrame)
1252
	elseif CurrentAnimation == "DisableHandAnim" then
1253
		rofBot = 1
1254
		LR.C1 = AnimLerp(CurrentRightLeg, RLD * CFrame.Angles(0,0,math.rad(-7.5)), CurrentFrame)
1255
	    LL.C1 = AnimLerp(CurrentLeftLeg, LLD * CFrame.Angles(0,0,math.rad(7.5)), CurrentFrame)
1256
	end
1257
1258
	LastAnimation = CurrentAnimation
1259
end)
1260
1261
while true do
1262
	for i = 0,10,0.1 do
1263
		Lift = Lift + (math.sin(math.pi*2/10*i)*0.1)
1264
		wait(0.02)
1265
	end
1266
end