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