· 6 years ago · Apr 17, 2019, 10:42 AM
1-- FE template created by MintyLatios (V3rm) aka mikel11114 (ROBLOX)
2local username = "tiop_doop1"
3
4if(script:FindFirstChild'Owner')then
5 repeat wait() until script.Owner.Value
6end
7function GetPlr(user)
8 for _,v in next, game:service'Players':players() do
9 if(v.Name==user)then
10 return v
11 end
12 end
13 return nil
14end
15
16local Player = (script:FindFirstChild'Owner' and script:FindFirstChild'Owner'.Value or GetPlr(username))
17pcall(game.Destroy,script:FindFirstChild'Owner')
18local FakeMouse = script.FakeMouse:Clone();
19FakeMouse.Parent = Player.Character;
20script.FakeMouse:Destroy()
21do
22 local GUID = {}
23 do
24 GUID.IDs = {};
25 function GUID:new(len)
26 local id;
27 if(not len)then
28 id = (tostring(function() end))
29 id = id:gsub("function: ","")
30 else
31 local function genID(len)
32 local newID = ""
33 for i = 1,len do
34 newID = newID..string.char(math.random(48,90))
35 end
36 return newID
37 end
38 repeat id = genID(len) until not GUID.IDs[id]
39 local oid = id;
40 id = {Trash=function() GUID.IDs[oid]=nil; end;Get=function() return oid; end}
41 GUID.IDs[oid]=true;
42 end
43 return id
44 end
45 end
46
47 local AHB = Instance.new("BindableEvent")
48
49 local FPS = 30
50
51 local TimeFrame = 0
52
53 local LastFrame = tick()
54 local Frame = 1/FPS
55
56 game:service'RunService'.Heartbeat:connect(function(s,p)
57 TimeFrame = TimeFrame + s
58 if(TimeFrame >= Frame)then
59 for i = 1,math.floor(TimeFrame/Frame) do
60 AHB:Fire()
61 end
62 LastFrame=tick()
63 TimeFrame=TimeFrame-Frame*math.floor(TimeFrame/Frame)
64 end
65 end)
66
67
68 function swait(dur)
69 if(dur == 0 or typeof(dur) ~= 'number')then
70 AHB.Event:wait()
71 else
72 for i = 1, dur*FPS do
73 AHB.Event:wait()
74 end
75 end
76 end
77
78 local oPlayer = Player
79 local Player = oPlayer
80
81 local loudnesses={}
82 script.Parent = Player.Character
83 local CoAS = {Actions={}}
84 local Event = Instance.new("RemoteEvent")
85 Event.Name = "UserInputEvent"
86 Event.Parent = Player.Character
87 local Func = Instance.new("RemoteFunction")
88 Func.Name = "GetClientProperty"
89 Func.Parent = Player.Character
90 local fakeEvent = function()
91 local t = {_fakeEvent=true,Waited={},Connected={}}
92 t.Connect = function(self,f)
93 local ft={}
94 ft={Disconnected=false;disconnect=function(s) if(self.Function==ft)then self.Function=nil end s.Disconnected=true end}
95 ft.Disconnect=ft.disconnect
96
97 ft.Func=function(...)
98 for id,_ in next, t.Waited do
99 t.Waited[id] = true
100 end
101 return f(...)
102 end;
103
104 table.insert(self.Connected,ft)
105 return ft;
106 end
107 t.connect = t.Connect
108 t.Wait = function()
109 local guid = GUID:new(25)
110 local waitingId = guid:Get()
111 t.Waited[waitingId]=false
112 repeat swait() until t.Waited[waitingId]==true
113 t.Waited[waitingId]=nil;
114 guid:Trash()
115 end
116 t.wait = t.Wait
117 return t
118 end
119 local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
120 local UsIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
121 local Run = {RenderStepped=fakeEvent()}
122
123 function CoAS:BindAction(name,fun,touch,...)
124 CoAS.Actions[name] = {Name=name,Function=fun,Keys={...}}
125 end
126 function CoAS:UnbindAction(name)
127 CoAS.Actions[name] = nil
128 end
129 local function te(self,ev,...)
130 local t = self[ev]
131 if t and t._fakeEvent and t.Connected then
132 for i,v in next, t.Connected do
133 if(v.Func and not v.Disconnected)then
134 v.Func(...)
135 else
136 t.Connected[i]=nil
137 end
138 end
139 end
140 end
141 m.TrigEvent = te
142 UsIS.TrigEvent = te
143 Run.TrigEvent = te
144 Event.OnServerEvent:Connect(function(plr,io)
145 if plr~=Player then return end
146 --[[table.foreach(io,print)
147 print'---']]
148 if io.Mouse then
149 m.Target = io.Target
150 m.Hit = io.Hit
151 elseif io.KeyEvent then
152 m:TrigEvent('Key'..io.KeyEvent,io.Key)
153 elseif io.UserInputType == Enum.UserInputType.MouseButton1 then
154 if io.UserInputState == Enum.UserInputState.Begin then
155 m:TrigEvent("Button1Down")
156 else
157 m:TrigEvent("Button1Up")
158 end
159 end
160 if(not io.KeyEvent and not io.Mouse)then
161
162 for n,t in pairs(CoAS.Actions) do
163 for _,k in pairs(t.Keys) do
164 if k==io.KeyCode then
165 t.Function(t.Name,io.UserInputState,io)
166 end
167 end
168 end
169 if io.UserInputState == Enum.UserInputState.Begin then
170 UsIS:TrigEvent("InputBegan",io,false)
171 else
172 UsIS:TrigEvent("InputEnded",io,false)
173 end
174 end
175 end)
176
177 Func.OnServerInvoke = function(plr,inst,play)
178 if plr~=Player then return end
179 if(inst and typeof(inst) == 'Instance' and inst:IsA'Sound')then
180 loudnesses[inst]=play
181 end
182 end
183
184 function GetClientProperty(inst,prop)
185 if(prop == 'PlaybackLoudness' and loudnesses[inst])then
186 return loudnesses[inst]
187 elseif(prop == 'PlaybackLoudness')then
188 return Func:InvokeClient(Player,'RegSound',inst)
189 end
190 return Func:InvokeClient(Player,inst,prop)
191 end
192 local oldGame = game;
193 function GetFakePlayer()
194 local oldPlayer = Player;
195 local fakePlayer = newproxy(true)
196 getmetatable(fakePlayer).__index = function(s,i)
197 if(i == 'GetMouse')then
198 return function() return m; end
199 end
200 return Player[i]
201 end
202 getmetatable(fakePlayer).__newindex = function(s,i,v)
203 Player[i]=v
204 end
205 getmetatable(fakePlayer).__call=function(self,...)
206 if(self == fakePlayer)then self = Player end
207 local wh = {...}
208 local name = table.remove(wh,1)
209 for i,v in next, wh do
210 wh[i]=v
211 end
212 if(name == 'GetMouse')then
213 return m;
214 end
215 return self(name,unpack(wh))
216 end
217 getmetatable(fakePlayer).__namecall=function(self,...)
218 if(self == fakePlayer)then self = Player end
219 local tuple={...}
220 local name = table.remove(tuple,#tuple)
221
222 if(name == 'GetMouse')then
223 return m;
224 else
225 return self[name](self,unpack(tuple))
226 end
227 end
228
229 return fakePlayer
230 end
231 local oll = LoadLibrary;
232 function LoadLibrary(libtard)
233 local libtarddestroyed=oll(libtard)
234 if(libtard=='RbxUtility')then
235 local library={Create=function(obj)
236 local inst = Instance.new(obj)
237 return function(props)
238 for prop,valu in next, props do
239 inst[prop]=valu
240 end
241 return inst
242 end
243 end}
244 setmetatable(library,{__index=libtarddestroyed,__newindex=function(s,i,v) libtarddestroyed[i]=v end})
245
246 return library
247 else
248 return libtarddestroyed
249 end
250 end
251 fakePlayer = GetFakePlayer()
252 local function GetService(s,i)
253 local service = s:GetService(i)
254 if(i == 'Players')then
255 local oldService = service;
256 local fakeService = newproxy(true)
257 getmetatable(fakeService).__index = function(s,i)
258 if(s == fakeService)then s=oldService end
259 if(i == 'tiop_doop1 or i == 'tiop_doop1')then
260 return fakePlayer
261 elseif(i == 'oPlayer')then
262 return oPlayer
263 else
264 return s[i]
265 end
266 end
267 getmetatable(fakeService).__newindex = function(s,i,v)
268 if(s == fakeService)then s=oldService end
269 s[i]=v
270 end
271 getmetatable(fakeService).__call=function(self,...)
272 if(self == fakeService)then self = oldService end
273 local wh = {...}
274 local name = table.remove(wh,1)
275 for i,v in next, wh do
276 wh[i]=v
277 end
278 return self(name,unpack(wh))
279 end
280 getmetatable(fakeService).__namecall=function(self,...)
281 if(self == fakeService)then self = oldService end
282 local tuple={...}
283 local name = table.remove(tuple,#tuple)
284
285 return self[name](self,unpack(tuple))
286 end
287 getmetatable(fakeService).__metatable = 'gay'
288 return fakeService
289 elseif(i == 'RunService')then
290 local oldService = service;
291 local fakeService = newproxy(true)
292 getmetatable(fakeService).__index = function(s,i)
293 if(s == fakeService)then s=oldService end
294 return Run[i] or s[i]
295 end
296 getmetatable(fakeService).__newindex = function(s,i,v)
297 if(s == fakeService)then s=oldService end
298 s[i]=v
299 end
300 getmetatable(fakeService).__call=function(self,...)
301 if(self == fakeService)then self = oldService end
302 local wh = {...}
303 local name = table.remove(wh,1)
304 for i,v in next, wh do
305 wh[i]=v
306 end
307 return self(name,unpack(wh))
308 end
309 getmetatable(fakeService).__namecall=function(self,...)
310 if(self == fakeService)then self = oldService end
311 local tuple={...}
312 local name = table.remove(tuple,#tuple)
313
314 return self[name](self,unpack(tuple))
315 end
316 getmetatable(fakeService).__metatable = 'gay'
317 return fakeService
318 elseif(i == 'UserInputService')then
319 return UsIS
320 elseif(i == 'ContextActionService')then
321 return CoAS;
322 else
323 return service
324 end
325 end
326
327 local new = Instance.new;
328 Instance = {}
329 Instance.new = function(inst,obje)
330 local lp = GetService(oldGame,'Players').tiop_doop1
331 local instance = new(inst)
332 if(inst=='ObjectValue')then
333 local fake = newproxy(true)
334 getmetatable(fake).__index=function(self,index)
335 if(self==fake)then self=instance end
336 return self[index]
337 end
338 getmetatable(fake).__newindex=function(self,index,value)
339 if(self==fake)then self=instance end
340 if(index=='Value' and typeof(value)~='Instance' and value==fakePlayer)then
341 self[index]=oPlayer
342 else
343 self[index]=value
344 end
345 end
346 getmetatable(fake).__call=function(self,...)
347 if(self == fake)then self = instance end
348 local wh = {...}
349 local name = table.remove(wh,1)
350 for i,v in next, wh do
351 if(v == fake)then v = instance end
352 wh[i]=v
353 end
354 return self(name,unpack(wh))
355 end
356 getmetatable(fake). __namecall=function(self,...)
357 if(self == fake)then self = instance end
358 local tuple={...}
359 local name = table.remove(tuple,#tuple)
360 return self[name](self,unpack(tuple))
361 end
362 return fake
363 else
364 instance.Parent = obje
365 return instance;
366 end
367
368 end
369 local serviceFunctions={
370 service=true,
371 GetService=true,
372 }
373 local fakeGame = newproxy(true)
374 getmetatable(fakeGame).__index = function(s,i)
375 if(s == fakeGame)then s=oldGame end
376 local serv = GetService(oldGame,i)
377 if serviceFunctions[i] then
378 return GetService
379 elseif(serv)then
380 return serv
381 else
382 return s[i]
383 end
384 end
385 getmetatable(fakeGame).__newindex = function(s,i,v)
386 if(s == fakeGame)then s=oldGame end
387 s[i]=v
388 end
389 getmetatable(fakeGame).__call=function(self,...)
390 if(self == fakeGame)then self = oldGame end
391 local wh = {...}
392 local name = table.remove(wh,1)
393 for i,v in next, wh do
394 if(v == fakeGame)then v = oldGame end
395 wh[i]=v
396 end
397 if serviceFunctions[name] then
398 return GetService(self,unpack(wh))
399 else
400 return self(name,unpack(wh))
401 end
402 end
403 getmetatable(fakeGame). __namecall=function(self,...)
404 if(self == fakeGame)then self = oldGame end
405 local tuple={...}
406 local name = table.remove(tuple,#tuple)
407
408 local funcToCall=self[name]
409
410 if serviceFunctions[name] then
411 return GetService(self,unpack(tuple))
412 else
413 return self[name](self,unpack(tuple))
414 end
415 end
416 getmetatable(fakeGame).__metatable = 'gay'
417
418 coroutine.wrap(function()
419 while true do
420 Run:TrigEvent('RenderStepped')
421 swait()
422 end
423 end)()
424 game=fakeGame
425 UserInputService,ContextActionService = UsIS,CoAS
426end
427
428
429
430
431--[[local egui = script:WaitForChild'ETHGUI':Clone();
432egui.Parent=game:GetService("Players").tiop_doop1:FindFirstChildOfClass'PlayerGui'
433
434local main = egui:WaitForChild'Main'
435local info = main:WaitForChild'InfoBG':WaitForChild'Info':WaitForChild'Text'
436local use = main:WaitForChild'Play':WaitForChild'Button'
437info.Text=[[
438Credit to Lunnekoo for StarGlitcher.
439
440CASSIDY, THE ETHEREAL GLITCHER.
441PROTECTOR OF SOULS.
442
443DEVELOPERS:
444mikel (SpectrumEeveez) -- LEAD DEV / OWNER
445wanTH092 (Filano) -- LEAD DEV / CO-OWNER
446KrYn0MoRe(AlmightyToast) -- CORE DEV (rip toasty he'll be missed)
447DerpzDeNugget_YT -- Associated Dev
448KillerzTH -- Associated Dev
449Nebula_Zorua(aka mikel11114) -- SEMI-MAIN DEV
450Salvo_Starly(aka Blazey) -- GUI/SEMI-MAIN DEV
451UnfairGaming1(Very) -- Associated Dev
452RoStrap Devs -- Ripple effect
453
454CHANGELOGS:
455KEEP THE CHANGELOGS OF PAST 3 UPDATES.
456+ : ADDED FEATURE
457- : REMOVED FEATURE
458* : CHANGE
459# : FIXES
460/ : NOTES
461--------------------------
462mikel11114:
463* New Antecedent wings
464
465/ Check if your camshake is too shakey now or not.
466--------------------------
467SALVO_STARLY:
468+ Added new boss chatfunc. Press H to show.
469* Make delaying time longer on showdamage.
470# Fixed RecolorThing(pcall)
471--------------------------
472mikel11114:
473* Updated EQUILIBRIUM's idle a bit
474* Updated the camshake.
475* Updated wings. Same base, just slightly different.
476- Removed COMMOTIAUS's X.
477* Removed un-needed code and coroutines
478* Nerfed Cursed Slash
479
480/ Check if your camshake is too shakey now or not.
481
482
483
484local clickedButton=false;
485local hovering=false
486
487if(game:service'RunService':IsClient())then
488 local libraries={}
489
490 for _,v in next, script:WaitForChild'Libraries':children() do
491 shared[v.Name:lower()]=v;
492 end
493
494 local pseudo=require(shared.pseudoinstance)
495 local rippl=pseudo.new'Rippler'
496 rippl.RippleTransparency = 0.3
497 rippl.Parent = use
498 main:TweenPosition(UDim2.new(.165,0,.288,0),Enum.EasingDirection.Out,Enum.EasingStyle.Back,2)
499
500 use.InputBegan:connect(function(io)
501 if(io.UserInputType==Enum.UserInputType.MouseButton1)then
502 rippl:Down(io.Position.X,io.Position.Y)
503 elseif(io.UserInputType==Enum.UserInputType.MouseMovement)then
504 hovering=true
505 use.Size=UDim2.new(1,0,1,0)
506 use.Position=UDim2.new(0,0,0,0)
507 use.BackgroundColor3 = Color3.fromRGB(0,200,0)
508 end
509 end)
510
511 use.InputEnded:connect(function(io)
512 rippl:Up()
513 if(io.UserInputType==Enum.UserInputType.MouseButton1 and hovering)then clickedButton=true end
514 if(io.UserInputType==Enum.UserInputType.MouseMovement)then
515 hovering=false
516 use.Size=UDim2.new(.973,0,1,0)
517 use.Position=UDim2.new(0.027,0,0,0)
518 use.BackgroundColor3 = Color3.fromRGB(0,255,0)
519 end
520 end)
521
522 repeat
523 wait()
524 pcall(function() main.Title.Rotation=math.rad(45*math.sin(time()*2)) end)
525 local hue = (time()%360)*30
526 if(hue/360 >= 1)then
527 hue = hue - math.floor(hue/360)*360
528 end
529 pcall(function() main.Title.TextColor3 = Color3.fromHSV(hue/360,1,1) end)
530 until clickedButton
531 main:TweenPosition(UDim2.new(1,0,.288,0),Enum.EasingDirection.In,Enum.EasingStyle.Back,1,true,function()
532 egui:destroy()
533 end)
534else
535 local rem = Instance.new("RemoteEvent")
536 rem.Name = "Clickie"
537 rem.OnServerEvent:connect(function(plr)
538 if(plr.Name==game:service'Players'.tiop_doop1.Name)then
539 print'fired'
540 clickedButton=true
541 rem:destroy()
542 game:service'Debris':AddItem(egui,3)
543 end
544 end)
545 script:WaitForChild'Libraries'.Parent = egui
546 rem.Parent=egui
547 egui:WaitForChild'EthGUICode'.Disabled=false
548 repeat wait() print(clickedButton) until clickedButton
549end]]
550
551
552
553NewInstance = function(instance,parent,properties)
554 local inst = Instance.new(instance)
555 inst.Parent = parent
556 if(properties)then
557 for i,v in next, properties do
558 pcall(function() inst[i] = v end)
559 end
560 end
561 return inst;
562end
563-- Script --
564
565plr = game:GetService("Players").tiop_doop1
566Player = plr
567char = plr.Character
568hum = char.Humanoid
569mouse = plr:GetMouse()
570local cam = game.Workspace.CurrentCamera
571Camera = cam
572local CamInterrupt = false
573local TwoD = false
574local TargetInfo = {nil, nil}
575cam.CameraType = "Custom"
576t = char.Torso
577h = char.Head
578ra = char["Right Arm"]
579la = char["Left Arm"]
580rl = char["Right Leg"]
581ll = char["Left Leg"]
582tors = char.Torso
583lleg = char["Left Leg"]
584root = char.HumanoidRootPart
585hed = char.Head
586rleg = char["Right Leg"]
587rarm = char["Right Arm"]
588larm = char["Left Arm"]
589radian = math.rad
590random = math.random
591Vec3 = Vector3.new
592Inst = Instance.new
593cFrame = CFrame.new
594Euler = CFrame.fromEulerAnglesXYZ
595vt = Vector3.new
596bc = BrickColor.new
597br = BrickColor.random
598it = Instance.new
599cf = CFrame.new
600local Player_Size = 0
601cam = game.Workspace.CurrentCamera
602CF = CFrame.new
603angles = CFrame.Angles
604attack = false
605Euler = CFrame.fromEulerAnglesXYZ
606Rad = math.rad
607IT = Instance.new
608BrickC = BrickColor.new
609Cos = math.cos
610Acos = math.acos
611Sin = math.sin
612Asin = math.asin
613Abs = math.abs
614Mrandom = math.random
615Floor = math.floor
616IT = Instance.new
617CF = CFrame.new
618VT = Vector3.new
619RAD = math.rad
620C3 = Color3.new
621UD2 = UDim2.new
622BRICKC = BrickColor.new
623ANGLES = CFrame.Angles
624EULER = CFrame.fromEulerAnglesXYZ
625COS = math.cos
626ACOS = math.acos
627SIN = math.sin
628ASIN = math.asin
629ABS = math.abs
630MRANDOM = math.random
631FLOOR = math.floor
632local SINE = 0
633local RootCF = CFrame.fromEulerAnglesXYZ(-1.57, 0, 3.14)
634local RHCF = CFrame.fromEulerAnglesXYZ(0, 1.6, 0)
635local LHCF = CFrame.fromEulerAnglesXYZ(0, -1.6, 0)
636local ModeOfGlitch = 1
637CF = CFrame.new
638local hed = char.Head
639local root = char.HumanoidRootPart
640local rootj = root.RootJoint
641local tors = char.Torso
642Player_Size = 1
643Cos = math.cos
644Sin = math.sin
645Rad = math.rad
646CF = CFrame.new
647local DoDamage = true
648local FlyingTypes = false
649local visWings={0,0,0,0,0,0}
650
651local Booleans = {
652 CamFollow = true,
653 GyroUse = true
654}
655
656function lerp(object, newCFrame, alpha)
657 return object:lerp(newCFrame, alpha)
658end
659
660local Directer = Inst("BodyGyro", root)
661Directer.MaxTorque = Vec3(0, 0, 0)
662Directer.P = 600000
663local CPart = Inst("Part")
664CPart.Anchored = true
665CPart.CanCollide = false
666CPart.Locked = true
667CPart.Transparency = 1
668
669
670
671local CRAZED = false
672local rainbowmode = false
673local chaosmode = false
674local Error = false
675local unstablemode = false
676local MAINRUINCOLOR = BrickColor.new("Bright bluish green")
677local SECONDRUINCOLOR = BrickColor.new("Pastel blue-green")
678
679local cp="2071274388"
680local kan = Instance.new("Sound",Torso)
681kan.Volume = 1.25
682kan.TimePosition = 0
683kan.PlaybackSpeed = 1
684kan.Pitch = 1
685kan.SoundId = "rbxassetid://2071274388"
686kan.Name = "wrecked"
687kan.Looped = true
688kan:Play()
689
690local currentThemePlaying = kan.SoundId
691local currentPitch = kan.Pitch
692local currentVol = kan.Volume
693function newTheme(ID,timepos,pitch,vol)
694local kanz = kan
695--kanz:Stop()
696kanz.Volume = vol
697--kanz.TimePosition = timepos
698kanz.PlaybackSpeed = pitch
699kanz.Pitch = pitch
700kanz.SoundId = ID
701kanz.Name = "wrecked"
702kanz.Looped = true
703currentThemePlaying = kanz.SoundId
704currentVol = kanz.Volume
705currentPitch = kanz.Pitch
706end
707
708
709function newThemeCust(ID,timepos,pitch,vol)
710local kanz = kan
711kanz:Stop()
712kanz.Volume = vol
713kanz.TimePosition = timepos
714kanz.PlaybackSpeed = pitch
715kanz.Pitch = pitch
716kanz.SoundId = ID
717kanz.Name = "wrecked"
718kanz.Looped = true
719currentThemePlaying = kanz.SoundId
720currentVol = kanz.Volume
721currentPitch = kanz.Pitch
722kanz:Play()
723end
724
725local mutedtog = false
726
727ArtificialHB = Instance.new("BindableEvent", script)
728ArtificialHB.Name = "ArtificialHB"
729
730script:WaitForChild("ArtificialHB")
731Frame_Speed = 1 / 60
732frame = Frame_Speed
733tf = 0
734allowframeloss = false
735tossremainder = false
736lastframe = tick()
737script.ArtificialHB:Fire()
738
739game:GetService("RunService").Heartbeat:connect(function(s, p)
740 tf = tf + s
741 if tf >= frame then
742 if allowframeloss then
743 script.ArtificialHB:Fire()
744 lastframe = tick()
745 else
746 for i = 1, math.floor(tf / frame) do
747 script.ArtificialHB:Fire()
748 end
749 lastframe = tick()
750 end
751 if tossremainder then
752 tf = 0
753 else
754 tf = tf - frame * math.floor(tf / frame)
755 end
756 end
757end)
758
759------------------
760function swait(num)
761if num == 0 or num == nil then
762 ArtificialHB.Event:wait()
763 else
764 for i = 1, num do
765 ArtificialHB.Event:wait()
766 end
767 end
768end
769
770local Instance = setmetatable({ClearChildrenOfClass = function(where,class,recursive) local children = (recursive and where:GetDescendants() or where:GetChildren()) for _,v in next, children do if(v:IsA(class))then v:destroy();end;end;end},{__index = Instance})
771
772--// Require stuff \\--
773FXFolder=script.Effects
774function CamShake(who,data)
775 coroutine.wrap(function()
776 if(FXFolder:FindFirstChild'CamShake')then
777 local cam = FXFolder.CamShake:Clone()
778 cam:WaitForChild'intensity'.Value = data.Intensity or 5
779 cam:WaitForChild'duration'.Value = data.Duration or 5
780 cam:WaitForChild'speed'.Value = data.Speed or 10;
781 if(data.Origin)then NewInstance((typeof(data.Origin) == 'Instance' and "ObjectValue" or typeof(data.Origin) == 'Vector3' and 'Vector3Value' or typeof(data.Origin)=='CFrame' and 'CFrameValue'),cam,{Name='origin',Value=data.Origin}) end
782 cam:WaitForChild'rot'.Value = data.Rotation or Vector3.new(1,1,5)
783 cam:WaitForChild'pos'.Value = data.Position or Vector3.new(.5,.5,.5)
784 cam:WaitForChild'startdist'.Value = data.DropDist or 25;
785 cam:WaitForChild'enddist'.Value = data.IneffectiveDist or 150;
786
787 cam.Parent = who
788 wait()
789 cam.Disabled = false
790 end
791 end)()
792end
793
794function CamShakeAll(data)
795 for _,v in next, game:service'Players':players() do
796 CamShake(v:FindFirstChildOfClass'PlayerGui' or v:FindFirstChildOfClass'Backpack' or v.Character,data)
797 end
798end
799
800
801local toggleTag = true
802local bilguit = Instance.new("BillboardGui", hed)
803bilguit.Adornee = nil
804bilguit.Name = "ModeName"
805bilguit.Size = UDim2.new(4, 0, 1.2, 0)
806bilguit.StudsOffset = Vector3.new(-8, 8/1.5, 0)
807local modet = Instance.new("TextLabel", bilguit)
808modet.Size = UDim2.new(10/2, 0, 7/2, 0)
809modet.FontSize = "Size8"
810modet.TextScaled = true
811modet.TextTransparency = 0
812modet.BackgroundTransparency = 1
813modet.TextTransparency = 0
814modet.TextStrokeTransparency = 0
815modet.Font = "Antique"
816modet.TextStrokeColor3 = Color3.new(1,0,0)
817modet.TextColor3 = Color3.new(0.25,0,0)
818modet.Text = "COMMOTIAUS"
819
820
821function chatfunc(text,color,typet,font,timeex)
822local chat = coroutine.wrap(function()
823if Character:FindFirstChild("TalkingBillBoard")~= nil then
824Character:FindFirstChild("TalkingBillBoard"):destroy()
825end
826local naeeym2 = Instance.new("BillboardGui",Character)
827naeeym2.Size = UDim2.new(0,100,0,40)
828naeeym2.StudsOffset = Vector3.new(0,3,0)
829naeeym2.Adornee = Character.Head
830naeeym2.Name = "TalkingBillBoard"
831local tecks2 = Instance.new("TextLabel",naeeym2)
832tecks2.BackgroundTransparency = 1
833tecks2.BorderSizePixel = 0
834tecks2.Text = ""
835tecks2.Font = font
836tecks2.TextSize = 30
837tecks2.TextStrokeTransparency = 0
838tecks2.TextColor3 = color
839tecks2.TextStrokeColor3 = Color3.new(0,0,0)
840tecks2.Size = UDim2.new(1,0,0.5,0)
841local tecks3 = Instance.new("TextLabel",naeeym2)
842tecks3.BackgroundTransparency = 1
843tecks3.BorderSizePixel = 0
844tecks3.Text = ""
845tecks3.Font = font
846tecks3.TextSize = 30
847tecks3.TextStrokeTransparency = 0
848if typet == "Inverted" then
849tecks3.TextColor3 = Color3.new(0,0,0)
850tecks3.TextStrokeColor3 = color
851elseif typet == "Normal" then
852tecks3.TextColor3 = color
853tecks3.TextStrokeColor3 = Color3.new(0,0,0)
854end
855tecks3.Size = UDim2.new(1,0,0.5,0)
856modet.TextTransparency = modet.TextTransparency + 1
857modet.TextStrokeTransparency = modet.TextStrokeTransparency + 1
858for i = 0, 74*timeex do
859swait()
860modet.TextTransparency = 1
861modet.TextStrokeTransparency = 1
862tecks2.Text = text
863tecks3.Text = text
864end
865local randomrot = math.random(1,2)
866if randomrot == 1 then
867for i = 1, 50 do
868swait()
869tecks2.Text = text
870tecks3.Text = text
871modet.TextTransparency = modet.TextTransparency - .02
872modet.TextStrokeTransparency = modet.TextStrokeTransparency - .02
873tecks2.TextStrokeTransparency = tecks2.TextStrokeTransparency +.04
874tecks2.TextTransparency = tecks2.TextTransparency + .04
875tecks3.TextStrokeTransparency = tecks2.TextStrokeTransparency +.04
876tecks3.TextTransparency = tecks2.TextTransparency + .04
877end
878elseif randomrot == 2 then
879 for i = 1, 50 do
880swait()
881tecks2.Text = text
882tecks3.Text = text
883modet.TextTransparency = modet.TextTransparency - .02
884modet.TextStrokeTransparency = modet.TextStrokeTransparency - .02
885tecks2.TextStrokeTransparency = tecks2.TextStrokeTransparency +.04
886tecks2.TextTransparency = tecks2.TextTransparency + .04
887tecks3.TextStrokeTransparency = tecks2.TextStrokeTransparency +.04
888tecks3.TextTransparency = tecks2.TextTransparency + .04
889end
890end
891modet.TextTransparency = 0
892modet.TextStrokeTransparency = 0
893if toggleTag == false then
894modet.TextTransparency = 1
895modet.TextStrokeTransparency = 1
896end
897naeeym2:Destroy()
898end)
899chat()
900end
901
902local rai = {"USER","User","USer","USEr","uSER","usER","useR","uSer","usEr","useR","PlAyEr","666"}
903
904function bosschatfunc(text,color,watval)
905for i,v in pairs(game:GetService("Players"):GetPlayers()) do
906coroutine.resume(coroutine.create(function()
907if v.PlayerGui:FindFirstChild("Dialog")~= nil then
908v.PlayerGui:FindFirstChild("Dialog"):destroy()
909end
910local scrg = Instance.new("ScreenGui",v.PlayerGui)
911CFuncs["EchoSound"].Create("rbxassetid://525200869", scrg, 0.5, 1,0,10,0.1,0.25,1)
912scrg.Name = "Dialog"
913local txtlb = Instance.new("TextLabel",scrg)
914txtlb.Text = ""
915txtlb.Font = "Arcade"
916txtlb.TextColor3 = Color3.new(0,0,0)
917txtlb.TextStrokeTransparency = 0
918txtlb.BackgroundTransparency = 0.75
919txtlb.BackgroundColor3 = Color3.new(0,0,0)
920txtlb.TextStrokeColor3 = color
921txtlb.TextScaled = true
922txtlb.Size = UDim2.new(1,0,0.25,0)
923txtlb.TextXAlignment = "Left"
924txtlb.Position = UDim2.new(0,0,0.75 + 1,0)
925local txtlb2 = Instance.new("TextLabel",scrg)
926txtlb2.Text = modet.Text.." USER:"
927txtlb2.Font = "Arcade"
928txtlb2.TextColor3 = Color3.new(0,0,0)
929txtlb2.TextStrokeTransparency = 0
930txtlb2.BackgroundTransparency = 1
931txtlb2.TextStrokeColor3 = color
932txtlb2.TextSize = 40
933txtlb2.Size = UDim2.new(1,0,0.25,0)
934txtlb2.TextXAlignment = "Left"
935txtlb2.Position = UDim2.new(0,0,1,0)
936local fvalen = 0.55
937local fval = -0.49
938local flol = 1.75
939local flil = 1.6
940 for i = 0, 9 do
941 swait()
942 fval = fval + 0.05
943 flol = flol - 0.1
944 flil = flil - 0.1
945 txtlb.Text = ""
946 txtlb.Position = UDim2.new(0,0,flol,0)
947 txtlb2.Position = UDim2.new(0,0,flil,0)
948 end
949 txtlb.Text = text
950wait(watval)
951local valinc = 0
952for i = 0, 99 do
953swait()
954valinc = valinc + 0.0001
955flol = flol + valinc
956flil = flil + valinc
957txtlb.Rotation = txtlb.Rotation + valinc*20
958txtlb2.Rotation = txtlb2.Rotation - valinc*50
959txtlb.Position = UDim2.new(0,0,flol,0)
960txtlb2.Position = UDim2.new(0,0,flil,0)
961txtlb.TextStrokeTransparency = txtlb.TextStrokeTransparency + 0.01
962txtlb.TextTransparency = txtlb.TextTransparency + 0.01
963txtlb2.TextStrokeTransparency = txtlb2.TextStrokeTransparency + 0.01
964txtlb2.TextTransparency = txtlb2.TextTransparency + 0.01
965txtlb.BackgroundTransparency = txtlb.BackgroundTransparency + 0.0025
966end
967scrg:Destroy()
968end))
969end
970end
971
972--[[
973 function CamShake(who,data)
974 coroutine.wrap(function()
975 if(FXFolder:FindFirstChild'CamShake')then
976 local cam = FXFolder.CamShake:Clone()
977 cam:WaitForChild'intensity'.Value = data.Intensity or 5
978 cam:WaitForChild'duration'.Value = data.Duration or 5
979 cam:WaitForChild'speed'.Value = data.Speed or 10;
980 if(data.Origin)then NewInstance((typeof(data.Origin) == 'Instance' and "ObjectValue" or typeof(data.Origin) == 'Vector3' and 'Vector3Value' or typeof(data.Origin)=='CFrame' and 'CFrameValue'),cam,{Name='origin',Value=data.Origin}) end
981 cam:WaitForChild'rot'.Value = data.Rotation or Vector3.new(1,1,5)
982 cam:WaitForChild'pos'.Value = data.Position or Vector3.new(.5,.5,.5)
983 cam:WaitForChild'startdist'.Value = data.DropDist or 25;
984 cam:WaitForChild'enddist'.Value = data.IneffectiveDist or 150;
985
986 cam.Parent = who
987 wait()
988 cam.Disabled = false
989 end
990 end)()
991end
992
993function CamShakeAll(data)
994 for _,v in next, game:service'Players':players() do
995 CamShake(v:FindFirstChildOfClass'PlayerGui' or v:FindFirstChildOfClass'Backpack' or v.Character,data)
996 end
997end
998--]]
999function newbosschatfunc(text,color1,color2,delay)
1000 for _,v in next, game:service'Players':players() do
1001 coroutine.wrap(function()
1002 if(FXFolder:FindFirstChild'BossChat' and v.Character)then
1003 local cha = FXFolder.BossChat:Clone()
1004 cha.Color1.Value=color1
1005 cha.Color2.Value=color2
1006 cha.Text.Value=text
1007 cha.Ghghghghgh.Value=delay
1008 cha.Mode.Value=ModeOfGlitch
1009 cha.ModeName.Value=modet.Text
1010 cha.Music.Value=kan
1011 cha.Parent=v.Character
1012 wait()
1013 cha.Disabled = false
1014 game:service'Debris':AddItem(cha,(delay/60)*4)
1015 end
1016 end)()
1017 end
1018end
1019local Create = LoadLibrary("RbxUtility").Create
1020
1021CFuncs = {
1022 ["Part"] = {
1023 Create = function(Parent, Material, Reflectance, Transparency, BColor, Name, Size)
1024 local Part = Create("Part"){
1025 Parent = Parent,
1026 Reflectance = Reflectance,
1027 Transparency = Transparency,
1028 CanCollide = false,
1029 Locked = true,
1030 BrickColor = BrickColor.new(tostring(BColor)),
1031 Name = Name,
1032 Size = Size,
1033 Material = Material,
1034 }
1035 RemoveOutlines(Part)
1036 return Part
1037 end;
1038 };
1039
1040 ["Mesh"] = {
1041 Create = function(Mesh, Part, MeshType, MeshId, OffSet, Scale)
1042 local Msh = Create(Mesh){
1043 Parent = Part,
1044 Offset = OffSet,
1045 Scale = Scale,
1046 }
1047 if Mesh == "SpecialMesh" then
1048 Msh.MeshType = MeshType
1049 Msh.MeshId = MeshId
1050 end
1051 return Msh
1052 end;
1053 };
1054
1055 ["Mesh"] = {
1056 Create = function(Mesh, Part, MeshType, MeshId, OffSet, Scale)
1057 local Msh = Create(Mesh){
1058 Parent = Part,
1059 Offset = OffSet,
1060 Scale = Scale,
1061 }
1062 if Mesh == "SpecialMesh" then
1063 Msh.MeshType = MeshType
1064 Msh.MeshId = MeshId
1065 end
1066 return Msh
1067 end;
1068 };
1069
1070 ["Weld"] = {
1071 Create = function(Parent, Part0, Part1, C0, C1)
1072 local Weld = Create("Weld"){
1073 Parent = Parent,
1074 Part0 = Part0,
1075 Part1 = Part1,
1076 C0 = C0,
1077 C1 = C1,
1078 }
1079 return Weld
1080 end;
1081 };
1082
1083 ["Sound"] = {
1084 Create = function(id, par, vol, pit)
1085 local S = Create("Sound"){
1086 Volume = vol,
1087 Name = "EffectSoundo",
1088 Pitch = pit or 1,
1089 SoundId = id,
1090 Parent = par or workspace,
1091 }
1092 S:play()
1093 game:GetService("Debris"):AddItem(S, 10)
1094 end;
1095 };
1096
1097 ["TimeSound"] = {
1098 Create = function(id, par, vol, pit, timepos)
1099 local S = Create("Sound"){
1100 Volume = vol,
1101 Name = "EffectSoundo",
1102 Pitch = pit or 1,
1103 SoundId = id,
1104 TimePosition = timepos,
1105 Parent = par or workspace,
1106 }
1107 wait()
1108 S:play()
1109 game:GetService("Debris"):AddItem(S, 10)
1110 end;
1111 };
1112 ["EchoSound"] = {
1113 Create = function(id, par, vol, pit, timepos,delays,echodelay,fedb,dryl)
1114 local Sas = Create("Sound"){
1115 Volume = vol,
1116 Name = "EffectSoundo",
1117 Pitch = pit or 1,
1118 SoundId = id,
1119 TimePosition = timepos,
1120 Parent = par or workspace,
1121 }
1122 local E = Create("EchoSoundEffect"){
1123 Delay = echodelay,
1124 Name = "Echo",
1125 Feedback = fedb,
1126 DryLevel = dryl,
1127 Parent = Sas,
1128 }
1129 wait()
1130 Sas:play()
1131 game:GetService("Debris"):AddItem(Sas, delays)
1132 end;
1133 };
1134
1135["LongSound"] = {
1136 Create = function(id, par, vol, pit)
1137 local S = Create("Sound"){
1138 Volume = vol,
1139 Pitch = pit or 1,
1140 SoundId = id,
1141 Parent = par or workspace,
1142 }
1143 wait()
1144 S:play()
1145 game:GetService("Debris"):AddItem(S, 60)
1146 end;
1147 };
1148
1149 ["ParticleEmitter"] = {
1150 Create = function(Parent, Color1, Color2, LightEmission, Size, Texture, Transparency, ZOffset, Accel, Drag, LockedToPart, VelocityInheritance, EmissionDirection, Enabled, LifeTime, Rate, Rotation, RotSpeed, Speed, VelocitySpread)
1151 local fp = Create("ParticleEmitter"){
1152 Parent = Parent,
1153 Color = ColorSequence.new(Color1, Color2),
1154 LightEmission = LightEmission,
1155 Size = Size,
1156 Texture = Texture,
1157 Transparency = Transparency,
1158 ZOffset = ZOffset,
1159 Acceleration = Accel,
1160 Drag = Drag,
1161 LockedToPart = LockedToPart,
1162 VelocityInheritance = VelocityInheritance,
1163 EmissionDirection = EmissionDirection,
1164 Enabled = Enabled,
1165 Lifetime = LifeTime,
1166 Rate = Rate,
1167 Rotation = Rotation,
1168 RotSpeed = RotSpeed,
1169 Speed = Speed,
1170 VelocitySpread = VelocitySpread,
1171 }
1172 return fp
1173 end;
1174 };
1175
1176 CreateTemplate = {
1177
1178 };
1179}
1180
1181
1182
1183New = function(Object, Parent, Name, Data)
1184 local Object = Instance.new(Object)
1185 for Index, Value in pairs(Data or {}) do
1186 Object[Index] = Value
1187 end
1188 Object.Parent = Parent
1189 Object.Name = Name
1190 return Object
1191end
1192local halocolor = BrickColor.new("Pastel light blue")
1193local halocolor2 = BrickColor.new("Cool yellow")
1194local starcolor = BrickColor.new("Bright yellow")
1195local lunacolor = BrickColor.new("Navy blue")
1196local lunacolor2 = BrickColor.new("Bright blue")
1197local wepcolor = BrickColor.new("Really black")
1198local maincolor = BrickColor.new("Really black")
1199local m = Instance.new("Model",char)
1200local m2 = Instance.new("Model",char)
1201local m3 = Instance.new("Model",char)
1202local mw1 = Instance.new("Model",char)
1203local mw2 = Instance.new("Model",char)
1204local mwN = Instance.new("Model",char)
1205local mwY = Instance.new("Model",char)
1206
1207local est = {"error","Errors","eRror","erRor","errOr","erroR","ERror","ErRor","ErrOr","ErroR","eRRor","eRrOr","eRroR","erROr","erRoR","errOR","ERROR"}
1208
1209
1210
1211gui = function(GuiType, parent, text, backtrans, backcol, pos, size)
1212 local gui = it(GuiType)
1213 gui.Parent = parent
1214 gui.Text = text
1215 gui.BackgroundTransparency = backtrans
1216 gui.BackgroundColor3 = backcol
1217 gui.SizeConstraint = "RelativeXY"
1218 gui.TextXAlignment = "Center"
1219 gui.TextYAlignment = "Center"
1220 gui.Position = pos
1221 gui.Size = size
1222 gui.Font = "SourceSans"
1223 gui.FontSize = "Size14"
1224 gui.TextWrapped = false
1225 gui.TextStrokeTransparency = 0
1226 gui.TextColor = BrickColor.new("White")
1227 return gui
1228end
1229--------------------------- GUI STUFF
1230local basgui = it("GuiMain")
1231basgui.Parent = plr.PlayerGui
1232basgui.Name = "VISgui"
1233local fullscreenz = it("Frame")
1234fullscreenz.Parent = basgui
1235fullscreenz.BackgroundColor3 = Color3.new(255, 255, 255)
1236fullscreenz.BackgroundTransparency = .5
1237fullscreenz.BorderColor3 = Color3.new(17, 17, 17)
1238fullscreenz.AnchorPoint=Vector2.new(1,.5)
1239fullscreenz.Size = UDim2.new(.2, 0, 1.2, 0)
1240fullscreenz.Position = UDim2.new(1.01, 0, .5, 0)
1241fullscreenz.BorderSizePixel=12
1242fullscreenz.ZIndex=2
1243local fullscreenz2 = it("Frame")
1244fullscreenz2.Parent = fullscreenz
1245fullscreenz2.BackgroundTransparency = 1
1246fullscreenz2.AnchorPoint=Vector2.new(.5,.5)
1247fullscreenz2.Size = UDim2.new(1, 0, 1, 0)
1248fullscreenz2.Position = UDim2.new(.5, 0, .5, 0)
1249fullscreenz2.ClipsDescendants=true
1250
1251local hh1 = it("Frame")
1252hh1.Parent = fullscreenz
1253hh1.BackgroundColor3 = Color3.new(255, 255, 255)
1254hh1.BackgroundTransparency = .5
1255hh1.BorderColor3 = Color3.new(17, 17, 17)
1256hh1.AnchorPoint=Vector2.new(.5,.5)
1257hh1.Size = UDim2.new(.04, 0, 1.2, 0)
1258hh1.Position = UDim2.new(-.1, 0, .5, 0)
1259hh1.BorderSizePixel=0
1260hh1.ZIndex=4
1261
1262
1263local hh2 = it("Frame")
1264hh2.Parent = fullscreenz
1265hh2.BackgroundColor3 = Color3.new(255, 255, 255)
1266hh2.BackgroundTransparency = .5
1267hh2.BorderColor3 = Color3.new(17, 17, 17)
1268hh2.AnchorPoint=Vector2.new(.5,.5)
1269hh2.Size = UDim2.new(.025, 0, 1.2, 0)
1270hh2.Position = UDim2.new(-.14, 0, .5, 0)
1271hh2.BorderSizePixel=0
1272hh2.ZIndex=4
1273
1274
1275local hh3 = it("Frame")
1276hh3.Parent = fullscreenz
1277hh3.BackgroundColor3 = Color3.new(255, 255, 255)
1278hh3.BackgroundTransparency = .5
1279hh3.BorderColor3 = Color3.new(17, 17, 17)
1280hh3.AnchorPoint=Vector2.new(.5,.5)
1281hh3.Size = UDim2.new(.01, 0, 1.2, 0)
1282hh3.Position = UDim2.new(-.16, 0, .5, 0)
1283hh3.BorderSizePixel=0
1284hh3.ZIndex=4
1285
1286
1287local vis1 = it("Frame")
1288vis1.Parent = fullscreenz2
1289vis1.BackgroundColor3 = Color3.new(255, 255, 255)
1290vis1.BackgroundTransparency = .5
1291vis1.BorderColor3 = Color3.new(17, 17, 17)
1292vis1.AnchorPoint=Vector2.new(.5,1)
1293vis1.Size = UDim2.new(.1, 0, 1, 0)
1294vis1.Position = UDim2.new(.93, 0, 1, 0)
1295vis1.BorderSizePixel=0
1296vis1.ZIndex=2
1297local vis2=vis1:Clone()
1298vis2.Parent = fullscreenz2
1299vis2.Size = UDim2.new(.07, 0, 1, 0)
1300vis2.Position = UDim2.new(.81, 0, 1, 0)
1301
1302local vis3=vis1:Clone()
1303vis3.Parent = fullscreenz2
1304vis3.Size = UDim2.new(.045, 0, 1, 0)
1305vis3.Position = UDim2.new(.74, 0, 1, 0)
1306
1307local vis4=vis1:Clone()
1308vis4.Parent = fullscreenz2
1309vis4.Size = UDim2.new(.03, 0, 1, 0)
1310vis4.Position = UDim2.new(.69, 0, 1, 0)
1311
1312local vis5=vis1:Clone()
1313vis5.Parent = fullscreenz2
1314vis5.Size = UDim2.new(.012, 0, 1, 0)
1315vis5.Position = UDim2.new(.65, 0, 1, 0)
1316
1317--fullscreenz
1318local nedf = it("TextLabel",fullscreenz)
1319nedf.AnchorPoint=Vector2.new(1,1)
1320nedf.Font = "Arcade"
1321nedf.BackgroundTransparency = 1
1322nedf.BorderSizePixel = 0.65
1323nedf.Size = UDim2.new(1,0,.2,0)
1324nedf.Position = UDim2.new(.9,0,0.95,0)
1325nedf.TextColor3 = Color3.new(0,0,0)
1326nedf.TextStrokeColor3 = Color3.new(0,0,0)
1327nedf.TextScaled = true
1328nedf.TextStrokeTransparency = 0
1329nedf.Text = "ETHEREAL GLITCHER"
1330nedf.TextSize = 24
1331nedf.ZIndex=101
1332
1333
1334function ggg()
1335local afa = it("ImageLabel",fullscreenz2)
1336afa.BackgroundTransparency = 1
1337afa.BorderSizePixel = 0
1338afa.AnchorPoint=Vector2.new(.5,.5)
1339afa.Parent = fullscreenz2
1340afa.ImageTransparency = 0
1341afa.Size = UDim2.new(0,40,0,40)
1342local mfmf=math.random(10,90)/100
1343afa.Position = UDim2.new(mfmf,0,1.2,0)
1344afa.ImageColor3 = MAINRUINCOLOR.Color
1345afa.Image = "rbxassetid://2710333451"
1346afa.Rotation=math.random(-360,360)
1347afa.ZIndex=3
1348coroutine.resume(coroutine.create(function(g)
1349local kokha=math.random(30,200)/30
1350local hh1=math.random(-100,100)/50
1351local hh2=math.random(100,400)/22
1352for i=0,1.1,kokha/100 do
1353swait()
1354g.Position = g.Position+UDim2.new(0,hh1,0,-hh2)
1355g.ImageTransparency=i
1356g.Rotation=g.Rotation+3
1357end
1358g:Remove()
1359end),afa)
1360end
1361
1362local hhahaha=false
1363function nice(teext,h1,h2)
1364local ned = it("TextLabel",fullscreenz)
1365ned.AnchorPoint=Vector2.new(1,1)
1366ned.Font = "Arcade"
1367ned.BackgroundTransparency = 1
1368ned.BorderSizePixel = 0.65
1369ned.Size = UDim2.new(2.2,0,.2,0)
1370ned.Position = UDim2.new(1.4,0,0.85,0)
1371ned.TextColor3 = h1
1372ned.TextStrokeColor3 = h2
1373ned.TextScaled = true
1374ned.TextStrokeTransparency = 0
1375ned.Text = teext
1376ned.TextSize = 24
1377ned.Rotation = 90
1378ned.TextXAlignment = "Right"
1379ned.TextYAlignment = "Bottom"
1380ned.ZIndex=100
1381hhahaha=false
1382coroutine.resume(coroutine.create(function()
1383swait(3)
1384hhahaha=true
1385ned:TweenPosition(UDim2.new(1.4-.02* math.sin(SINE/41),0,0.55+.03* math.cos(SINE/42),0), "Out", "Quad", 1,true)
1386for i=1.1,0,-.02 do
1387swait()
1388ned.TextTransparency=i
1389ned.TextStrokeTransparency = i
1390ned:TweenPosition(UDim2.new(1.4-.02* math.sin(SINE/41),0,0.55+.03* math.cos(SINE/42),0), "Out", "Quad", 1,true)
1391if hhahaha==false then
1392break
1393end
1394end
1395
1396local hai=0
1397local hai2=1
1398repeat
1399swait()
1400ned:TweenPosition(UDim2.new(1.4-.02* math.sin(SINE/41),0,0.55+.03* math.cos(SINE/42),0), "Out", "Quad", 1,true)
1401if ModeOfGlitch == 5 then
1402ned.TextColor3=Color3.new(math.random(0,255)/255,0,0)
1403end
1404until hhahaha==false
1405ned:TweenPosition(UDim2.new(1.4,0,0.1,0), "In", "Quart", 1,true)
1406for i=0,1.1,.02 do
1407swait()
1408ned.ZIndex=100-100*i
1409ned.TextTransparency=i
1410ned.TextStrokeTransparency = i
1411end
1412ned:Remove()
1413end))
1414end
1415
1416local hhahaha2=true
1417function nice2(h1,h2)
1418local ned = it("TextLabel",fullscreenz)
1419ned.AnchorPoint=Vector2.new(1,1)
1420ned.Font = "Arcade"
1421ned.BackgroundTransparency = 1
1422ned.BorderSizePixel = 0.65
1423ned.Size = UDim2.new(2.2,0,.1,0)
1424ned.Position = UDim2.new(1.9,0,0.88,0)
1425ned.TextColor3 = h1
1426ned.TextStrokeColor3 = h2
1427ned.TextScaled = true
1428ned.TextStrokeTransparency = 0
1429--ned.Text = teext
1430ned.TextSize = 24
1431ned.Rotation = 90
1432ned.TextXAlignment = "Right"
1433ned.TextYAlignment = "Bottom"
1434ned.ZIndex=100
1435hhahaha2=false
1436coroutine.resume(coroutine.create(function()
1437swait(3)
1438hhahaha2=true
1439ned:TweenPosition(UDim2.new(1.9-.02* math.cos(SINE/41),0,0.48+.03* math.sin(SINE/42),0), "Out", "Quad", 1,true)
1440for i=1.1,0,-.02 do
1441swait()
1442ned.TextTransparency=i
1443ned.TextStrokeTransparency = i
1444ned:TweenPosition(UDim2.new(1.9-.02* math.cos(SINE/41),0,0.48+.03* math.sin(SINE/42),0), "Out", "Quad", 1,true)
1445local mps=game:GetService("MarketplaceService"):GetProductInfo(cp, Enum.InfoType.Asset)
1446ned.Text=(mps.Name)
1447if hhahaha2==false then
1448break
1449end
1450end
1451
1452local lastnam=ned.Text
1453local hai=0
1454local hai2=1
1455local lastMode = ModeOfGlitch
1456repeat
1457ned:TweenPosition(UDim2.new(1.9-.02* math.cos(SINE/41),0,0.48+.03* math.sin(SINE/42),0), "Out", "Quad", 1,true)
1458pcall(function() local mps=game:GetService("MarketplaceService"):GetProductInfo(cp, Enum.InfoType.Asset)
1459ned.Text=(mps.Name) end)
1460if ModeOfGlitch == 5 then
1461ned.TextColor3=Color3.new(math.random(0,255)/255,0,0)
1462end
1463
1464swait()
1465lastnam=ned.Text
1466until hhahaha2==false
1467ned:TweenPosition(UDim2.new(1.9,0,0.08,0), "In", "Quart", 1,true)
1468for i=0,1.1,.02 do
1469swait()
1470ned.Text=lastnam
1471ned.ZIndex=100-100*i
1472ned.TextTransparency=i
1473ned.TextStrokeTransparency = i
1474end
1475ned:Remove()
1476end))
1477end
1478
1479local extrawingmod1 = Instance.new("Model",char)
1480local extrawingmod2 = Instance.new("Model",char)
1481
1482function CreateParta(parent,transparency,reflectance,material,brickcolor)
1483local p = Instance.new("Part")
1484p.TopSurface = 0
1485p.BottomSurface = 0
1486p.Parent = parent
1487p.Size = Vector3.new(0.1,0.1,0.1)
1488p.Transparency = transparency
1489p.Reflectance = reflectance
1490p.CanCollide = false
1491p.Locked = true
1492p.BrickColor = brickcolor
1493p.Material = material
1494return p
1495end
1496
1497function CreateMesh(parent,meshtype,x1,y1,z1)
1498local mesh = Instance.new("SpecialMesh",parent)
1499mesh.MeshType = meshtype
1500mesh.Scale = Vector3.new(x1*10,y1*10,z1*10)
1501return mesh
1502end
1503
1504function CreateSpecialMesh(parent,meshid,x1,y1,z1)
1505local mesh = Instance.new("SpecialMesh",parent)
1506mesh.MeshType = "FileMesh"
1507mesh.MeshId = meshid
1508mesh.Scale = Vector3.new(x1,y1,z1)
1509return mesh
1510end
1511
1512
1513function CreateSpecialGlowMesh(parent,meshid,x1,y1,z1)
1514local mesh = Instance.new("SpecialMesh",parent)
1515mesh.MeshType = "FileMesh"
1516mesh.MeshId = meshid
1517mesh.TextureId = "http://www.roblox.com/asset/?id=269748808"
1518mesh.Scale = Vector3.new(x1,y1,z1)
1519mesh.VertexColor = Vector3.new(parent.BrickColor.r, parent.BrickColor.g, parent.BrickColor.b)
1520return mesh
1521end
1522
1523function CreateWeld(parent,part0,part1,C1X,C1Y,C1Z,C1Xa,C1Ya,C1Za,C0X,C0Y,C0Z,C0Xa,C0Ya,C0Za)
1524local weld = Instance.new("Weld")
1525weld.Parent = parent
1526weld.Part0 = part0
1527weld.Part1 = part1
1528weld.C1 = CFrame.new(C1X,C1Y,C1Z)*CFrame.Angles(C1Xa,C1Ya,C1Za)
1529weld.C0 = CFrame.new(C0X,C0Y,C0Z)*CFrame.Angles(C0Xa,C0Ya,C0Za)
1530return weld
1531end
1532
1533
1534--------------
1535-------------- ground effect
1536local cen = CreateParta(m,1,1,"SmoothPlastic",BrickColor.random())
1537CreateWeld(cen,root,cen,0,3,0,math.rad(0),math.rad(0),math.rad(0),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1538local effar = Instance.new("ParticleEmitter",cen)
1539effar.Texture = "rbxassetid://2344870656"
1540effar.LightEmission = 1
1541effar.Color = ColorSequence.new(Color3.new(1,0,0))
1542effar.Rate = 50
1543effar.Enabled = false
1544effar.EmissionDirection = "Front"
1545effar.Lifetime = NumberRange.new(1)
1546effar.Size = NumberSequence.new({NumberSequenceKeypoint.new(0,15,0),NumberSequenceKeypoint.new(0.1,5,0),NumberSequenceKeypoint.new(0.8,15,0),NumberSequenceKeypoint.new(1,40,0)})
1547effar.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0,1,0),NumberSequenceKeypoint.new(0.8,0.5,0),NumberSequenceKeypoint.new(1,1,0)})
1548effar.Speed = NumberRange.new(80,90)
1549effar.Acceleration = Vector3.new(0,10,0)
1550effar.Drag = 5
1551effar.Rotation = NumberRange.new(-500,500)
1552effar.SpreadAngle = Vector2.new(0,900)
1553effar.RotSpeed = NumberRange.new(-500,500)
1554
1555----
1556local sorb = CreateParta(m,1,1,"SmoothPlastic",BrickColor.random())
1557CreateWeld(sorb,rarm,sorb,0,1,0,math.rad(0),math.rad(0),math.rad(0),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1558local sorb2 = CreateParta(m,1,1,"SmoothPlastic",BrickColor.random())
1559CreateWeld(sorb2,larm,sorb2,0,1,0,math.rad(0),math.rad(0),math.rad(0),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1560
1561local handlex = CreateParta(mwN,1,1,"Neon",maincolor)
1562CreateMesh(handle,"Brick",0,0,0)
1563local handlexweld = CreateWeld(handlex,tors,handlex,0,-1.5,-1.05,math.rad(0),math.rad(0),math.rad(0),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1564local valuaring = 10
1565for i = 0, 49 do
1566 valuaring = valuaring + 10
1567rn = CreateParta(mwY,0,0,"Neon",MAINRUINCOLOR)
1568CreateMesh(rn,"Brick",0.25,0.1,0.1)
1569CreateWeld(rn,handlex,rn,0,1,0,math.rad(0),math.rad(0),math.rad(valuaring),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1570end
1571
1572local refec = Instance.new("ParticleEmitter",handlex)
1573refec.Texture = "rbxassetid://249270319"
1574refec.LightEmission = 0.95
1575refec.Color = ColorSequence.new(MAINRUINCOLOR.Color)
1576refec.Rate = 50
1577refec.Lifetime = NumberRange.new(0.5)
1578refec.Size = NumberSequence.new({NumberSequenceKeypoint.new(0,0.5,0),NumberSequenceKeypoint.new(0.5,0.75,0),NumberSequenceKeypoint.new(1,0.1,0)})
1579refec.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0,1,0),NumberSequenceKeypoint.new(0.5,0.25,0),NumberSequenceKeypoint.new(1,1,0)})
1580refec.Speed = NumberRange.new(0,2)
1581refec.Drag = 5
1582refec.LockedToPart = true
1583refec.Rotation = NumberRange.new(-500,500)
1584refec.VelocitySpread = 9000
1585refec.RotSpeed = NumberRange.new(-500,500)
1586
1587local handle = CreateParta(m,1,1,"Neon",MAINRUINCOLOR)
1588CreateMesh(handle,"Brick",0.5,0.5,0.5)
1589local handleweld = CreateWeld(handle,tors,handle,0,-1.5,-1.05,math.rad(0),math.rad(0),math.rad(0),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1590
1591--"rbxassetid://31727915"
1592--Sword
1593
1594local sword = script.BloodCurse.BloodCurse:WaitForChild'hitbox'
1595for i,v in pairs(script.BloodCurse.BloodCurse:GetChildren()) do
1596v.Anchored = false
1597end
1598w1 = Instance.new("Weld")
1599w1.Parent = ra
1600w1.Part0 = ra
1601w1.Part1 = sword
1602w1.C0 = ra.CFrame:Inverse()
1603w1.C1 = sword.CFrame:Inverse()
1604w1.C0 = CFrame.new(0,-0.4,-3)*CFrame.Angles(RAD(0),RAD(90),RAD(0))*CFrame.Angles(RAD(00-0.05*math.cos(0+1 / 32)),RAD(0-0.05*math.cos(0+1 / 32)),RAD(00-0.05*math.cos(0+1 / 32)))
1605
1606--Sword2
1607
1608local cursedsword = script.CursedSword.CursedSword:WaitForChild'hitbox'
1609for i,v in pairs(script.CursedSword.CursedSword:GetChildren()) do
1610v.Anchored = false
1611end
1612w2 = Instance.new("Weld")
1613w2.Parent = ra
1614w2.Part0 = ra
1615w2.Part1 = sword
1616w2.C0 = ra.CFrame:Inverse()
1617w2.C1 = sword.CFrame:Inverse()
1618w2.C0 = CFrame.new(0,-0.4,-3)*CFrame.Angles(RAD(0),RAD(90),RAD(0))*CFrame.Angles(RAD(0),RAD(0),RAD(0))
1619
1620--- Left wing.
1621
1622
1623
1624local lwing1 = CreateParta(m,1,1,"Neon",maincolor)
1625CreateMesh(handle,"Brick",0.5,0.5,0.5)
1626local lwing1weld = CreateWeld(lwing1,handle,lwing1,1.5,0,0,math.rad(5),math.rad(0),math.rad(12.5),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1627
1628local ae4 = script.E:Clone()
1629ae4.Parent = mw1
1630ae4.Color = MAINRUINCOLOR.Color
1631ae4.Anchored = false
1632CreateWeld(ae4,lwing1,ae4,0,0,-1.75,math.rad(0),math.rad(0),math.rad(0),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1633
1634local lwing2 = CreateParta(m,1,1,"Neon",maincolor)
1635CreateMesh(handle,"Brick",0.5,0.5,0.5)
1636local lwing2weld = CreateWeld(lwing2,handle,lwing2,3,1,0,math.rad(10),math.rad(0),math.rad(25),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1637
1638local ae5 = script.E:Clone()
1639ae5.Parent = mw1
1640ae5.Color = MAINRUINCOLOR.Color
1641ae5.Anchored = false
1642CreateWeld(ae5,lwing2,ae5,0,0,-1.75,math.rad(0),math.rad(0),math.rad(0),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1643
1644local lwing3 = CreateParta(m,1,1,"Neon",maincolor)
1645CreateMesh(handle,"Brick",0.5,0.5,0.5)
1646local lwing3weld = CreateWeld(lwing3,handle,lwing3,4.5,2,0,math.rad(15),math.rad(0),math.rad(37.5),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1647
1648local ae6 = script.E:Clone()
1649ae6.Parent = mw1
1650ae6.Color = MAINRUINCOLOR.Color
1651ae6.Anchored = false
1652CreateWeld(ae6,lwing3,ae6,0,0,-1.75,math.rad(0),math.rad(0),math.rad(0),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1653
1654local lwing4 = CreateParta(m,1,1,"Neon",maincolor)
1655CreateMesh(handle,"Brick",0.5,0.5,0.5)
1656local lwing4weld = CreateWeld(lwing4,handle,lwing4,5.75,3,0,math.rad(20),math.rad(0),math.rad(50),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1657
1658wed = CreateParta(extrawingmod1,0,0,"Neon",halocolor)
1659CreateMesh(wed,"Wedge",0.05*2,0.5*2,0.5*2)
1660CreateWeld(wed,lwing4,wed,0,0,0.25*2,math.rad(0),math.rad(90),math.rad(0),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1661wed = CreateParta(extrawingmod1,0,0,"Neon",halocolor)
1662CreateMesh(wed,"Wedge",0.05*2,0.5*2,0.5*2)
1663CreateWeld(wed,lwing4,wed,0,0,0.25*2,math.rad(0),math.rad(-90),math.rad(0),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1664A0 = Instance.new('Attachment',wed)
1665A0.Position = vt(0,0.25*2,0.25*2)
1666wed = CreateParta(extrawingmod1,0,0,"Neon",halocolor)
1667CreateMesh(wed,"Wedge",0.05*2,0.5*2,3*2)
1668CreateWeld(wed,lwing4,wed,0,-0.25*2,1.75*2,math.rad(0),math.rad(90),math.rad(90),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1669A1 = Instance.new('Attachment',wed)
1670A1.Position = vt(0,-0.25*2,-2*2)
1671wed = CreateParta(extrawingmod1,0,0,"Neon",halocolor)
1672CreateMesh(wed,"Wedge",0.0*25,3*2,0.5*2)
1673CreateWeld(wed,lwing4,wed,0,-1.75*2,0.25*2,math.rad(90),math.rad(90),math.rad(90),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1674
1675tl4 = Instance.new('Trail',wed)
1676tl4.Attachment0 = A1
1677tl4.Attachment1 = A0
1678tl4.Texture = "rbxassetid://2108945559"
1679tl4.LightEmission = 1
1680tl4.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0, 0),NumberSequenceKeypoint.new(1, 1)})
1681tl4.Color = ColorSequence.new(BrickColor.new('Really red').Color)
1682tl4.Lifetime = 0.6
1683local lwing5 = CreateParta(m,1,1,"Neon",maincolor)
1684CreateMesh(handle,"Brick",0.5,0.5,0.5)
1685local lwing5weld = CreateWeld(lwing5,handle,lwing5,6.75,4,0,math.rad(25),math.rad(0),math.rad(62.5),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1686
1687wed = CreateParta(extrawingmod1,0,0,"Neon",halocolor)
1688CreateMesh(wed,"Wedge",0.05*2,0.5*2,0.5*2)
1689CreateWeld(wed,lwing5,wed,0,0,0.25*2,math.rad(0),math.rad(90),math.rad(0),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1690wed = CreateParta(extrawingmod1,0,0,"Neon",halocolor)
1691CreateMesh(wed,"Wedge",0.05*2,0.5*2,0.5*2)
1692CreateWeld(wed,lwing5,wed,0,0,0.25*2,math.rad(0),math.rad(-90),math.rad(0),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1693A0 = Instance.new('Attachment',wed)
1694A0.Position = vt(0,0.25*2,0.25*2)
1695wed = CreateParta(extrawingmod1,0,0,"Neon",halocolor)
1696CreateMesh(wed,"Wedge",0.05*2,0.5*2,3*2)
1697CreateWeld(wed,lwing5,wed,0,-0.25*2,1.75*2,math.rad(0),math.rad(90),math.rad(90),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1698A1 = Instance.new('Attachment',wed)
1699A1.Position = vt(0,-0.25*2,-2*2)
1700wed = CreateParta(extrawingmod1,0,0,"Neon",halocolor)
1701CreateMesh(wed,"Wedge",0.05*2,3*2,0.5*2)
1702CreateWeld(wed,lwing5,wed,0,-1.75*2,0.25*2,math.rad(90),math.rad(90),math.rad(90),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1703
1704tl5 = Instance.new('Trail',wed)
1705tl5.Attachment0 = A1
1706tl5.Attachment1 = A0
1707tl5.Texture = "rbxassetid://2108945559"
1708tl5.LightEmission = 1
1709tl5.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0, 0),NumberSequenceKeypoint.new(1, 1)})
1710tl5.Color = ColorSequence.new(BrickColor.new('Really red').Color)
1711tl5.Lifetime = 0.6
1712local lwing6 = CreateParta(m,1,1,"Neon",maincolor)
1713CreateMesh(handle,"Brick",0.5,0.5,0.5)
1714local lwing6weld = CreateWeld(lwing6,handle,lwing6,7.75,5,0,math.rad(30),math.rad(0),math.rad(75),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1715
1716wed = CreateParta(extrawingmod1,0,0,"Neon",halocolor)
1717CreateMesh(wed,"Wedge",0.05*2,0.5*2,0.5*2)
1718CreateWeld(wed,lwing6,wed,0,0,0.25*2,math.rad(0),math.rad(90),math.rad(0),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1719wed = CreateParta(extrawingmod1,0,0,"Neon",halocolor)
1720CreateMesh(wed,"Wedge",0.05*2,0.5*2,0.5*2)
1721CreateWeld(wed,lwing6,wed,0,0,0.25*2,math.rad(0),math.rad(-90),math.rad(0),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1722A0 = Instance.new('Attachment',wed)
1723A0.Position = vt(0,0.25*2,0.25*2)
1724wed = CreateParta(extrawingmod1,0,0,"Neon",halocolor)
1725CreateMesh(wed,"Wedge",0.05*2,0.5*2,3*2)
1726CreateWeld(wed,lwing6,wed,0,-0.25*2,1.75*2,math.rad(0),math.rad(90),math.rad(90),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1727A1 = Instance.new('Attachment',wed)
1728A1.Position = vt(0,-0.25*2,-2*2)
1729wed = CreateParta(extrawingmod1,0,0,"Neon",halocolor)
1730CreateMesh(wed,"Wedge",0.05*2,3*2,0.5*2)
1731CreateWeld(wed,lwing6,wed,0,-1.75*2,0.25*2,math.rad(90),math.rad(90),math.rad(90),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1732tl6 = Instance.new('Trail',wed)
1733tl6.Attachment0 = A1
1734tl6.Attachment1 = A0
1735tl6.Texture = "rbxassetid://2108945559"
1736tl6.LightEmission = 1
1737tl6.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0, 0),NumberSequenceKeypoint.new(1, 1)})
1738tl6.Color = ColorSequence.new(BrickColor.new('Really red').Color)
1739tl6.Lifetime = 0.6
1740
1741
1742tl4.Enabled = false
1743tl5.Enabled = false
1744tl6.Enabled = false
1745-- Right wing.
1746
1747local rwing1 = CreateParta(m,1,1,"Neon",maincolor)
1748CreateMesh(handle,"Brick",0.5,0.5,0.5)
1749local rwing1weld = CreateWeld(rwing1,handle,rwing1,-1.5,0,0,math.rad(5),math.rad(0),math.rad(-12.5),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1750
1751local ae1 = script.E:Clone()
1752ae1.Parent = mw2
1753ae1.Transparency = 1
1754ae1.Anchored = false
1755CreateWeld(ae1,rwing1,ae1,0,0,-1.75,math.rad(0),math.rad(0),math.rad(0),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1756
1757local rwing2 = CreateParta(m,1,1,"Neon",maincolor)
1758CreateMesh(handle,"Brick",0.5,0.5,0.5)
1759local rwing2weld = CreateWeld(rwing2,handle,rwing2,-3,1,0,math.rad(10),math.rad(0),math.rad(-25),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1760
1761local ae2 = script.E:Clone()
1762ae2.Parent = mw2
1763ae2.Transparency = 1
1764ae2.Anchored = false
1765CreateWeld(ae2,rwing2,ae2,0,0,-1.75,math.rad(0),math.rad(0),math.rad(0),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1766
1767local rwing3 = CreateParta(m,1,1,"Neon",maincolor)
1768CreateMesh(handle,"Brick",0.5,0.5,0.5)
1769local rwing3weld = CreateWeld(rwing3,handle,rwing3,-4.5,2,0,math.rad(15),math.rad(0),math.rad(-37.5),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1770
1771local ae3 = script.E:Clone()
1772ae3.Parent = mw2
1773ae3.Transparency = 1
1774ae3.Anchored = false
1775CreateWeld(ae3,rwing3,ae3,0,0,-1.75,math.rad(0),math.rad(0),math.rad(0),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1776
1777
1778local rwing4 = CreateParta(m,1,1,"Neon",maincolor)
1779CreateMesh(handle,"Brick",0.5,0.5,0.5)
1780local rwing4weld = CreateWeld(rwing4,handle,rwing4,-5.75,3,0,math.rad(20),math.rad(0),math.rad(-50),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1781
1782wed = CreateParta(extrawingmod2,0,0,"Neon",halocolor)
1783CreateMesh(wed,"Wedge",0.05*2,0.5*2,0.5*2)
1784CreateWeld(wed,rwing4,wed,0,0,0.25*2,math.rad(0),math.rad(90),math.rad(0),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1785A0 = Instance.new('Attachment',wed)
1786A0.Position = vt(0,0.25*2,0.25*2)
1787wed = CreateParta(extrawingmod2,0,0,"Neon",halocolor)
1788CreateMesh(wed,"Wedge",0.05*2,0.5*2,0.5*2)
1789CreateWeld(wed,rwing4,wed,0,0,0.25*2,math.rad(0),math.rad(-90),math.rad(0),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1790wed = CreateParta(extrawingmod2,0,0,"Neon",halocolor)
1791CreateMesh(wed,"Wedge",0.05*2,0.5*2,3*2)
1792CreateWeld(wed,rwing4,wed,0,-0.25*2,1.75*2,math.rad(0),math.rad(90),math.rad(90),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1793wed = CreateParta(extrawingmod2,0,0,"Neon",halocolor)
1794CreateMesh(wed,"Wedge",0.05*2,3*2,0.5*2)
1795CreateWeld(wed,rwing4,wed,0,-1.75*2,0.25*2,math.rad(90),math.rad(90),math.rad(90),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1796A1 = Instance.new('Attachment',wed)
1797A1.Position = vt(0,2,0.25)
1798
1799tr4 = Instance.new('Trail',wed)
1800tr4.Attachment0 = A1
1801tr4.Attachment1 = A0
1802tr4.Texture = "rbxassetid://2108945559"
1803tr4.LightEmission = 1
1804tr4.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0, 0),NumberSequenceKeypoint.new(1, 1)})
1805tr4.Color = ColorSequence.new(BrickColor.new('Really red').Color)
1806tr4.Lifetime = 0.6
1807
1808local rwing5 = CreateParta(m,1,1,"Neon",maincolor)
1809CreateMesh(handle,"Brick",0.5,0.5,0.5)
1810local rwing5weld = CreateWeld(rwing5,handle,rwing5,-6.75,4,0,math.rad(25),math.rad(0),math.rad(-62.5),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1811
1812wed = CreateParta(extrawingmod2,0,0,"Neon",halocolor)
1813CreateMesh(wed,"Wedge",0.05*2,0.5*2,0.5*2)
1814CreateWeld(wed,rwing5,wed,0,0,0.25*2,math.rad(0),math.rad(90),math.rad(0),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1815A0 = Instance.new('Attachment',wed)
1816A0.Position = vt(0,0.25*2,0.25*2)
1817wed = CreateParta(extrawingmod2,0,0,"Neon",halocolor)
1818CreateMesh(wed,"Wedge",0.05*2,0.5*2,0.5*2)
1819CreateWeld(wed,rwing5,wed,0,0,0.25*2,math.rad(0),math.rad(-90),math.rad(0),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1820wed = CreateParta(extrawingmod2,0,0,"Neon",halocolor)
1821CreateMesh(wed,"Wedge",0.05*2,0.5*2,3*2)
1822CreateWeld(wed,rwing5,wed,0,-0.25*2,1.75*2,math.rad(0),math.rad(90),math.rad(90),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1823wed = CreateParta(extrawingmod2,0,0,"Neon",halocolor)
1824CreateMesh(wed,"Wedge",0.05*2,3*2,0.5*2)
1825CreateWeld(wed,rwing5,wed,0,-1.75*2,0.25*2,math.rad(90),math.rad(90),math.rad(90),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1826A1 = Instance.new('Attachment',wed)
1827A1.Position = vt(0,2,0.25)
1828
1829tr5 = Instance.new('Trail',wed)
1830tr5.Attachment0 = A1
1831tr5.Attachment1 = A0
1832tr5.Texture = "rbxassetid://2108945559"
1833tr5.LightEmission = 1
1834tr5.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0, 0),NumberSequenceKeypoint.new(1, 1)})
1835tr5.Color = ColorSequence.new(BrickColor.new('Really red').Color)
1836tr5.Lifetime = 0.6
1837
1838local rwing6 = CreateParta(m,1,1,"Neon",maincolor)
1839CreateMesh(handle,"Brick",0.5,0.5,0.5)
1840local rwing6weld = CreateWeld(rwing6,handle,rwing6,-7.75,3,0,math.rad(30),math.rad(0),math.rad(-75),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1841
1842wed = CreateParta(extrawingmod2,0,0,"Neon",halocolor)
1843CreateMesh(wed,"Wedge",0.05*2,0.5*2,0.5*2)
1844CreateWeld(wed,rwing6,wed,0,0,0.25*2,math.rad(0),math.rad(90),math.rad(0),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1845A0 = Instance.new('Attachment',wed)
1846A0.Position = vt(0,0.25*2,0.25*2)
1847wed = CreateParta(extrawingmod2,0,0,"Neon",halocolor)
1848CreateMesh(wed,"Wedge",0.05*2,0.5*2,0.5*2)
1849CreateWeld(wed,rwing6,wed,0,0,0.25*2,math.rad(0),math.rad(-90),math.rad(0),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1850wed = CreateParta(extrawingmod2,0,0,"Neon",halocolor)
1851CreateMesh(wed,"Wedge",0.05*2,0.5*2,3*2)
1852CreateWeld(wed,rwing6,wed,0,-0.25*2,1.75*2,math.rad(0),math.rad(90),math.rad(90),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1853wed = CreateParta(extrawingmod2,0,0,"Neon",halocolor)
1854CreateMesh(wed,"Wedge",0.05*2,3*2,0.5*2)
1855CreateWeld(wed,rwing6,wed,0,-1.75*2,0.25*2,math.rad(90),math.rad(90),math.rad(90),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1856A1 = Instance.new('Attachment',wed)
1857A1.Position = vt(0,2,0.25)
1858
1859tr6 = Instance.new('Trail',wed)
1860tr6.Attachment0 = A1
1861tr6.Attachment1 = A0
1862tr6.Texture = "rbxassetid://2108945559"
1863tr6.LightEmission = 1
1864tr6.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0, 0),NumberSequenceKeypoint.new(1, 1)})
1865tr6.Color = ColorSequence.new(BrickColor.new('Really red').Color)
1866tr6.Lifetime = 0.6
1867
1868ae4.Trail.Enabled=false
1869ae5.Trail.Enabled=false
1870ae6.Trail.Enabled=false
1871tr4.Enabled = false
1872tr5.Enabled = false
1873tr6.Enabled = false
1874---- HERES THE RING
1875
1876
1877--[[ran = CreateParta(m2,0,0,"SmoothPlastic",wepcolor)
1878CreateMesh(ran,"Wedge",1.02,1.02,1.02)
1879CreateWeld(ran,larm,ran,0,0.15,0,math.rad(0),math.rad(90),math.rad(0),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1880ran = CreateParta(m,0,0,"SmoothPlastic",wepcolor)
1881CreateMesh(ran,"Wedge",0.9,0.9,1.025)
1882CreateWeld(ran,larm,ran,0,0.155,0,math.rad(0),math.rad(90),math.rad(0),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1883ran = CreateParta(m,0,0,"SmoothPlastic",wepcolor)
1884CreateMesh(ran,"Wedge",1.025,0.9,0.9)
1885CreateWeld(ran,larm,ran,0,0.155,-0.025,math.rad(0),math.rad(90),math.rad(0),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1886
1887
1888gan = CreateParta(m,0,0,"SmoothPlastic",wepcolor)
1889CreateMesh(gan,"Brick",1.075,0.1,1.075)
1890CreateWeld(gan,larm,gan,0,0.5,0,math.rad(0),math.rad(0),math.rad(0),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1891
1892gan = CreateParta(m,0,0,"SmoothPlastic",wepcolor)
1893CreateMesh(gan,"Brick",1.075,0.1,1.075)
1894CreateWeld(gan,larm,gan,0,0.75,0,math.rad(0),math.rad(0),math.rad(0),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1895
1896
1897
1898gan = CreateParta(m2,0,0,"Neon",halocolor2)
1899CreateMesh(gan,"Brick",1.095,0.035,1.095)
1900CreateWeld(gan,larm,gan,0,0.5,0,math.rad(0),math.rad(0),math.rad(0),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1901
1902gan = CreateParta(m2,0,0,"Neon",halocolor2)
1903CreateMesh(gan,"Brick",1.095,0.035,1.095)
1904CreateWeld(gan,larm,gan,0,0.75,0,math.rad(0),math.rad(0),math.rad(0),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1905
1906gane = CreateParta(m3,0,0,"SmoothPlastic",lunacolor2)
1907CreateMesh(gane,"Brick",1.0625,0.2,1.0625)
1908CreateWeld(gane,larm,gane,0,0.6,0,math.rad(0),math.rad(0),math.rad(0),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1909
1910star = CreateParta(m,0,0,"SmoothPlastic",wepcolor)
1911CreateSpecialMesh(star,"http://www.roblox.com/asset/?id=45428961",2.5,2.5,2.5)
1912CreateWeld(star,larm,star,0,0.475,0.6,math.rad(90),math.rad(90),math.rad(0),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1913starl = CreateParta(m3,0,0,"SmoothPlastic",starcolor)
1914CreateSpecialMesh(starl,"http://www.roblox.com/asset/?id=45428961",1.95,2.55,1.95)
1915CreateWeld(starl,larm,starl,0,0.475,0.6,math.rad(90),math.rad(90),math.rad(0),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1916
1917--- second ring
1918
1919ran = CreateParta(m2,0,0,"SmoothPlastic",wepcolor)
1920CreateMesh(ran,"Wedge",1.02,1.02,1.02)
1921CreateWeld(ran,rarm,ran,0,0.15,0,math.rad(0),math.rad(-90),math.rad(0),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1922ran = CreateParta(m,0,0,"SmoothPlastic",wepcolor)
1923CreateMesh(ran,"Wedge",0.9,0.9,1.025)
1924CreateWeld(ran,rarm,ran,0,0.155,0,math.rad(0),math.rad(-90),math.rad(0),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1925ran = CreateParta(m,0,0,"SmoothPlastic",wepcolor)
1926CreateMesh(ran,"Wedge",1.025,0.9,0.9)
1927CreateWeld(ran,rarm,ran,0,0.155,-0.025,math.rad(0),math.rad(-90),math.rad(0),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1928
1929gan = CreateParta(m,0,0,"SmoothPlastic",wepcolor)
1930CreateMesh(gan,"Brick",1.075,0.1,1.075)
1931CreateWeld(gan,rarm,gan,0,0.5,0,math.rad(0),math.rad(0),math.rad(0),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1932
1933gan = CreateParta(m,0,0,"SmoothPlastic",wepcolor)
1934CreateMesh(gan,"Brick",1.075,0.1,1.075)
1935CreateWeld(gan,rarm,gan,0,0.75,0,math.rad(0),math.rad(0),math.rad(0),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1936
1937
1938
1939gan = CreateParta(m2,0,0,"Neon",halocolor2)
1940CreateMesh(gan,"Brick",1.095,0.035,1.095)
1941CreateWeld(gan,rarm,gan,0,0.5,0,math.rad(0),math.rad(0),math.rad(0),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1942
1943gan = CreateParta(m2,0,0,"Neon",halocolor2)
1944CreateMesh(gan,"Brick",1.095,0.035,1.095)
1945CreateWeld(gan,rarm,gan,0,0.75,0,math.rad(0),math.rad(0),math.rad(0),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1946
1947gane = CreateParta(m3,0,0,"SmoothPlastic",lunacolor2)
1948CreateMesh(gane,"Brick",1.0625,0.2,1.0625)
1949CreateWeld(gane,rarm,gane,0,0.6,0,math.rad(0),math.rad(0),math.rad(0),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1950
1951star = CreateParta(m,0,0,"SmoothPlastic",wepcolor)
1952CreateSpecialMesh(star,"http://www.roblox.com/asset/?id=45428961",2.5,2.5,2.5)
1953CreateWeld(star,rarm,star,0,-0.475,0.6,math.rad(90),math.rad(90),math.rad(0),0,0,0,math.rad(0),math.rad(0),math.rad(0))
1954starl = CreateParta(m3,0,0,"SmoothPlastic",starcolor)
1955CreateSpecialMesh(starl,"http://www.roblox.com/asset/?id=45428961",1.95,2.55,1.95)
1956CreateWeld(starl,rarm,starl,0,-0.475,0.6,math.rad(90),math.rad(90),math.rad(0),0,0,0,math.rad(0),math.rad(0),math.rad(0))]]--
1957
1958
1959
1960for i, v in pairs(m:GetChildren()) do
1961if v:IsA("Part") then
1962v.BrickColor = BrickColor.new("Really black")
1963v.Material = "Glass"
1964end
1965end
1966for i, v in pairs(m2:GetChildren()) do
1967if v:IsA("Part") then
1968v.BrickColor = BrickColor.new("Crimson")
1969v.Material = "Granite"
1970end
1971end
1972for i, v in pairs(m3:GetChildren()) do
1973if v:IsA("Part") then
1974v.BrickColor = MAINRUINCOLOR
1975v.Material = "Neon"
1976end
1977end
1978for i, v in pairs(mw2:GetChildren()) do
1979if v:IsA("Part") then
1980v.BrickColor = MAINRUINCOLOR
1981v.Material = "Neon"
1982end
1983end
1984for i, v in pairs(mw1:GetChildren()) do
1985if v:IsA("Part") then
1986v.Transparency = 1
1987v.BrickColor = MAINRUINCOLOR
1988v.Material = "Neon"
1989end
1990end
1991for i, v in pairs(extrawingmod1:GetChildren()) do
1992if v:IsA("Part") then
1993v.Transparency = 1
1994v.BrickColor = BrickColor.new("White")
1995v.Material = "Neon"
1996end
1997end
1998for i, v in pairs(extrawingmod2:GetChildren()) do
1999if v:IsA("Part") then
2000v.Transparency = 1
2001v.BrickColor = BrickColor.new("White")
2002v.Material = "Neon"
2003end
2004end
2005------
2006
2007
2008function RemoveOutlines(part)
2009 part.TopSurface, part.BottomSurface, part.LeftSurface, part.RightSurface, part.FrontSurface, part.BackSurface = 10, 10, 10, 10, 10, 10
2010end
2011function CreatePart(Parent, Material, Reflectance, Transparency, BColor, Name, Size)
2012 local Part = Create("Part")({
2013 Parent = Parent,
2014 Reflectance = Reflectance,
2015 Transparency = Transparency,
2016 CanCollide = false,
2017 Locked = true,
2018 BrickColor = BrickColor.new(tostring(BColor)),
2019 Name = Name,
2020 Size = Size,
2021 Material = Material
2022 })
2023 Part.CustomPhysicalProperties = PhysicalProperties.new(0.001, 0.001, 0.001, 0.001, 0.001)
2024 RemoveOutlines(Part)
2025 return Part
2026end
2027function CreateMesha(Mesh, Part, MeshType, MeshId, OffSet, Scale)
2028 local Msh = Create(Mesh)({
2029 Parent = Part,
2030 Offset = OffSet,
2031 Scale = Scale
2032 })
2033 if Mesh == "SpecialMesh" then
2034 Msh.MeshType = MeshType
2035 Msh.MeshId = MeshId
2036 end
2037 return Msh
2038end
2039function CreateWeld(Parent, Part0, Part1, C0, C1)
2040 local Weld = Create("Weld")({
2041 Parent = Parent,
2042 Part0 = Part0,
2043 Part1 = Part1,
2044 C0 = C0,
2045 C1 = C1
2046 })
2047 return Weld
2048end
2049
2050Character=Player.Character
2051PlayerGui=Player.PlayerGui
2052Backpack=Player.Backpack
2053Torso=Character.Torso
2054Head=Character.Head
2055Humanoid=Character.Humanoid
2056m=Instance.new('Model',Character)
2057LeftArm=Character["Left Arm"]
2058LeftLeg=Character["Left Leg"]
2059RightArm=Character["Right Arm"]
2060RightLeg=Character["Right Leg"]
2061LS=Torso["Left Shoulder"]
2062LH=Torso["Left Hip"]
2063RS=Torso["Right Shoulder"]
2064RH=Torso["Right Hip"]
2065Face = Head.face
2066Neck=Torso.Neck
2067it=Instance.new
2068attacktype=1
2069vt=Vector3.new
2070cf=CFrame.new
2071euler=CFrame.fromEulerAnglesXYZ
2072angles=CFrame.Angles
2073cloaked=false
2074necko=cf(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
2075necko2=cf(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
2076LHC0=cf(-1,-1,0,-0,-0,-1,0,1,0,1,0,0)
2077LHC1=cf(-0.5,1,0,-0,-0,-1,0,1,0,1,0,0)
2078RHC0=cf(1,-1,0,0,0,1,0,1,0,-1,-0,-0)
2079RHC1=cf(0.5,1,0,0,0,1,0,1,0,-1,-0,-0)
2080RootPart=Character.HumanoidRootPart
2081RootJoint=RootPart.RootJoint
2082RootCF=euler(-1.57,0,3.14)
2083attack = false
2084attackdebounce = false
2085deb=false
2086equipped=true
2087hand=false
2088MMouse=nil
2089combo=0
2090mana=0
2091trispeed=.2
2092attackmode='none'
2093local idle=0
2094local Anim="Idle"
2095local Effects={}
2096local gun=false
2097local shoot=false
2098local sine = 0
2099local change = 1
2100
2101
2102function RecolorTextAndRename(name,col1,col2,font)
2103modet.TextStrokeColor3 = col2
2104modet.TextColor3 = col1
2105modet.Font = font
2106modet.Text = name
2107--[[ned.Text = name
2108ned.TextColor3 = col1
2109ned.TextStrokeColor3 = col2]]
2110nice(name,col1,col2)
2111nice2(col1,col2)
2112end
2113
2114local disably = false
2115
2116local r = 255
2117local g = 0
2118local b = 0
2119
2120
2121LW=Torso["Left Shoulder"]
2122LH=Torso["Left Hip"]
2123RW=Torso["Right Shoulder"]
2124RH=Torso["Right Hip"]
2125
2126--save shoulders
2127--[[RSH, LSH=nil, nil
2128--welds
2129RW, LW=Instance.new("Weld"), Instance.new("Weld")
2130RW.Name="Right Shoulder" LW.Name="Left Shoulder"
2131LH=Torso["Left Hip"]
2132RH=Torso["Right Hip"]
2133TorsoColor=Torso.BrickColor
2134function NoOutline(Part)
2135Part.TopSurface,Part.BottomSurface,Part.LeftSurface,Part.RightSurface,Part.FrontSurface,Part.BackSurface = 10,10,10,10,10,10
2136end
2137ch=Character
2138RSH=ch.Torso["Right Shoulder"]
2139LSH=ch.Torso["Left Shoulder"]
2140--
2141RSH.Parent=nil
2142LSH.Parent=nil ]]--
2143--
2144RW.Name="Right Shoulder"
2145RW.Part0=char.Torso
2146RW.C0=cf(1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.3, 0, -0.5)
2147RW.C1=cf(0, 0.5, 0)
2148RW.Part1=char["Right Arm"]
2149RW.Parent=char.Torso
2150--
2151LW.Name="Left Shoulder"
2152LW.Part0=char.Torso
2153LW.C0=cf(-1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.7, 0, 0.8)
2154LW.C1=cf(0, 0.5, 0)
2155LW.Part1=char["Left Arm"]
2156LW.Parent=char.Torso
2157
2158local Stats=Instance.new("BoolValue")
2159Stats.Name="Stats"
2160Stats.Parent=Character
2161local Atk=Instance.new("NumberValue")
2162Atk.Name="Damage"
2163Atk.Parent=Stats
2164Atk.Value=1
2165local Def=Instance.new("NumberValue")
2166Def.Name="Defense"
2167Def.Parent=Stats
2168Def.Value=1
2169local Speed=Instance.new("NumberValue")
2170Speed.Name="Speed"
2171Speed.Parent=Stats
2172Speed.Value=1
2173local Mvmt=Instance.new("NumberValue")
2174Mvmt.Name="Movement"
2175Mvmt.Parent=Stats
2176Mvmt.Value=1
2177
2178local donum=0
2179
2180
2181function part(formfactor,parent,reflectance,transparency,brickcolor,name,size)
2182local fp=it("Part")
2183fp.formFactor=formfactor
2184fp.Parent=parent
2185fp.Reflectance=reflectance
2186fp.Transparency=transparency
2187fp.CanCollide=false
2188fp.Locked=true
2189fp.BrickColor=brickcolor
2190fp.Name=name
2191fp.Size=size
2192fp.Position=Torso.Position
2193NoOutline(fp)
2194fp.Material="SmoothPlastic"
2195fp:BreakJoints()
2196return fp
2197end
2198
2199function mesh(Mesh,part,meshtype,meshid,offset,scale)
2200local mesh=it(Mesh)
2201mesh.Parent=part
2202if Mesh=="SpecialMesh" then
2203mesh.MeshType=meshtype
2204if meshid~="nil" then
2205mesh.MeshId="http://www.roblox.com/asset/?id="..meshid
2206end
2207end
2208mesh.Offset=offset
2209mesh.Scale=scale
2210return mesh
2211end
2212
2213function weld(parent,part0,part1,c0)
2214local weld=it("Weld")
2215weld.Parent=parent
2216weld.Part0=part0
2217weld.Part1=part1
2218weld.C0=c0
2219return weld
2220end
2221
2222local Color1=Torso.BrickColor
2223
2224local bodvel=Instance.new("BodyVelocity")
2225local bg=Instance.new("BodyGyro")
2226
2227--------- SazEreno's Artificial HB --------------
2228
2229-------- RAINBOW LEAVE IT TO ME
2230
2231
2232so = function(id,par,vol,pit)
2233local sou = Instance.new("Sound",par or workspace)
2234sou.Volume=vol
2235sou.Pitch=pit or 1
2236sou.SoundId=id
2237swait()
2238sou:play()
2239game:GetService("Debris"):AddItem(sou,6)
2240end
2241
2242function clerp(a,b,t)
2243local qa = {QuaternionFromCFrame(a)}
2244local qb = {QuaternionFromCFrame(b)}
2245local ax, ay, az = a.x, a.y, a.z
2246local bx, by, bz = b.x, b.y, b.z
2247local _t = 1-t
2248return QuaternionToCFrame(_t*ax + t*bx, _t*ay + t*by, _t*az + t*bz,QuaternionSlerp(qa, qb, t))
2249end
2250
2251function aclerp(startCF,endCF,alpha)
2252 return startCF:lerp(endCF, alpha)
2253end
2254
2255function QuaternionFromCFrame(cf)
2256local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
2257local trace = m00 + m11 + m22
2258if trace > 0 then
2259local s = math.sqrt(1 + trace)
2260local recip = 0.5/s
2261return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5
2262else
2263local i = 0
2264if m11 > m00 then
2265i = 1
2266end
2267if m22 > (i == 0 and m00 or m11) then
2268i = 2
2269end
2270if i == 0 then
2271local s = math.sqrt(m00-m11-m22+1)
2272local recip = 0.5/s
2273return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip
2274elseif i == 1 then
2275local s = math.sqrt(m11-m22-m00+1)
2276local recip = 0.5/s
2277return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip
2278elseif i == 2 then
2279local s = math.sqrt(m22-m00-m11+1)
2280local recip = 0.5/s return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip
2281end
2282end
2283end
2284
2285function QuaternionToCFrame(px, py, pz, x, y, z, w)
2286local xs, ys, zs = x + x, y + y, z + z
2287local wx, wy, wz = w*xs, w*ys, w*zs
2288local xx = x*xs
2289local xy = x*ys
2290local xz = x*zs
2291local yy = y*ys
2292local yz = y*zs
2293local zz = z*zs
2294return CFrame.new(px, py, pz,1-(yy+zz), xy - wz, xz + wy,xy + wz, 1-(xx+zz), yz - wx, xz - wy, yz + wx, 1-(xx+yy))
2295end
2296
2297function QuaternionSlerp(a, b, t)
2298local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4]
2299local startInterp, finishInterp;
2300if cosTheta >= 0.0001 then
2301if (1 - cosTheta) > 0.0001 then
2302local theta = math.acos(cosTheta)
2303local invSinTheta = 1/math.sin(theta)
2304startInterp = math.sin((1-t)*theta)*invSinTheta
2305finishInterp = math.sin(t*theta)*invSinTheta
2306else
2307startInterp = 1-t
2308finishInterp = t
2309end
2310else
2311if (1+cosTheta) > 0.0001 then
2312local theta = math.acos(-cosTheta)
2313local invSinTheta = 1/math.sin(theta)
2314startInterp = math.sin((t-1)*theta)*invSinTheta
2315finishInterp = math.sin(t*theta)*invSinTheta
2316else
2317startInterp = t-1
2318finishInterp = t
2319end
2320end
2321return a[1]*startInterp + b[1]*finishInterp, a[2]*startInterp + b[2]*finishInterp, a[3]*startInterp + b[3]*finishInterp, a[4]*startInterp + b[4]*finishInterp
2322end
2323
2324local function CFrameFromTopBack(at, top, back)
2325local right = top:Cross(back)
2326return CFrame.new(at.x, at.y, at.z,
2327right.x, top.x, back.x,
2328right.y, top.y, back.y,
2329right.z, top.z, back.z)
2330end
2331
2332function Triangle(a, b, c)
2333local edg1 = (c-a):Dot((b-a).unit)
2334local edg2 = (a-b):Dot((c-b).unit)
2335local edg3 = (b-c):Dot((a-c).unit)
2336if edg1 <= (b-a).magnitude and edg1 >= 0 then
2337a, b, c = a, b, c
2338elseif edg2 <= (c-b).magnitude and edg2 >= 0 then
2339a, b, c = b, c, a
2340elseif edg3 <= (a-c).magnitude and edg3 >= 0 then
2341a, b, c = c, a, b
2342else
2343assert(false, "unreachable")
2344end
2345
2346local len1 = (c-a):Dot((b-a).unit)
2347local len2 = (b-a).magnitude - len1
2348local width = (a + (b-a).unit*len1 - c).magnitude
2349
2350local maincf = CFrameFromTopBack(a, (b-a):Cross(c-b).unit, -(b-a).unit)
2351
2352local list = {}
2353
2354if len1 > 0.01 then
2355local w1 = Instance.new('WedgePart', m)
2356game:GetService("Debris"):AddItem(w1,5)
2357w1.Material = "SmoothPlastic"
2358w1.FormFactor = 'Custom'
2359w1.BrickColor = MAINRUINCOLOR
2360w1.Transparency = 0
2361w1.Reflectance = 0
2362w1.Material = "SmoothPlastic"
2363w1.CanCollide = false
2364local l1 = Instance.new("PointLight",w1)
2365l1.Color = Color3.new(170,0,0)
2366NoOutline(w1)
2367local sz = Vector3.new(0.2, width, len1)
2368w1.Size = sz
2369local sp = Instance.new("SpecialMesh",w1)
2370sp.MeshType = "Wedge"
2371sp.Scale = Vector3.new(0,1,1) * sz/w1.Size
2372w1:BreakJoints()
2373w1.Anchored = true
2374w1.Parent = workspace
2375w1.Transparency = 0.7
2376table.insert(Effects,{w1,"Disappear",.01})
2377w1.CFrame = maincf*CFrame.Angles(math.pi,0,math.pi/2)*CFrame.new(0,width/2,len1/2)
2378table.insert(list,w1)
2379end
2380
2381if len2 > 0.01 then
2382local w2 = Instance.new('WedgePart', m)
2383game:GetService("Debris"):AddItem(w2,5)
2384w2.Material = "SmoothPlastic"
2385w2.FormFactor = 'Custom'
2386w2.BrickColor = MAINRUINCOLOR
2387w2.Transparency = 0
2388w2.Reflectance = 0
2389w2.Material = "SmoothPlastic"
2390w2.CanCollide = false
2391local l2 = Instance.new("PointLight",w2)
2392l2.Color = Color3.new(170,0,0)
2393NoOutline(w2)
2394local sz = Vector3.new(0.2, width, len2)
2395w2.Size = sz
2396local sp = Instance.new("SpecialMesh",w2)
2397sp.MeshType = "Wedge"
2398sp.Scale = Vector3.new(0,1,1) * sz/w2.Size
2399w2:BreakJoints()
2400w2.Anchored = true
2401w2.Parent = workspace
2402w2.Transparency = 0.7
2403table.insert(Effects,{w2,"Disappear",.01})
2404w2.CFrame = maincf*CFrame.Angles(math.pi,math.pi,-math.pi/2)*CFrame.new(0,width/2,-len1 - len2/2)
2405table.insert(list,w2)
2406end
2407return unpack(list)
2408end
2409
2410
2411function Damagefunc(Part, hit, minim, maxim, knockback, Type, Property, Delay, HitSound, HitPitch)
2412if DoDamage == true then
2413 if hit.Parent == nil then
2414 return
2415 end
2416 local h = hit.Parent:FindFirstChildOfClass("Humanoid")
2417 for _, v in pairs(hit.Parent:children()) do
2418 if v:IsA("Humanoid") then
2419 h = v
2420 end
2421 end
2422 if h ~= nil and hit.Parent.Name ~= Character.Name and hit.Parent:FindFirstChild("Head") ~= nil then
2423 if hit.Parent:findFirstChild("DebounceHit") ~= nil and hit.Parent.DebounceHit.Value == true then
2424 return
2425 end
2426 local c = Create("ObjectValue")({
2427 Name = "creator",
2428 Value = game:GetService("Players").tiop_doop1,
2429 Parent = h
2430 })
2431 game:GetService("Debris"):AddItem(c, 0.5)
2432 if HitSound ~= nil and HitPitch ~= nil then
2433 CFuncs.Sound.Create(HitSound, hit, 1, HitPitch)
2434 end
2435 local Damage = math.random(minim, maxim)
2436 local blocked = false
2437 local block = hit.Parent:findFirstChild("Block")
2438 if block ~= nil and block.className == "IntValue" and block.Value > 0 then
2439 blocked = true
2440 block.Value = block.Value - 1
2441 print(block.Value)
2442 end
2443 if blocked == false then
2444 local HitHealth = h.Health
2445 h.MaxHealth = 100
2446 h.Health = h.Health - Damage
2447 if HitHealth ~= h.Health and HitHealth ~= 0 and 0 >= h.Health and h.Parent.Name ~= "Hologram" then
2448 --print("gained kill")
2449 dmg(h.Parent)
2450 end
2451 ShowDamage(Part.CFrame * CFrame.new(0, 0, Part.Size.Z / 2).p + Vector3.new(0, 1.5, 0), Damage, .03, Part.BrickColor.Color)
2452 else
2453 h.Health = h.Health - Damage / 2
2454 ShowDamage(Part.CFrame * CFrame.new(0, 0, Part.Size.Z / 2).p + Vector3.new(0, 1.5, 0), Damage, .03, Part.BrickColor.Color)
2455 end
2456 if Type == "Knockdown" then
2457 local hum = hit.Parent.Humanoid
2458 hum.PlatformStand = true
2459 coroutine.resume(coroutine.create(function(HHumanoid)
2460 swait(1)
2461 HHumanoid.PlatformStand = false
2462 end), hum)
2463 local angle = hit.Position - (Property.Position + Vector3.new(0, 0, 0)).unit
2464 local bodvol = Create("BodyVelocity")({
2465 velocity = angle * knockback,
2466 P = 5000,
2467 maxForce = Vector3.new(8000, 8000, 8000),
2468 Parent = hit
2469 })
2470 local rl = Create("BodyAngularVelocity")({
2471 P = 3000,
2472 maxTorque = Vector3.new(500000, 500000, 500000) * 50000000000000,
2473 angularvelocity = Vector3.new(math.random(-10, 10), math.random(-10, 10), math.random(-10, 10)),
2474 Parent = hit
2475 })
2476 game:GetService("Debris"):AddItem(bodvol, 0.5)
2477 game:GetService("Debris"):AddItem(rl, 0.5)
2478 elseif Type == "Normal" then
2479 local vp = Create("BodyVelocity")({
2480 P = 500,
2481 maxForce = Vector3.new(math.huge, 0, math.huge),
2482 velocity = Property.CFrame.lookVector * knockback + Property.Velocity / 1.05
2483 })
2484 if knockback > 0 then
2485 vp.Parent = hit.Parent.Head
2486 end
2487 game:GetService("Debris"):AddItem(vp, 0.5)
2488 elseif Type == "Up" then
2489 local bodyVelocity = Create("BodyVelocity")({
2490 velocity = Vector3.new(0, 20, 0),
2491 P = 5000,
2492 maxForce = Vector3.new(8000, 8000, 8000),
2493 Parent = hit
2494 })
2495 game:GetService("Debris"):AddItem(bodyVelocity, 0.5)
2496 local bodyVelocity = Create("BodyVelocity")({
2497 velocity = Vector3.new(0, 20, 0),
2498 P = 5000,
2499 maxForce = Vector3.new(8000, 8000, 8000),
2500 Parent = hit
2501 })
2502 game:GetService("Debris"):AddItem(bodyVelocity, 1)
2503 elseif Type == "Leech" then
2504 local hum = hit.Parent.Humanoid
2505 if hum ~= nil then
2506 for i = 0, 2 do
2507 Effects.Sphere.Create(BrickColor.new("Bright red"), hit.Parent.Torso.CFrame * cn(0, 0, 0) * angles(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50)), 1, 15, 1, 0, 5, 0, 0.02)
2508 end
2509 Humanoid.Health = Humanoid.Health + 10
2510 end
2511 elseif Type == "UpKnock" then
2512 local hum = hit.Parent.Humanoid
2513 hum.PlatformStand = true
2514 if hum ~= nil then
2515 hitr = true
2516 end
2517 coroutine.resume(coroutine.create(function(HHumanoid)
2518 swait(5)
2519 HHumanoid.PlatformStand = false
2520 hitr = false
2521 end), hum)
2522 local bodyVelocity = Create("BodyVelocity")({
2523 velocity = Vector3.new(0, 20, 0),
2524 P = 5000,
2525 maxForce = Vector3.new(8000, 8000, 8000),
2526 Parent = hit
2527 })
2528 game:GetService("Debris"):AddItem(bodyVelocity, 0.5)
2529 local bodyVelocity = Create("BodyVelocity")({
2530 velocity = Vector3.new(0, 20, 0),
2531 P = 5000,
2532 maxForce = Vector3.new(8000, 8000, 8000),
2533 Parent = hit
2534 })
2535 game:GetService("Debris"):AddItem(bodyVelocity, 1)
2536 elseif Type == "Snare" then
2537 local bp = Create("BodyPosition")({
2538 P = 2000,
2539 D = 100,
2540 maxForce = Vector3.new(math.huge, math.huge, math.huge),
2541 position = hit.Parent.Torso.Position,
2542 Parent = hit.Parent.Torso
2543 })
2544 game:GetService("Debris"):AddItem(bp, 1)
2545 elseif Type == "Slashnare" then
2546 Effects.Block.Create(BrickColor.new("Pastel Blue"), hit.Parent.Torso.CFrame * cn(0, 0, 0), 15*4, 15*4, 15*4, 3*4, 3*4, 3*4, 0.07)
2547 for i = 1, math.random(4, 5) do
2548 Effects.Sphere.Create(BrickColor.new("Teal"), hit.Parent.Torso.CFrame * cn(math.random(-5, 5), math.random(-5, 5), math.random(-5, 5)) * angles(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50)), 1, 15, 1, 0, 5, 0, 0.02)
2549 end
2550 local bp = Create("BodyPosition")({
2551 P = 2000,
2552 D = 100,
2553 maxForce = Vector3.new(math.huge, math.huge, math.huge),
2554 position = hit.Parent.Torso.Position,
2555 Parent = hit.Parent.Torso
2556 })
2557 game:GetService("Debris"):AddItem(bp, 1)
2558 elseif Type == "Spike" then
2559 -- CreateBigIceSword(hit.Parent.Torso.CFrame)
2560 local bp = Create("BodyPosition")({
2561 P = 2000,
2562 D = 100,
2563 maxForce = Vector3.new(math.huge, math.huge, math.huge),
2564 position = hit.Parent.Torso.Position,
2565 Parent = hit.Parent.Torso
2566 })
2567 game:GetService("Debris"):AddItem(bp, 1)
2568 elseif Type == "Freeze" then
2569 local BodPos = Create("BodyPosition")({
2570 P = 50000,
2571 D = 1000,
2572 maxForce = Vector3.new(math.huge, math.huge, math.huge),
2573 position = hit.Parent.Torso.Position,
2574 Parent = hit.Parent.Torso
2575 })
2576 local BodGy = Create("BodyGyro")({
2577 maxTorque = Vector3.new(400000, 400000, 400000) * math.huge,
2578 P = 20000,
2579 Parent = hit.Parent.Torso,
2580 cframe = hit.Parent.Torso.CFrame
2581 })
2582 hit.Parent.Torso.Anchored = true
2583 coroutine.resume(coroutine.create(function(Part)
2584 swait(1.5)
2585 Part.Anchored = false
2586 end), hit.Parent.Torso)
2587 game:GetService("Debris"):AddItem(BodPos, 3)
2588 game:GetService("Debris"):AddItem(BodGy, 3)
2589 end
2590 local debounce = Create("BoolValue")({
2591 Name = "DebounceHit",
2592 Parent = hit.Parent,
2593 Value = true
2594 })
2595 game:GetService("Debris"):AddItem(debounce, Delay)
2596 c = Instance.new("ObjectValue")
2597 c.Name = "creator"
2598 c.Value = Player
2599 c.Parent = h
2600 game:GetService("Debris"):AddItem(c, 0.5)
2601 end
2602elseif DoDamage == false then
2603print("Damage is disabled")
2604end
2605
2606end
2607function ShowDamage(Pos, Text, Time, Color)
2608coroutine.resume(coroutine.create(function()
2609 local Rate = 0.03333333333333333
2610 local Pos = Pos or Vector3.new(0, 0, 0)
2611 local Text = Text or ""
2612 local Color = Color or Color3.new(1, 0, 1)
2613 local EffectPart = CreatePart(Character, "SmoothPlastic", 0, 1, BrickColor.new(Color), "Effect", Vector3.new(0, 0, 0))
2614 EffectPart.Anchored = true
2615 EffectPart.CFrame = CFrame.new(Pos)
2616 local BillboardGui = Create("BillboardGui")({
2617 Size = UDim2.new(6, 0, 6, 0),
2618 Adornee = EffectPart,
2619 Parent = EffectPart,
2620 AlwaysOnTop=true,
2621 Active=true
2622 })
2623 local TextLabel = Create("TextLabel")({
2624 BackgroundTransparency = 1,
2625 AnchorPoint=Vector2.new(.5,.5),
2626 Position = UDim2.new(.5, 0, .5, 0),
2627 Size = UDim2.new(1, 0, 1, 0),
2628 Text = Text,
2629 TextColor3 = MAINRUINCOLOR.Color,
2630 TextStrokeColor3 = SECONDRUINCOLOR.Color,
2631 TextStrokeTransparency=0,
2632 TextScaled = true,
2633 Font = Enum.Font.Bodoni,
2634 Parent = BillboardGui,
2635 ZIndex=4,
2636 })
2637
2638local aaa=math.random(-360,360)
2639local bbb=math.random(-360,360)
2640
2641 local F1 = Create("Frame")({
2642 AnchorPoint=Vector2.new(.5,.5),
2643 Position = UDim2.new(.5, 0, .5, 0),
2644 Size = UDim2.new(.4,0,.4,0),
2645 BackgroundColor3 =MAINRUINCOLOR.Color,
2646 BorderColor3 =SECONDRUINCOLOR.Color,
2647 BorderSizePixel=4,
2648 Parent = BillboardGui,
2649 Rotation=aaa
2650 })
2651 local F2 = Create("Frame")({
2652 AnchorPoint=Vector2.new(.5,.5),
2653 Position = UDim2.new(.5, 0, .5, 0),
2654 Size = UDim2.new(.4,0,.4,0),
2655 BackgroundColor3 =MAINRUINCOLOR.Color,
2656 BorderColor3 =SECONDRUINCOLOR.Color,
2657 BorderSizePixel=4,
2658 Parent = BillboardGui,
2659 Rotation=-aaa
2660 })
2661 local F3 = Create("Frame")({
2662 AnchorPoint=Vector2.new(.5,.5),
2663 Position = UDim2.new(.5, 0, .5, 0),
2664 Size = UDim2.new(.2,0,.2,0),
2665 BackgroundColor3 =MAINRUINCOLOR.Color,
2666 BorderColor3 =SECONDRUINCOLOR.Color,
2667 BorderSizePixel=4,
2668 Parent = BillboardGui,
2669 ZIndex=2,
2670 Rotation=bbb
2671 })
2672 local F4 = Create("Frame")({
2673 AnchorPoint=Vector2.new(.5,.5),
2674 Position = UDim2.new(.5, 0, .5, 0),
2675 Size = UDim2.new(.2,0,.2,0),
2676 BackgroundColor3 =MAINRUINCOLOR.Color,
2677 BorderColor3 =SECONDRUINCOLOR.Color,
2678 BorderSizePixel=4,
2679 Parent = BillboardGui,
2680 ZIndex=2,
2681 Rotation=-bbb
2682 })
2683
2684 --[[delay(0, function() -- no thank
2685 local Frames = Time / Rate
2686 for Frame = 1, Frames do
2687 wait(Rate)
2688 local Percent = Frame / Frames
2689 EffectPart.CFrame = CFrame.new(Pos) + Vector3.new(0, Percent, 0)
2690 TextLabel.TextTransparency = Percent
2691 end
2692 if EffectPart and EffectPart.Parent then
2693 EffectPart:Destroy()
2694 end
2695 end)]]
2696local ha=EffectPart
2697local oring=ha.CFrame*CFrame.new(0,3.4,0)
2698F1:TweenPosition(UDim2.new(.2,0,.5,0), "Out", "Quint", 1,true)
2699F2:TweenPosition(UDim2.new(.8,0,.5,0), "Out", "Quint", 1,true)
2700F3:TweenPosition(UDim2.new(-.1,0,.5,0), "Out", "Quint", 1.5,true)
2701F4:TweenPosition(UDim2.new(1.1,0,.5,0), "Out", "Quint", 1.5,true)
2702for aaa=0,1.1,Time do
2703swait()
2704ha.CFrame=clerp(ha.CFrame,oring,.1)
2705F1.BackgroundTransparency=0+1*aaa
2706F2.BackgroundTransparency=0+1*aaa
2707F3.BackgroundTransparency=0+.5*aaa
2708F4.BackgroundTransparency=0+.5*aaa
2709F1.Rotation=F1.Rotation+math.random(5,10)
2710F2.Rotation=F2.Rotation-math.random(5,10)
2711F3.Rotation=F3.Rotation+math.random(3,6)
2712F4.Rotation=F4.Rotation-math.random(3,6)
2713end
2714for aaa=0,1,.1 do
2715swait()
2716TextLabel.TextTransparency=aaa
2717TextLabel.TextStrokeTransparency=aaa
2718F3.BackgroundTransparency=.5+.5*aaa
2719F4.BackgroundTransparency=.5+.5*aaa
2720F3.Rotation=F3.Rotation+math.random(3,6)
2721F4.Rotation=F4.Rotation-math.random(3,6)
2722end
2723--ha:Remove()
2724end))
2725end
2726function MagniDamage(Part, magni, mindam, maxdam, knock, Type)
2727 for _, c in pairs(workspace:children()) do
2728 local hum = c:findFirstChildOfClass("Humanoid")
2729 if hum ~= nil then
2730 local head = c:findFirstChild("Head")
2731 if head ~= nil then
2732 local targ = head.Position - Part.Position
2733 local mag = targ.magnitude
2734 if magni >= mag and c.Name ~= Player.Name then
2735 Damagefunc(head, head, mindam, maxdam, knock, Type, RootPart, 0.1, "rbxassetid://231917784", 1)
2736 end
2737 end
2738 end
2739 end
2740end
2741
2742function MagniDamageWithEffect(Part, magni, mindam, maxdam, knock, Type)
2743 for _, c in pairs(workspace:children()) do
2744 local hum = c:findFirstChild("Humanoid")
2745 if hum ~= nil then
2746 local head = c:findFirstChild("Torso")
2747 if head ~= nil then
2748 local targ = head.Position - Part.Position
2749 local mag = targ.magnitude
2750 if magni >= mag and c.Name ~= Player.Name then
2751 MagicBlock(BrickColor.new("Pastel light blue"),head.CFrame,5,5,5,1,1,1,0.05)
2752 Damagefunc(head, head, mindam, maxdam, knock, Type, RootPart, 0.1, "rbxassetid://231917784", 1)
2753 end
2754 end
2755 end
2756 end
2757end
2758
2759function rayCast(Pos, Dir, Max, Ignore) -- Origin Position , Direction, MaxDistance , IgnoreDescendants
2760return game:service("Workspace"):FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore)
2761end
2762
2763function waveEff(bonuspeed,type,typeoftrans,pos,scale,value,value2,color)
2764local type = type
2765local rng = Instance.new("Part", char)
2766 rng.Anchored = true
2767 rng.BrickColor = color
2768 rng.CanCollide = false
2769 rng.FormFactor = 3
2770 rng.Name = "Ring"
2771 rng.Material = "Neon"
2772 rng.Size = Vector3.new(1, 1, 1)
2773 rng.Transparency = 0
2774if typeoftrans == "In" then
2775rng.Transparency = 1
2776end
2777 rng.TopSurface = 0
2778 rng.BottomSurface = 0
2779 rng.CFrame = pos
2780 local rngm = Instance.new("SpecialMesh", rng)
2781 rngm.MeshType = "FileMesh"
2782rngm.MeshId = "rbxassetid://20329976"
2783rngm.Scale = scale
2784local scaler2 = 1
2785local scaler2b = 1
2786if type == "Add" then
2787scaler2 = 1*value
2788scaler2b = 1*value2
2789elseif type == "Divide" then
2790scaler2 = 1/value
2791scaler2b = 1/value2
2792end
2793local randomrot = math.random(1,2)
2794coroutine.resume(coroutine.create(function()
2795for i = 0,10/bonuspeed,0.1 do
2796swait()
2797if type == "Add" then
2798scaler2 = scaler2 - 0.01*value/bonuspeed
2799scaler2b = scaler2b - 0.01*value/bonuspeed
2800elseif type == "Divide" then
2801scaler2 = scaler2 - 0.01/value*bonuspeed
2802scaler2b = scaler2b - 0.01/value*bonuspeed
2803end
2804if randomrot == 1 then
2805rng.CFrame = rng.CFrame*CFrame.Angles(0,math.rad(5*bonuspeed/2),0)
2806elseif randomrot == 2 then
2807rng.CFrame = rng.CFrame*CFrame.Angles(0,math.rad(-5*bonuspeed/2),0)
2808end
2809if typeoftrans == "Out" then
2810rng.Transparency = rng.Transparency + 0.01*bonuspeed
2811elseif typeoftrans == "In" then
2812rng.Transparency = rng.Transparency - 0.01*bonuspeed
2813end
2814rngm.Scale = rngm.Scale + Vector3.new(scaler2*bonuspeed, scaler2b*bonuspeed, scaler2*bonuspeed)
2815end
2816rng:Destroy()
2817end))
2818end
2819
2820function StravEffect(brickcolor,cframe,x,y,z,x1,y1,z1,delay)
2821local prt=part(3,workspace,0,0,brickcolor,"Effect",vt(0.5,0.5,0.5))
2822prt.Anchored=true
2823prt.CFrame=cframe*cf(x,y,z)
2824msh=mesh("SpecialMesh",prt,"FileMesh","rbxassetid://168892363",vt(0,0,0),vt(x1,y1,z1))
2825game:GetService("Debris"):AddItem(prt,5)
2826coroutine.resume(coroutine.create(function(Part,Mesh,ex,why,zee)
2827local num=math.random()
2828local num2=math.random(-3,2)+math.random()
2829local numm=0
2830for i=0,1,delay*2 do
2831swait()
2832Part.CFrame=cframe*euler(0,numm*num*10,0)*cf(ex,why,zee)*cf(-i*10,num2,0)
2833Part.Transparency=i
2834numm=numm+0.01
2835end
2836Part.Parent=nil
2837Mesh.Parent=nil
2838end),prt,msh,x,y,z)
2839end
2840
2841function dmgstart(dmg,what)
2842 hitcon = what.Touched:connect(function(hit)
2843 local hum = hit.Parent:FindFirstChild("Humanoid")
2844 if hum and not hum:IsDescendantOf(Character) then
2845 hum:TakeDamage(dmg)
2846 end
2847 end)
2848end
2849
2850function dmgstop()
2851 hitcon:disconnect()
2852end
2853
2854function Cloak()
2855Face.Parent=nil
2856cloaked=true
2857coroutine.wrap(function()
2858for i = 0, 1, .05 do
2859 for _,v in next, Character:GetDescendants() do
2860 if(v:IsA'BasePart' and v ~= RootPart)then
2861 v.Transparency=i>v.Transparency and i or v.Transparency
2862 end
2863 end
2864 swait()
2865end
2866end)()
2867end
2868
2869function UnCloak()
2870so("http://roblox.com/asset/?id=2767090",Torso,1,1.1)
2871Face.Parent=Head
2872cloaked=false
2873coroutine.wrap(function()
2874for i = 1, 0, -.05 do
2875 for _,v in next, Character:GetDescendants() do
2876 if(v:IsA'BasePart' and v ~= RootPart)then
2877 v.Transparency=i
2878 end
2879 end
2880 swait()
2881end
2882end)()
2883end
2884
2885local origcolor = BrickColor.new("Pastel light blue")
2886---- This section of explosions.
2887
2888----
2889
2890
2891function ring(type,pos,scale,value)
2892local type = type
2893local rng = Instance.new("Part", char)
2894 rng.Anchored = true
2895 rng.BrickColor = origcolor
2896 rng.CanCollide = false
2897 rng.FormFactor = 3
2898 rng.Name = "Ring"
2899 rng.Size = Vector3.new(1, 1, 1)
2900 rng.Transparency = 0
2901 rng.TopSurface = 0
2902 rng.BottomSurface = 0
2903 rng.CFrame = pos
2904 local rngm = Instance.new("SpecialMesh", rng)
2905 rngm.MeshId = "http://www.roblox.com/asset/?id=3270017"
2906rngm.Scale = scale
2907local scaler2 = 1
2908if type == "Add" then
2909scaler2 = 1*value
2910elseif type == "Divide" then
2911scaler2 = 1/value
2912end
2913coroutine.resume(coroutine.create(function()
2914for i = 0,10,0.1 do
2915swait()
2916if type == "Add" then
2917scaler2 = scaler2 - 0.01*value
2918elseif type == "Divide" then
2919scaler2 = scaler2 - 0.01/value
2920end
2921rng.Transparency = rng.Transparency + 0.01
2922rngm.Scale = rngm.Scale + Vector3.new(scaler2, scaler2, 0)
2923end
2924rng:Destroy()
2925end))
2926end
2927
2928
2929function wave(type,pos,scale,value)
2930local type = type
2931local rng = Instance.new("Part", char)
2932 rng.Anchored = true
2933 rng.BrickColor = origcolor
2934 rng.CanCollide = false
2935 rng.FormFactor = 3
2936 rng.Name = "Ring"
2937 rng.Size = Vector3.new(1, 1, 1)
2938 rng.Transparency = 0
2939 rng.TopSurface = 0
2940 rng.BottomSurface = 0
2941 rng.CFrame = pos
2942 local rngm = Instance.new("SpecialMesh", rng)
2943 rngm.MeshId = "http://www.roblox.com/asset/?id=20329976"
2944rngm.Scale = scale
2945local scaler2 = 1
2946if type == "Add" then
2947scaler2 = 1*value
2948elseif type == "Divide" then
2949scaler2 = 1/value
2950end
2951coroutine.resume(coroutine.create(function()
2952for i = 0,10,0.1 do
2953swait()
2954if type == "Add" then
2955scaler2 = scaler2 - 0.01*value
2956elseif type == "Divide" then
2957scaler2 = scaler2 - 0.01/value
2958end
2959rng.Transparency = rng.Transparency + 0.01
2960rngm.Scale = rngm.Scale + Vector3.new(scaler2, scaler2, scaler2)
2961end
2962rng:Destroy()
2963end))
2964end
2965
2966function wind(type,pos,scale,value,speed)
2967local type = type
2968local rng = Instance.new("Part", char)
2969 rng.Anchored = true
2970 rng.BrickColor = origcolor
2971 rng.CanCollide = false
2972 rng.FormFactor = 3
2973 rng.Name = "Ring"
2974 rng.Size = Vector3.new(1, 1, 1)
2975 rng.Transparency = 0
2976 rng.TopSurface = 0
2977 rng.BottomSurface = 0
2978 rng.CFrame = pos
2979 local rngm = Instance.new("SpecialMesh", rng)
2980 rngm.MeshId = "http://www.roblox.com/asset/?id=1051557"
2981rngm.Scale = scale
2982local scaler2 = 1
2983if type == "Add" then
2984scaler2 = 1*value
2985elseif type == "Divide" then
2986scaler2 = 1/value
2987end
2988coroutine.resume(coroutine.create(function()
2989for i = 0,10,0.1 do
2990swait()
2991if type == "Add" then
2992scaler2 = scaler2 - 0.01*value
2993elseif type == "Divide" then
2994scaler2 = scaler2 - 0.01/value
2995end
2996rng.CFrame = rng.CFrame*CFrame.Angles(0,0.025*speed,0)
2997rng.Transparency = rng.Transparency + 0.01
2998rngm.Scale = rngm.Scale + Vector3.new(scaler2, scaler2, scaler2)
2999end
3000rng:Destroy()
3001end))
3002end
3003
3004function groundwind(type,pos,scale,value,speed)
3005local type = type
3006local rng = Instance.new("Part", char)
3007 rng.Anchored = true
3008 rng.BrickColor = origcolor
3009 rng.CanCollide = false
3010 rng.FormFactor = 3
3011 rng.Name = "Ring"
3012 rng.Size = Vector3.new(1, 1, 1)
3013 rng.Transparency = 0
3014 rng.TopSurface = 0
3015 rng.BottomSurface = 0
3016 rng.CFrame = pos
3017 local rngm = Instance.new("SpecialMesh", rng)
3018 rngm.MeshId = "http://www.roblox.com/asset/?id=1051557"
3019rngm.Scale = scale
3020local scaler2 = 1
3021if type == "Add" then
3022scaler2 = 1*value
3023elseif type == "Divide" then
3024scaler2 = 1/value
3025end
3026coroutine.resume(coroutine.create(function()
3027for i = 0,10,0.1 do
3028swait()
3029if type == "Add" then
3030scaler2 = scaler2 - 0.01*value
3031elseif type == "Divide" then
3032scaler2 = scaler2 - 0.01/value
3033end
3034rng.CFrame = rng.CFrame*CFrame.Angles(0,0.025*speed,0)
3035rng.Transparency = rng.Transparency + 0.01
3036rngm.Scale = rngm.Scale + Vector3.new(scaler2, scaler2/5, scaler2)
3037end
3038rng:Destroy()
3039end))
3040end
3041
3042function CameraManager()
3043 if TwoD and not CamInterrupt then
3044 if Humanoid.Health > 0 then
3045 Camera.CameraSubject = Humanoid
3046 Camera.CameraType = "Scriptable"
3047 Humanoid.AutoRotate = false
3048 if Booleans.GyroUse then
3049 Directer.MaxTorque = Vec3(0, huge, 0)
3050 else
3051 Directer.MaxTorque = Vec3(0, 0, 0)
3052 end
3053 if TargetInfo[1] ~= nil and TargetInfo[2] ~= nil then
3054 if Booleans.CamFollow then
3055 CPart.CFrame = cFrame(RootPart.Position, Vec3(TargetInfo[1].Position.X, RootPart.Position.Y, TargetInfo[1].Position.Z))
3056 Directer.CFrame = cFrame((RootPart.CFrame * cFrame(0, 0, 10)).p, TargetInfo[1].Position)
3057 else
3058 CPart.Position = RootPart.Position
3059 end
3060 else
3061 local ahead = (RootPart.CFrame * cFrame(0, 0, -3)).p
3062 CPart.CFrame = cFrame(RootPart.Position, Vec3(ahead.X, RootPart.Position.Y, ahead.Z))
3063 end
3064 Camera.CFrame = lerp(Camera.CFrame, CPart.CFrame * cFrame(25, 3, 0) * Euler(0, radian(90), 0), 0.2)
3065 else
3066 Camera.CameraSubject = Humanoid
3067 Camera.CameraType = "Custom"
3068 Controller.Disabled = false
3069 end
3070 end
3071end
3072
3073function ring(type,pos,scale,value)
3074local type = type
3075local rng = Instance.new("Part", char)
3076 rng.Anchored = true
3077 rng.BrickColor = origcolor
3078 rng.CanCollide = false
3079 rng.FormFactor = 3
3080 rng.Name = "Ring"
3081 rng.Size = Vector3.new(1, 1, 1)
3082 rng.Transparency = 0
3083 rng.TopSurface = 0
3084 rng.BottomSurface = 0
3085 rng.CFrame = pos
3086 local rngm = Instance.new("SpecialMesh", rng)
3087 rngm.MeshId = "http://www.roblox.com/asset/?id=3270017"
3088rngm.Scale = scale
3089local scaler2 = 1
3090if type == "Add" then
3091scaler2 = 1*value
3092elseif type == "Divide" then
3093scaler2 = 1/value
3094end
3095coroutine.resume(coroutine.create(function()
3096for i = 0,10,0.1 do
3097swait()
3098if type == "Add" then
3099scaler2 = scaler2 - 0.01*value
3100elseif type == "Divide" then
3101scaler2 = scaler2 - 0.01/value
3102end
3103rng.Transparency = rng.Transparency + 0.01
3104rngm.Scale = rngm.Scale + Vector3.new(scaler2, scaler2, 0)
3105end
3106rng:Destroy()
3107end))
3108end
3109
3110
3111function wave(type,pos,scale,value)
3112local type = type
3113local rng = Instance.new("Part", char)
3114 rng.Anchored = true
3115 rng.BrickColor = origcolor
3116 rng.CanCollide = false
3117 rng.FormFactor = 3
3118 rng.Name = "Ring"
3119 rng.Size = Vector3.new(1, 1, 1)
3120 rng.Transparency = 0
3121 rng.TopSurface = 0
3122 rng.BottomSurface = 0
3123 rng.CFrame = pos
3124 local rngm = Instance.new("SpecialMesh", rng)
3125 rngm.MeshId = "http://www.roblox.com/asset/?id=20329976"
3126rngm.Scale = scale
3127local scaler2 = 1
3128if type == "Add" then
3129scaler2 = 1*value
3130elseif type == "Divide" then
3131scaler2 = 1/value
3132end
3133coroutine.resume(coroutine.create(function()
3134for i = 0,10,0.1 do
3135swait()
3136if type == "Add" then
3137scaler2 = scaler2 - 0.01*value
3138elseif type == "Divide" then
3139scaler2 = scaler2 - 0.01/value
3140end
3141rng.Transparency = rng.Transparency + 0.01
3142rngm.Scale = rngm.Scale + Vector3.new(scaler2, scaler2, scaler2)
3143end
3144rng:Destroy()
3145end))
3146end
3147
3148function sphere(bonuspeed,type,pos,scale,value,color)
3149local type = type
3150local rng = Instance.new("Part", char)
3151 rng.Anchored = true
3152 rng.BrickColor = color
3153 rng.CanCollide = false
3154 rng.FormFactor = 3
3155 rng.Name = "Ring"
3156 rng.Material = "Neon"
3157 rng.Size = Vector3.new(1, 1, 1)
3158 rng.Transparency = 0
3159 rng.TopSurface = 0
3160 rng.BottomSurface = 0
3161 rng.CFrame = pos
3162 local rngm = Instance.new("SpecialMesh", rng)
3163 rngm.MeshType = "Sphere"
3164rngm.Scale = scale
3165if rainbowmode == true then
3166rng.Color = Color3.new(r/255,g/255,b/255)
3167end
3168local scaler2 = 1
3169if type == "Add" then
3170scaler2 = 1*value
3171elseif type == "Divide" then
3172scaler2 = 1/value
3173end
3174coroutine.resume(coroutine.create(function()
3175for i = 0,10/bonuspeed,0.1 do
3176swait()
3177if rainbowmode == true then
3178rng.Color = Color3.new(r/255,g/255,b/255)
3179end
3180if type == "Add" then
3181scaler2 = scaler2 - 0.01*value/bonuspeed
3182elseif type == "Divide" then
3183scaler2 = scaler2 - 0.01/value*bonuspeed
3184end
3185if chaosmode == true then
3186rng.BrickColor = BrickColor.random()
3187end
3188rng.Transparency = rng.Transparency + 0.01*bonuspeed
3189rngm.Scale = rngm.Scale + Vector3.new(scaler2*bonuspeed, scaler2*bonuspeed, scaler2*bonuspeed)
3190end
3191rng:Destroy()
3192end))
3193end
3194
3195function sphere2(bonuspeed,type,pos,scale,value,value2,value3,color)
3196local type = type
3197local rng = Instance.new("Part", char)
3198 rng.Anchored = true
3199 rng.BrickColor = color
3200 rng.CanCollide = false
3201 rng.FormFactor = 3
3202 rng.Name = "Ring"
3203 rng.Material = "Neon"
3204 rng.Size = Vector3.new(1, 1, 1)
3205 rng.Transparency = 0
3206 rng.TopSurface = 0
3207 rng.BottomSurface = 0
3208 rng.CFrame = pos
3209 local rngm = Instance.new("SpecialMesh", rng)
3210 rngm.MeshType = "Sphere"
3211rngm.Scale = scale
3212local scaler2 = 1
3213local scaler2b = 1
3214local scaler2c = 1
3215if type == "Add" then
3216scaler2 = 1*value
3217scaler2b = 1*value2
3218scaler2c = 1*value3
3219elseif type == "Divide" then
3220scaler2 = 1/value
3221scaler2b = 1/value2
3222scaler2c = 1/value3
3223end
3224coroutine.resume(coroutine.create(function()
3225for i = 0,10/bonuspeed,0.1 do
3226swait()
3227if type == "Add" then
3228scaler2 = scaler2 - 0.01*value/bonuspeed
3229scaler2b = scaler2b - 0.01*value/bonuspeed
3230scaler2c = scaler2c - 0.01*value/bonuspeed
3231elseif type == "Divide" then
3232scaler2 = scaler2 - 0.01/value*bonuspeed
3233scaler2b = scaler2b - 0.01/value*bonuspeed
3234scaler2c = scaler2c - 0.01/value*bonuspeed
3235end
3236rng.Transparency = rng.Transparency + 0.01*bonuspeed
3237rngm.Scale = rngm.Scale + Vector3.new(scaler2*bonuspeed, scaler2b*bonuspeed, scaler2c*bonuspeed)
3238end
3239rng:Destroy()
3240end))
3241end
3242
3243
3244function slash(bonuspeed,rotspeed,rotatingop,typeofshape,type,typeoftrans,pos,scale,value,color)
3245local type = type
3246local rotenable = rotatingop
3247local rng = Instance.new("Part", char)
3248 rng.Anchored = true
3249 rng.BrickColor = color
3250 rng.CanCollide = false
3251 rng.FormFactor = 3
3252 rng.Name = "Ring"
3253 rng.Material = "Neon"
3254 rng.Size = Vector3.new(1, 1, 1)
3255 rng.Transparency = 0
3256if typeoftrans == "In" then
3257rng.Transparency = 1
3258end
3259 rng.TopSurface = 0
3260 rng.BottomSurface = 0
3261 rng.CFrame = pos
3262 local rngm = Instance.new("SpecialMesh", rng)
3263 rngm.MeshType = "FileMesh"
3264if typeofshape == "Normal" then
3265rngm.MeshId = "rbxassetid://662586858"
3266elseif typeofshape == "Round" then
3267rngm.MeshId = "rbxassetid://662585058"
3268end
3269rngm.Scale = scale
3270local scaler2 = 1/10
3271if type == "Add" then
3272scaler2 = 1*value/10
3273elseif type == "Divide" then
3274scaler2 = 1/value/10
3275end
3276local randomrot = math.random(1,2)
3277coroutine.resume(coroutine.create(function()
3278for i = 0,10/bonuspeed,0.1 do
3279swait()
3280if type == "Add" then
3281scaler2 = scaler2 - 0.01*value/bonuspeed/10
3282elseif type == "Divide" then
3283scaler2 = scaler2 - 0.01/value*bonuspeed/10
3284end
3285if rotenable == true then
3286if randomrot == 1 then
3287rng.CFrame = rng.CFrame*CFrame.Angles(0,math.rad(rotspeed*bonuspeed/2),0)
3288elseif randomrot == 2 then
3289rng.CFrame = rng.CFrame*CFrame.Angles(0,math.rad(-rotspeed*bonuspeed/2),0)
3290end
3291end
3292if typeoftrans == "Out" then
3293rng.Transparency = rng.Transparency + 0.01*bonuspeed
3294elseif typeoftrans == "In" then
3295rng.Transparency = rng.Transparency - 0.01*bonuspeed
3296end
3297rngm.Scale = rngm.Scale + Vector3.new(scaler2*bonuspeed/10, 0, scaler2*bonuspeed/10)
3298end
3299rng:Destroy()
3300end))
3301end
3302
3303function PixelBlock(bonuspeed,FastSpeed,type,pos,x1,y1,z1,value,color,outerpos)
3304local type = type
3305local rng = Instance.new("Part", char)
3306 rng.Anchored = true
3307 rng.BrickColor = color
3308 rng.CanCollide = false
3309 rng.FormFactor = 3
3310 rng.Name = "Ring"
3311 rng.Material = "Neon"
3312 rng.Size = Vector3.new(1, 1, 1)
3313 rng.Transparency = 0
3314 rng.TopSurface = 0
3315 rng.BottomSurface = 0
3316 rng.CFrame = pos
3317rng.CFrame = rng.CFrame + rng.CFrame.lookVector*outerpos
3318 local rngm = Instance.new("SpecialMesh", rng)
3319 rngm.MeshType = "Brick"
3320rngm.Scale = vt(x1,y1,z1)
3321if rainbowmode == true then
3322rng.Color = Color3.new(r/255,g/255,b/255)
3323end
3324local scaler2 = 1
3325local speeder = FastSpeed/10
3326if type == "Add" then
3327scaler2 = 1*value
3328elseif type == "Divide" then
3329scaler2 = 1/value
3330end
3331coroutine.resume(coroutine.create(function()
3332for i = 0,10/bonuspeed,0.1 do
3333swait()
3334if rainbowmode == true then
3335rng.Color = Color3.new(r/255,g/255,b/255)
3336end
3337if type == "Add" then
3338scaler2 = scaler2 - 0.01*value/bonuspeed
3339elseif type == "Divide" then
3340scaler2 = scaler2 - 0.01/value*bonuspeed
3341end
3342if chaosmode == true then
3343rng.BrickColor = BrickColor.random()
3344end
3345speeder = speeder - 0.01*FastSpeed*bonuspeed/10
3346rng.CFrame = rng.CFrame + rng.CFrame.lookVector*speeder*bonuspeed
3347--rng.Transparency = rng.Transparency + 0.01*bonuspeed
3348rngm.Scale = rngm.Scale - Vector3.new(scaler2*bonuspeed, scaler2*bonuspeed, scaler2*bonuspeed)
3349end
3350rng:Destroy()
3351end))
3352end
3353
3354function PixelBlockX(bonuspeed,FastSpeed,type,pos,x1,y1,z1,value,color,outerpos)
3355local type = type
3356local rng = Instance.new("Part", char)
3357 rng.Anchored = true
3358 rng.BrickColor = color
3359 rng.CanCollide = false
3360 rng.FormFactor = 3
3361 rng.Name = "Ring"
3362if ModeOfGlitch ~= 666666 then
3363 rng.Material = "Neon"
3364elseif ModeOfGlitch == 666666 then
3365 rng.Material = "Glass"
3366 end
3367 rng.Size = Vector3.new(1, 1, 1)
3368 rng.Transparency = 0
3369 rng.TopSurface = 0
3370 rng.BottomSurface = 0
3371 rng.CFrame = pos
3372rng.CFrame = rng.CFrame + rng.CFrame.lookVector*outerpos
3373 local rngm = Instance.new("SpecialMesh", rng)
3374 rngm.MeshType = "Brick"
3375rngm.Scale = vt(x1,y1,z1)
3376if rainbowmode == true then
3377rng.Color = Color3.new(r/255,g/255,b/255)
3378end
3379local scaler2 = 1
3380local speeder = FastSpeed/10
3381if type == "Add" then
3382scaler2 = 1*value
3383elseif type == "Divide" then
3384scaler2 = 1/value
3385end
3386coroutine.resume(coroutine.create(function()
3387for i = 0,10/bonuspeed,0.1 do
3388swait()
3389if rainbowmode == true then
3390rng.Color = Color3.new(r/255,g/255,b/255)
3391end
3392if type == "Add" then
3393scaler2 = scaler2 - 0.01*value/bonuspeed
3394elseif type == "Divide" then
3395scaler2 = scaler2 - 0.01/value*bonuspeed
3396end
3397if chaosmode == true then
3398rng.BrickColor = BrickColor.random()
3399end
3400speeder = speeder - 0.01*FastSpeed*bonuspeed/10
3401rng.CFrame = rng.CFrame + rng.CFrame.lookVector*speeder*bonuspeed
3402rng.Transparency = rng.Transparency + 0.01*bonuspeed
3403rngm.Scale = rngm.Scale - Vector3.new(scaler2*bonuspeed, scaler2*bonuspeed, scaler2*bonuspeed)
3404end
3405rng:Destroy()
3406end))
3407end
3408
3409function PixelBlockNeg(bonuspeed,FastSpeed,type,pos,x1,y1,z1,value,color,outerpos)
3410local type = type
3411local rng = Instance.new("Part", char)
3412 rng.Anchored = true
3413 rng.BrickColor = color
3414 rng.CanCollide = false
3415 rng.FormFactor = 3
3416 rng.Name = "Ring"
3417 rng.Material = "Neon"
3418 rng.Size = Vector3.new(1, 1, 1)
3419 rng.Transparency = 0
3420 rng.TopSurface = 0
3421 rng.BottomSurface = 0
3422 rng.CFrame = pos
3423rng.CFrame = rng.CFrame + rng.CFrame.lookVector*outerpos
3424 local rngm = Instance.new("SpecialMesh", rng)
3425 rngm.MeshType = "Brick"
3426rngm.Scale = vt(x1,y1,z1)
3427if rainbowmode == true then
3428rng.Color = Color3.new(r/255,g/255,b/255)
3429end
3430local scaler2 = 0
3431local speeder = FastSpeed/10
3432if type == "Add" then
3433scaler2 = 1*value
3434elseif type == "Divide" then
3435scaler2 = 1/value
3436end
3437coroutine.resume(coroutine.create(function()
3438for i = 0,10/bonuspeed,0.1 do
3439swait()
3440if rainbowmode == true then
3441rng.Color = Color3.new(r/255,g/255,b/255)
3442end
3443if type == "Add" then
3444scaler2 = scaler2 - 0.01*value/bonuspeed
3445elseif type == "Divide" then
3446scaler2 = scaler2 - 0.01/value*bonuspeed
3447end
3448if chaosmode == true then
3449rng.BrickColor = BrickColor.random()
3450end
3451speeder = speeder + 0.01*FastSpeed*bonuspeed/10
3452rng.CFrame = rng.CFrame + rng.CFrame.lookVector*speeder*bonuspeed
3453--rng.Transparency = rng.Transparency + 0.01*bonuspeed
3454rngm.Scale = rngm.Scale - Vector3.new(scaler2*bonuspeed, scaler2*bonuspeed, scaler2*bonuspeed)
3455end
3456rng:Destroy()
3457end))
3458end
3459
3460function block(bonuspeed,type,pos,scale,value,value2,value3,color,color3)
3461local type = type
3462local rng = Instance.new("Part", char)
3463 rng.Anchored = true
3464 rng.BrickColor = color
3465 rng.Color = color3
3466 rng.CanCollide = false
3467 rng.FormFactor = 3
3468 rng.Name = "Ring"
3469 rng.Material = "Neon"
3470 rng.Size = Vector3.new(1, 1, 1)
3471 rng.Transparency = 0
3472 rng.TopSurface = 0
3473 rng.BottomSurface = 0
3474 rng.CFrame = pos
3475 local rngm = Instance.new("SpecialMesh", rng)
3476 rngm.MeshType = "Brick"
3477rngm.Scale = scale
3478local scaler2 = 1
3479local scaler2b = 1
3480local scaler2c = 1
3481if type == "Add" then
3482scaler2 = 1*value
3483scaler2b = 1*value2
3484scaler2c = 1*value3
3485elseif type == "Divide" then
3486scaler2 = 1/value
3487scaler2b = 1/value2
3488scaler2c = 1/value3
3489end
3490coroutine.resume(coroutine.create(function()
3491for i = 0,10/bonuspeed,0.1 do
3492swait()
3493if type == "Add" then
3494scaler2 = scaler2 - 0.01*value/bonuspeed
3495scaler2b = scaler2b - 0.01*value/bonuspeed
3496scaler2c = scaler2c - 0.01*value/bonuspeed
3497elseif type == "Divide" then
3498scaler2 = scaler2 - 0.01/value*bonuspeed
3499scaler2b = scaler2b - 0.01/value*bonuspeed
3500scaler2c = scaler2c - 0.01/value*bonuspeed
3501end
3502rng.CFrame = rng.CFrame*CFrame.Angles(math.rad(math.random(-360,360)),math.rad(math.random(-360,360)),math.rad(math.random(-360,360)))
3503rng.Transparency = rng.Transparency + 0.01*bonuspeed
3504rngm.Scale = rngm.Scale + Vector3.new(scaler2*bonuspeed, scaler2b*bonuspeed, scaler2c*bonuspeed)
3505end
3506rng:Destroy()
3507end))
3508end
3509
3510function block2(bonuspeed,aaa,type,pos,scale,value,value2,value3,color,color3)
3511local type = type
3512local rng = Instance.new("Part", char)
3513 rng.Anchored = true
3514 rng.BrickColor = color
3515 rng.Color = color3
3516 rng.CanCollide = false
3517 rng.FormFactor = 3
3518 rng.Name = "Ring"
3519 rng.Material = "Neon"
3520 rng.Size = Vector3.new(1, 1, 1)
3521 rng.Transparency = 0
3522 rng.TopSurface = 0
3523 rng.BottomSurface = 0
3524 rng.CFrame = pos
3525 local rngm = Instance.new("SpecialMesh", rng)
3526 rngm.MeshType = "Brick"
3527rngm.Scale = scale
3528local scaler2 = 1
3529local scaler2b = 1
3530local scaler2c = 1
3531if type == "Add" then
3532scaler2 = 1*value
3533scaler2b = 1*value2
3534scaler2c = 1*value3
3535elseif type == "Divide" then
3536scaler2 = 1/value
3537scaler2b = 1/value2
3538scaler2c = 1/value3
3539end
3540coroutine.resume(coroutine.create(function()
3541for i = 0,10/bonuspeed,aaa do
3542swait()
3543if type == "Add" then
3544scaler2 = scaler2 - 0.01*value/bonuspeed
3545scaler2b = scaler2b - 0.01*value/bonuspeed
3546scaler2c = scaler2c - 0.01*value/bonuspeed
3547elseif type == "Divide" then
3548scaler2 = scaler2 - 0.01/value*bonuspeed
3549scaler2b = scaler2b - 0.01/value*bonuspeed
3550scaler2c = scaler2c - 0.01/value*bonuspeed
3551end
3552rng.CFrame = rng.CFrame*CFrame.Angles(math.rad(math.random(-360,360)),math.rad(math.random(-360,360)),math.rad(math.random(-360,360)))
3553rng.Transparency = rng.Transparency + 0.01*bonuspeed
3554rngm.Scale = rngm.Scale + Vector3.new(scaler2*bonuspeed, scaler2b*bonuspeed, scaler2c*bonuspeed)
3555end
3556rng:Destroy()
3557end))
3558end
3559
3560function sphereMK(bonuspeed,FastSpeed,type,pos,x1,y1,z1,value,color,outerpos)
3561local type = type
3562local rng = Instance.new("Part", char)
3563 rng.Anchored = true
3564 rng.BrickColor = color
3565 rng.CanCollide = false
3566 rng.FormFactor = 3
3567 rng.Name = "Ring"
3568 rng.Material = "Neon"
3569 rng.Size = Vector3.new(1, 1, 1)
3570 rng.Transparency = 0
3571 rng.TopSurface = 0
3572 rng.BottomSurface = 0
3573 rng.CFrame = pos
3574rng.CFrame = rng.CFrame + rng.CFrame.lookVector*outerpos
3575 local rngm = Instance.new("SpecialMesh", rng)
3576 rngm.MeshType = "Sphere"
3577rngm.Scale = vt(x1,y1,z1)
3578if rainbowmode == true then
3579rng.Color = Color3.new(r/255,g/255,b/255)
3580end
3581local scaler2 = 1
3582local speeder = FastSpeed
3583if type == "Add" then
3584scaler2 = 1*value
3585elseif type == "Divide" then
3586scaler2 = 1/value
3587end
3588coroutine.resume(coroutine.create(function()
3589for i = 0,10/bonuspeed,0.1 do
3590swait()
3591if rainbowmode == true then
3592rng.Color = Color3.new(r/255,g/255,b/255)
3593end
3594if type == "Add" then
3595scaler2 = scaler2 - 0.01*value/bonuspeed
3596elseif type == "Divide" then
3597scaler2 = scaler2 - 0.01/value*bonuspeed
3598end
3599if chaosmode == true then
3600rng.BrickColor = BrickColor.random()
3601end
3602speeder = speeder - 0.01*FastSpeed*bonuspeed
3603rng.CFrame = rng.CFrame + rng.CFrame.lookVector*speeder*bonuspeed
3604rng.Transparency = rng.Transparency + 0.01*bonuspeed
3605rngm.Scale = rngm.Scale + Vector3.new(scaler2*bonuspeed, scaler2*bonuspeed, 0)
3606end
3607rng:Destroy()
3608end))
3609end
3610
3611
3612function sphereMKCharge(bonuspeed,FastSpeed,type,pos,x1,y1,z1,value,color,outerpos)
3613local type = type
3614local rng = Instance.new("Part", char)
3615 rng.Anchored = true
3616 rng.BrickColor = color
3617 rng.CanCollide = false
3618 rng.FormFactor = 3
3619 rng.Name = "Ring"
3620 rng.Material = "Neon"
3621 rng.Size = Vector3.new(1, 1, 1)
3622 rng.Transparency = 1
3623 rng.TopSurface = 0
3624 rng.BottomSurface = 0
3625 rng.CFrame = pos
3626rng.CFrame = rng.CFrame + rng.CFrame.lookVector*outerpos
3627 local rngm = Instance.new("SpecialMesh", rng)
3628 rngm.MeshType = "Sphere"
3629rngm.Scale = vt(x1,y1,z1)
3630if rainbowmode == true then
3631rng.Color = Color3.new(r/255,g/255,b/255)
3632end
3633
3634local scaler2 = 1
3635local speeder = FastSpeed
3636if type == "Add" then
3637scaler2 = 1*value
3638elseif type == "Divide" then
3639scaler2 = 1/value
3640end
3641coroutine.resume(coroutine.create(function()
3642for i = 0,10/bonuspeed,0.1 do
3643swait()
3644if rainbowmode == true then
3645rng.Color = Color3.new(r/255,g/255,b/255)
3646end
3647if type == "Add" then
3648scaler2 = scaler2 - 0.01*value/bonuspeed
3649elseif type == "Divide" then
3650scaler2 = scaler2 - 0.01/value*bonuspeed
3651end
3652if chaosmode == true then
3653rng.BrickColor = BrickColor.random()
3654end
3655speeder = speeder - 0.01*FastSpeed*bonuspeed
3656rng.CFrame = rng.CFrame + rng.CFrame.lookVector*speeder*bonuspeed
3657rng.Transparency = rng.Transparency - 0.01*bonuspeed
3658rngm.Scale = rngm.Scale + Vector3.new(scaler2*bonuspeed, scaler2*bonuspeed, 0)
3659end
3660rng:Destroy()
3661end))
3662end
3663
3664function dmg(dude)
3665if dude.Name ~= Character then
3666local keptcolor = MAINRUINCOLOR
3667local bgf = Instance.new("BodyGyro",dude.Head)
3668bgf.CFrame = bgf.CFrame * CFrame.fromEulerAnglesXYZ(math.rad(-90),0,0)
3669--[[local val = Instance.new("BoolValue",dude)
3670val.Name = "IsHit"]]--
3671local ds = coroutine.wrap(function()
3672dude:WaitForChild("Head"):BreakJoints()
3673for i, v in pairs(dude:GetChildren()) do
3674if v:IsA("Part") or v:IsA("BasePart") then
3675v.Name = "DEMINISHED"
3676end
3677end
3678wait(0.5)
3679targetted = nil
3680CFuncs["Sound"].Create("rbxassetid://62339698", char, 0.75, 0.285)
3681coroutine.resume(coroutine.create(function()
3682for i, v in pairs(dude:GetChildren()) do
3683if v:IsA("Accessory") then
3684v:Destroy()
3685end
3686if v:IsA("Humanoid") then
3687v:Destroy()
3688end
3689if v:IsA("CharacterMesh") then
3690v:Destroy()
3691end
3692if v:IsA("Model") then
3693v:Destroy()
3694end
3695if v:IsA("Part") or v:IsA("BasePart") then
3696for x, o in pairs(v:GetChildren()) do
3697if o:IsA("Decal") then
3698o:Destroy()
3699end
3700end
3701coroutine.resume(coroutine.create(function()
3702v.Material = "Neon"
3703v.CanCollide = false
3704v.Anchored = false
3705local bld = Instance.new("ParticleEmitter",v)
3706bld.LightEmission = 0.75
3707bld.Texture = "rbxassetid://363275192" ---284205403
3708bld.Color = ColorSequence.new(keptcolor.Color)
3709bld.Rate = 500
3710bld.Lifetime = NumberRange.new(1)
3711bld.Size = NumberSequence.new({NumberSequenceKeypoint.new(0,2,0),NumberSequenceKeypoint.new(0.8,2.25,0),NumberSequenceKeypoint.new(1,0,0)})
3712bld.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0,0.5,0),NumberSequenceKeypoint.new(0.8,0.75,0),NumberSequenceKeypoint.new(1,1,0)})
3713bld.Speed = NumberRange.new(2,5)
3714bld.VelocitySpread = 50000
3715bld.Rotation = NumberRange.new(-500,500)
3716bld.RotSpeed = NumberRange.new(-500,500)
3717 local sbs = Instance.new("BodyPosition", v)
3718 sbs.P = 3000
3719 sbs.D = 1000
3720 sbs.maxForce = Vector3.new(50000000000, 50000000000, 50000000000)
3721 sbs.position = v.Position + Vector3.new(math.random(-2,2),10 + math.random(-2,2),math.random(-2,2))
3722v.Color = keptcolor.Color
3723coroutine.resume(coroutine.create(function()
3724for i = 0, 49 do
3725swait(1)
3726v:BreakJoints()
3727v.Transparency = v.Transparency + 0.02
3728end
3729v:BreakJoints()
3730sphere2(1,"Add",v.CFrame,vt(0,0,0),0.1,0.1,0.1,keptcolor)
3731CFuncs["Sound"].Create("rbxassetid://1192402877", v, 0.5, 0.75)
3732bld.Speed = NumberRange.new(10,25)
3733bld.Drag = 5
3734bld.Acceleration = vt(0,2,0)
3735wait(0.5)
3736bld.Enabled = false
3737wait(8)
3738v:Destroy()
3739dude:Destroy()
3740end))
3741end))
3742end
3743end
3744end))
3745end)
3746ds()
3747end
3748end
3749
3750
3751function FindNearestHead(Position, Distance, SinglePlayer)
3752 if SinglePlayer then
3753 return (SinglePlayer.Torso.CFrame.p - Position).magnitude < Distance
3754 end
3755 local List = {}
3756 for i, v in pairs(workspace:GetChildren()) do
3757 if v:IsA("Model") then
3758 if v:findFirstChild("Head") then
3759 if v ~= Character then
3760 if (v.Head.Position - Position).magnitude <= Distance then
3761 table.insert(List, v)
3762 end
3763 end
3764 end
3765 end
3766 end
3767 return List
3768end
3769
3770function FaceMouse()
3771 Cam = workspace.CurrentCamera
3772 return {
3773 CFrame.new(char.Torso.Position, Vector3.new(mouse.Hit.p.x, char.Torso.Position.y, mouse.Hit.p.z)),
3774 Vector3.new(mouse.Hit.p.x, mouse.Hit.p.y, mouse.Hit.p.z)
3775 }
3776end
3777
3778function FaceMouse2()
3779 Cam = workspace.CurrentCamera
3780 return {
3781 CFrame.new(char.Torso.Position, Vector3.new(mouse.Hit.p.x, mouse.Hit.p.y, mouse.Hit.p.z)),
3782 Vector3.new(mouse.Hit.p.x, mouse.Hit.p.y, mouse.Hit.p.z)
3783 }
3784end
3785
3786
3787-- Functions are ready.
3788local storehumanoidWS = 16
3789
3790function createBGCircle(size,parent,color)
3791local bgui = Instance.new("BillboardGui",parent)
3792bgui.Size = UDim2.new(size, 0, size, 0)
3793local imgc = Instance.new("ImageLabel",bgui)
3794imgc.BackgroundTransparency = 1
3795imgc.ImageTransparency = 0
3796imgc.Size = UDim2.new(1,0,1,0)
3797imgc.Image = "rbxassetid://997291547" --997291547,521073910
3798imgc.ImageColor3 = color
3799return bgui,imgc
3800end
3801
3802function symbolizeBlink(guipar,size,img,color,bonussize,vol,pit,soundid,spar,rotationenabled,rotsp,delay)
3803local bgui,imgc = createBGCircle(size,guipar,color)
3804bgui.AlwaysOnTop = true
3805imgc.Image = "rbxassetid://" ..img
3806local rrot = math.random(1,2)
3807CFuncs["Sound"].Create("rbxassetid://" ..soundid, spar, vol,pit)
3808coroutine.resume(coroutine.create(function()
3809for i = 0, 24*delay do
3810swait()
3811if rotationenabled == true then
3812if rrot == 1 then
3813imgc.Rotation = imgc.Rotation + rotsp
3814elseif rrot == 2 then
3815imgc.Rotation = imgc.Rotation - rotsp
3816end
3817end
3818bgui.Size = bgui.Size + UDim2.new(1*bonussize/delay,0,1*bonussize/delay,0)
3819imgc.ImageTransparency = imgc.ImageTransparency + 0.04/delay
3820end
3821bgui:Destroy()
3822end))
3823end
3824
3825
3826
3827function RecolorThing(one,two,three,four,five,exonetran,exone,extwotran,extwo,secondaryenabled,sectrailenabled,mainenabled)
3828for i, v in pairs(mwY:GetChildren()) do
3829if v:IsA("Part") then
3830v.Color = (typeof(one) == 'Color3' and one or one.Color)
3831v.Material = "Neon"
3832end
3833end
3834for i, v in pairs(mw2:GetDescendants()) do
3835if v:IsA("Part") or v:IsA("BasePart") then
3836v.Color = (typeof(one) == 'Color3' and one or one.Color)
3837v.Material = "Neon"
3838if mainenabled == true then
3839v.Transparency = 0
3840elseif mainenabled == false then
3841v.Transparency = 1
3842end
3843elseif v:IsA("Trail") or v:IsA("ParticleEmitter") then
3844v.Color = ColorSequence.new((typeof(one) == 'Color3' and one or one.Color))
3845if mainenabled == true then
3846v.Enabled = true
3847elseif mainenabled == false then
3848v.Enabled = false
3849end
3850end
3851end
3852for i, v in pairs(mw1:GetDescendants()) do
3853if v:IsA("Part") or v:IsA("BasePart") then
3854v.Color = (typeof(two) == 'Color3' and two or two.Color)
3855v.Material = "Neon"
3856if secondaryenabled == true then
3857v.Transparency = 0
3858elseif secondaryenabled == false then
3859v.Transparency = 1
3860end
3861elseif v:IsA("Trail") or v:IsA("ParticleEmitter") then
3862v.Color = ColorSequence.new((typeof(two) == 'Color3' and two or two.Color))
3863if secondaryenabled == true then
3864v.Enabled = true
3865elseif secondaryenabled == false then
3866v.Enabled = false
3867end
3868end
3869end
3870CFuncs["EchoSound"].Create("rbxassetid://847061203", root, 1, 1,0,10,0.25,0.25,1)
3871symbolizeBlink(root,0,2092248396,(typeof(one) == 'Color3' and one or one.Color),5,3,1,847061203,root,true,10,1)
3872symbolizeBlink(root,0,2092248396,(typeof(one) == 'Color3' and one or one.Color),4,0,0,0,root,true,-5,1)
3873refec.Color = ColorSequence.new(MAINRUINCOLOR.Color)
3874for i, v in pairs(m:GetChildren()) do
3875if v:IsA("Part") then
3876v.BrickColor = three
3877v.Material = "Ice"
3878end
3879end
3880for i, v in pairs(m2:GetChildren()) do
3881if v:IsA("Part") then
3882v.BrickColor = four
3883v.Material = "Ice"
3884end
3885end
3886for i, v in pairs(m3:GetChildren()) do
3887if v:IsA("Part") then
3888v.BrickColor = five
3889v.Material = "Neon"
3890end
3891end
3892for i, v in pairs(extrawingmod1:GetChildren()) do
3893if v:IsA("Part") then
3894v.Transparency = exonetran
3895v.BrickColor = exone
3896v.Material = "Neon"
3897end
3898end
3899if sectrailenabled == true then
3900tl4.Enabled = true
3901tl5.Enabled = true
3902tl6.Enabled = true
3903tr4.Enabled = true
3904tr5.Enabled = true
3905tr6.Enabled = true
3906tl4.Color = ColorSequence.new(exone.Color)
3907tl5.Color = ColorSequence.new(exone.Color)
3908tl6.Color = ColorSequence.new(exone.Color)
3909tr4.Color = ColorSequence.new(extwo.Color)
3910tr5.Color = ColorSequence.new(extwo.Color)
3911tr6.Color = ColorSequence.new(extwo.Color)
3912elseif sectrailenabled == false then
3913tl4.Enabled = false
3914tl5.Enabled = false
3915tl6.Enabled = false
3916tr4.Enabled = false
3917tr5.Enabled = false
3918tr6.Enabled = false
3919end
3920for i, v in pairs(extrawingmod2:GetChildren()) do
3921if v:IsA("Part") then
3922v.Transparency = extwotran
3923v.BrickColor = extwo
3924v.Material = "Neon"
3925end
3926end
3927end
3928
3929function attacktwo()
3930 attack = true
3931hum.WalkSpeed = 2
3932local keptcolor = MAINRUINCOLOR
3933CFuncs["Sound"].Create("rbxassetid://847061203", root, 2, 1)
3934sphere2(5,"Add",rarm.CFrame*CFrame.new(0,-2,0)*CFrame.Angles(math.rad(90),0,0),vt(1,1,1),0.1,0.1,0.1,keptcolor,keptcolor.Color)
3935sphere2(5,"Add",rarm.CFrame*CFrame.new(0,-2,0)*CFrame.Angles(math.rad(90),0,0),vt(1,1,1),0.2,0.2,0.2,keptcolor,keptcolor.Color)
3936for i = 0, 14 do
3937PixelBlock(1,math.random(1,3),"Add",rarm.CFrame*CFrame.Angles(math.rad(math.random(-360,360)),math.rad(math.random(-360,360)),math.rad(math.random(-360,360))),1,1,1,0.02,SECONDRUINCOLOR,0)
3938end
3939for i = 0,1,0.1 do
3940swait()
3941sphere2(8,"Add",larm.CFrame*CFrame.new(0,-2,0)*CFrame.Angles(math.rad(90),0,0),vt(2.25,0.1,2.25),0.01,0.01,0.01,keptcolor,keptcolor.Color)
3942RH.C0=clerp(RH.C0,cf(1,-1,0)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(-2.5),math.rad(0),math.rad(-5)),.3)
3943LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(-2.5),math.rad(30),math.rad(0)),.3)
3944RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,0)*angles(math.rad(0),math.rad(0),math.rad(60)),.3)
3945Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(20),math.rad(0),math.rad(-30)),.3)
3946RW.C0=clerp(RW.C0,cf(1.15,0.5,-0.5)*angles(math.rad(90),math.rad(0),math.rad(-60)),.3)
3947LW.C0=clerp(LW.C0,cf(-1.15,0.5,0)*angles(math.rad(-20),math.rad(0),math.rad(-10)),.3)
3948end
3949for i = 0, 1 do
3950CFuncs["Sound"].Create("rbxassetid://763755889", root, 3,1.1)
3951for i = 0,1,0.6 do
3952swait()
3953sphere2(8,"Add",rarm.CFrame*CFrame.new(0,-2,0)*CFrame.Angles(math.rad(90),0,0),vt(2.25,0.1,2.25),0.01,0.01,0.01,keptcolor,keptcolor.Color)
3954slash(math.random(15,30)/10,5,true,"Round","Add","Out",root.CFrame*CFrame.Angles(math.rad(math.random(-5,5)),math.rad(math.random(-5,5)),math.rad(math.random(-5,5))),vt(0.05,0.01,0.05),math.random(25,75)/250,BrickColor.new("White"))
3955RH.C0=clerp(RH.C0,cf(1,-1,0)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(-2.5),math.rad(0),math.rad(-5)),.6)
3956LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(-2.5),math.rad(30),math.rad(0)),.6)
3957RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,0)*angles(math.rad(0),math.rad(0),math.rad(0)),.6)
3958Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(20),math.rad(0),math.rad(-30)),.6)
3959RW.C0=clerp(RW.C0,cf(1.15,0.5,-0.5)*angles(math.rad(90),math.rad(0),math.rad(-60)),.6)
3960LW.C0=clerp(LW.C0,cf(-1.15,0.5,0)*angles(math.rad(-20),math.rad(0),math.rad(-10)),.6)
3961end
3962for i = 0,1,0.6 do
3963swait()
3964sphere2(8,"Add",rarm.CFrame*CFrame.new(0,-2,0)*CFrame.Angles(math.rad(90),0,0),vt(2.25,0.1,2.25),0.01,0.01,0.01,keptcolor,keptcolor.Color)
3965slash(math.random(15,30)/10,5,true,"Round","Add","Out",root.CFrame*CFrame.Angles(math.rad(math.random(-5,5)),math.rad(math.random(-5,5)),math.rad(math.random(-5,5))),vt(0.05,0.01,0.05),math.random(25,75)/250,BrickColor.new("White"))
3966RH.C0=clerp(RH.C0,cf(1,-1,0)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(-2.5),math.rad(0),math.rad(-5)),.6)
3967LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(-2.5),math.rad(30),math.rad(0)),.6)
3968RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,0)*angles(math.rad(0),math.rad(0),math.rad(-90)),.6)
3969Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(20),math.rad(0),math.rad(-30)),.6)
3970RW.C0=clerp(RW.C0,cf(1.15,0.5,-0.5)*angles(math.rad(90),math.rad(0),math.rad(-60)),.6)
3971LW.C0=clerp(LW.C0,cf(-1.15,0.5,0)*angles(math.rad(-20),math.rad(0),math.rad(-10)),.6)
3972end
3973for i = 0,1,0.6 do
3974swait()
3975sphere2(8,"Add",rarm.CFrame*CFrame.new(0,-2,0)*CFrame.Angles(math.rad(90),0,0),vt(2.25,0.1,2.25),0.01,0.01,0.01,keptcolor,keptcolor.Color)
3976slash(math.random(15,30)/10,5,true,"Round","Add","Out",root.CFrame*CFrame.Angles(math.rad(math.random(-5,5)),math.rad(math.random(-5,5)),math.rad(math.random(-5,5))),vt(0.05,0.01,0.05),math.random(25,75)/250,BrickColor.new("White"))
3977RH.C0=clerp(RH.C0,cf(1,-1,0)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(-2.5),math.rad(0),math.rad(-5)),.6)
3978LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(-2.5),math.rad(30),math.rad(0)),.6)
3979RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,0)*angles(math.rad(0),math.rad(0),math.rad(-180)),.6)
3980Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(20),math.rad(0),math.rad(-30)),.6)
3981RW.C0=clerp(RW.C0,cf(1.15,0.5,-0.5)*angles(math.rad(90),math.rad(0),math.rad(-60)),.6)
3982LW.C0=clerp(LW.C0,cf(-1.15,0.5,0)*angles(math.rad(-20),math.rad(0),math.rad(-10)),.6)
3983end
3984for i = 0,1,0.6 do
3985swait()
3986sphere2(8,"Add",rarm.CFrame*CFrame.new(0,-2,0)*CFrame.Angles(math.rad(90),0,0),vt(2.25,0.1,2.25),0.01,0.01,0.01,keptcolor,keptcolor.Color)
3987slash(math.random(15,30)/10,5,true,"Round","Add","Out",root.CFrame*CFrame.Angles(math.rad(math.random(-5,5)),math.rad(math.random(-5,5)),math.rad(math.random(-5,5))),vt(0.05,0.01,0.05),math.random(25,75)/250,BrickColor.new("White"))
3988RH.C0=clerp(RH.C0,cf(1,-1,0)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(-2.5),math.rad(0),math.rad(-5)),.6)
3989LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(-2.5),math.rad(30),math.rad(0)),.6)
3990RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,0)*angles(math.rad(0),math.rad(0),math.rad(-270)),.6)
3991Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(20),math.rad(0),math.rad(-30)),.6)
3992RW.C0=clerp(RW.C0,cf(1.15,0.5,-0.5)*angles(math.rad(90),math.rad(0),math.rad(-60)),.6)
3993LW.C0=clerp(LW.C0,cf(-1.15,0.5,0)*angles(math.rad(-20),math.rad(0),math.rad(-10)),.6)
3994end
3995local rot = 0
3996local dis = CreateParta(char,0.5,1,"Neon",keptcolor)
3997CFuncs["EchoSound"].Create("rbxassetid://763718160", dis, 3, 1.1,0,10,0.15,0.5,1)
3998dis.CFrame = root.CFrame*CFrame.new(0,2,-3)
3999CreateMesh(dis,"Sphere",10,1,10)
4000local at1 = Instance.new("Attachment",dis)
4001at1.Position = vt(-5,0,0)
4002local at2 = Instance.new("Attachment",dis)
4003at2.Position = vt(5,0,0)
4004local trl = Instance.new('Trail',wed)
4005trl.Attachment0 = at1
4006trl.Attachment1 = at2
4007trl.Texture = "rbxassetid://1049219073"
4008trl.LightEmission = 1
4009trl.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0, 0),NumberSequenceKeypoint.new(1, 1)})
4010trl.Color = ColorSequence.new(dis.Color)
4011trl.Lifetime = 0.6
4012local a = Instance.new("Part",workspace)
4013 a.Name = "Direction"
4014 a.Anchored = true
4015 a.BrickColor = bc("Bright red")
4016a.Material = "Neon"
4017a.Transparency = 1
4018 a.CanCollide = false
4019 local ray = Ray.new(
4020 dis.CFrame.p, -- origin
4021 (mouse.Hit.p - dis.CFrame.p).unit * 500 -- direction
4022 )
4023 local ignore = dis
4024 local hit, position, normal = workspace:FindPartOnRay(ray, ignore)
4025 a.BottomSurface = 10
4026 a.TopSurface = 10
4027 local distance = (dis.CFrame.p - position).magnitude
4028 a.Size = Vector3.new(0.1, 0.1, 0.1)
4029 a.CFrame = CFrame.new(dis.CFrame.p, position) * CFrame.new(0, 0, 0)
4030dis.CFrame = a.CFrame
4031dis.CFrame = dis.CFrame*CFrame.Angles(0,math.rad(rot),0)
4032a:Destroy()
4033local bv = Instance.new("BodyVelocity")
4034bv.maxForce = Vector3.new(1e9, 1e9, 1e9)
4035bv.velocity = dis.CFrame.lookVector*250
4036bv.Parent = dis
4037game:GetService("Debris"):AddItem(dis, 5)
4038local hitted = false
4039coroutine.resume(coroutine.create(function()
4040dis.Touched:connect(function(hit)
4041 if hitted == false and hit.Parent ~= char then
4042 hitted = true
4043 CFuncs["EchoSound"].Create("rbxassetid://782200047", dis, 7, 1.1,0,10,0.15,0.5,1)
4044CamShakeAll({
4045 Duration=0.4; -- Lasts for .1 seconds
4046 Intensity=3; -- Intensity of 5
4047 Position=Vector3.new(2,2,2); -- What axises the shake effects and how much (position)
4048 Rotation=Vector3.new(2,2,6); -- What axises the shake effects and how much (rotation)
4049 DropDist=60; -- Camera dist from origin when the shake starts to gradually get weaker
4050 IneffectiveDist=80; -- Camera dist from origin when the shake goes away
4051 Origin=dis.Position; -- Where the shake is coming from (Part, CFrame, or Vector3)
4052})
4053 MagniDamage(dis, 30, 13,36, 0, "Normal")
4054 sphere2(8,"Add",dis.CFrame,vt(10,1,10),1,0.1,1,keptcolor,keptcolor.Color)
4055 sphere2(4,"Add",dis.CFrame,vt(1,1,1),0.5,0.5,0.5,SECONDRUINCOLOR,SECONDRUINCOLOR.Color)
4056 sphere2(3,"Add",dis.CFrame,vt(1,1,1),0.5,0.5,0.5,SECONDRUINCOLOR,SECONDRUINCOLOR.Color)
4057local eff = Instance.new("ParticleEmitter",dis)
4058eff.Texture = "rbxassetid://2344870656"
4059eff.LightEmission = 1
4060eff.Color = ColorSequence.new(dis.Color)
4061eff.Rate = 10000000
4062eff.Enabled = true
4063eff.EmissionDirection = "Front"
4064eff.Lifetime = NumberRange.new(1)
4065eff.Size = NumberSequence.new({NumberSequenceKeypoint.new(0,75,0),NumberSequenceKeypoint.new(0.1,20,0),NumberSequenceKeypoint.new(0.8,40,0),NumberSequenceKeypoint.new(1,60,0)})
4066eff.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0,0.8,0),NumberSequenceKeypoint.new(0.5,0,0),NumberSequenceKeypoint.new(1,1,0)})
4067eff.Speed = NumberRange.new(150)
4068eff.Drag = 5
4069eff.Rotation = NumberRange.new(-500,500)
4070eff.SpreadAngle = Vector2.new(0,900)
4071eff.RotSpeed = NumberRange.new(-500,500)
4072delay(0.2, function() eff.Enabled = false end)
4073 coroutine.resume(coroutine.create(function()
4074 for i = 0, 9 do
4075local disr = CreateParta(char,1,1,"Neon",keptcolor)
4076disr.CFrame = dis.CFrame*CFrame.Angles(math.rad(math.random(-360,360)),math.rad(math.random(-360,360)),math.rad(math.random(-360,360)))
4077local at1 = Instance.new("Attachment",disr)
4078at1.Position = vt(-5,0,0)
4079local at2 = Instance.new("Attachment",disr)
4080at2.Position = vt(5,0,0)
4081local trl = Instance.new('Trail',disr)
4082trl.Attachment0 = at1
4083trl.FaceCamera = true
4084trl.Attachment1 = at2
4085trl.Texture = "rbxassetid://2342682798"
4086trl.LightEmission = 1
4087trl.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0, 0),NumberSequenceKeypoint.new(1, 1)})
4088trl.Color = ColorSequence.new(SECONDRUINCOLOR.Color)
4089trl.Lifetime = 0.5
4090local bv = Instance.new("BodyVelocity")
4091bv.maxForce = Vector3.new(1e9, 1e9, 1e9)
4092bv.velocity = disr.CFrame.lookVector*math.random(50,200)
4093bv.Parent = disr
4094local val = 0
4095coroutine.resume(coroutine.create(function()
4096 swait(30)
4097 for i = 0, 9 do
4098 swait()
4099 val = val + 0.1
4100 trl.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0, val),NumberSequenceKeypoint.new(1, 1)})
4101 end
4102game:GetService("Debris"):AddItem(disr, 3)
4103end))
4104end
4105local eff = Instance.new("ParticleEmitter",dis)
4106eff.Texture = "rbxassetid://2273224484"
4107eff.LightEmission = 1
4108eff.Color = ColorSequence.new(keptcolor.Color)
4109eff.Rate = 500000
4110eff.Lifetime = NumberRange.new(0.5,2)
4111eff.Size = NumberSequence.new({NumberSequenceKeypoint.new(0,20,0),NumberSequenceKeypoint.new(0.2,2,0),NumberSequenceKeypoint.new(0.8,2,0),NumberSequenceKeypoint.new(1,0,0)})
4112eff.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0,1,0),NumberSequenceKeypoint.new(0.1,0,0),NumberSequenceKeypoint.new(0.8,0,0),NumberSequenceKeypoint.new(1,1,0)})
4113eff.Speed = NumberRange.new(20,250)
4114eff.Drag = 5
4115eff.Rotation = NumberRange.new(-500,500)
4116eff.VelocitySpread = 9000
4117eff.RotSpeed = NumberRange.new(-50,50)
4118wait(0.25)
4119eff.Enabled = false
4120end))
4121 for i = 0, 9 do
4122 slash(math.random(10,20)/10,5,true,"Round","Add","Out",dis.CFrame*CFrame.Angles(math.rad(math.random(-5,5)),math.rad(math.random(-5,5)),math.rad(math.random(-5,5))),vt(0.01,0.01,0.01),math.random(100,200)/250,SECONDRUINCOLOR)
4123 end
4124for i = 0, 19 do
4125PixelBlock(1,math.random(5,20),"Add",dis.CFrame*CFrame.Angles(math.rad(math.random(-360,360)),math.rad(math.random(-360,360)),math.rad(math.random(-360,360))),4,4,4,0.08,keptcolor,0)
4126end
4127dis.Anchored = true
4128dis.Transparency = 1
4129wait(8)
4130dis:Destroy()
4131end
4132end)
4133end))
4134rot = rot - 15
4135end
4136for i = 0,2,0.1 do
4137swait()
4138RH.C0=clerp(RH.C0,cf(1,-1,0)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(-2.5),math.rad(-30),math.rad(0)),.3)
4139LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(-2.5),math.rad(0),math.rad(5)),.3)
4140RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,0)*angles(math.rad(0),math.rad(0),math.rad(-60)),.3)
4141Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(10),math.rad(0),math.rad(50)),.3)
4142RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*angles(math.rad(90),math.rad(0),math.rad(60)),.3)
4143LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*angles(math.rad(-20),math.rad(0),math.rad(-10)),.3)
4144end
4145attack = false
4146hum.WalkSpeed = storehumanoidWS
4147end
4148
4149function attackone()
4150 attack = true
4151symbolizeBlink(sorb,0,2109052855,MAINRUINCOLOR.Color,1.5,5,0.9,1614005837,sorb,true,10,1)
4152symbolizeBlink(sorb,0,2109052855,SECONDRUINCOLOR.Color,1.6,5,1,1923591005,sorb,true,10,1)
4153symbolizeBlink(sorb,0,2092248396,MAINRUINCOLOR.Color,3,0,0,0,sorb,true,10,1.25)
4154symbolizeBlink(sorb,0,2344870656,SECONDRUINCOLOR.Color,10,0,0,0,sorb,true,10,1.5)
4155 for i = 0,1,0.1 do
4156 swait()
4157 RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0)* angles(math.rad(0),math.rad(-10),math.rad(-20)),0.3)
4158Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(20),math.rad(10),math.rad(20)),.3)
4159RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(30), math.rad(0), math.rad(30)), 0.3)
4160LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(10), math.rad(0), math.rad(-20)), 0.3)
4161RH.C0=clerp(RH.C0,cf(1,-1 - 0.05 * math.cos(sine / 25),0)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(-15),math.rad(0),math.rad(0)),.3)
4162LH.C0=clerp(LH.C0,cf(-1,-1 - 0.05 * math.cos(sine / 25),0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(2.5),math.rad(0),math.rad(0)),.3)
4163 end
4164coroutine.resume(coroutine.create(function()
4165local hite = Instance.new("Part", char)
4166 hite.Anchored = true
4167 hite.CanCollide = false
4168 hite.FormFactor = 3
4169 hite.Name = "Ring"
4170 hite.Material = "Neon"
4171 hite.Size = Vector3.new(1, 1, 1)
4172 hite.Transparency = 1
4173 hite.TopSurface = 0
4174 hite.BottomSurface = 0
4175local eff = Instance.new("ParticleEmitter",hite)
4176eff.Texture = "rbxassetid://2273224484"
4177eff.LightEmission = 1
4178eff.Color = ColorSequence.new(MAINRUINCOLOR.Color)
4179eff.Rate = 90000000
4180eff.Lifetime = NumberRange.new(0.5,2)
4181eff.Size = NumberSequence.new({NumberSequenceKeypoint.new(0,20,0),NumberSequenceKeypoint.new(0.2,2,0),NumberSequenceKeypoint.new(0.8,2,0),NumberSequenceKeypoint.new(1,0,0)})
4182eff.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0,1,0),NumberSequenceKeypoint.new(0.1,0,0),NumberSequenceKeypoint.new(0.8,0,0),NumberSequenceKeypoint.new(1,1,0)})
4183eff.Speed = NumberRange.new(20,90)
4184eff.Drag = 5
4185eff.Rotation = NumberRange.new(-500,500)
4186eff.VelocitySpread = 9000
4187eff.RotSpeed = NumberRange.new(-50,50)
4188local distlook = 12.5
4189for i = 0, 4 do
4190swait(4)
4191hite.CFrame = root.CFrame + root.CFrame.lookVector*distlook
4192sphere(3,"Add",hite.CFrame,vt(0,0,0),0.15,SECONDRUINCOLOR)
4193sphere(3,"Add",hite.CFrame,vt(0,0,0),0.3,MAINRUINCOLOR)
4194CamShakeAll({
4195 Duration=0.25; -- Lasts for .1 seconds
4196 Intensity=1.75; -- Intensity of 5
4197 Position=Vector3.new(2,2,2); -- What axises the shake effects and how much (position)
4198 Rotation=Vector3.new(2,2,6); -- What axises the shake effects and how much (rotation)
4199 DropDist=35; -- Camera dist from origin when the shake starts to gradually get weaker
4200 IneffectiveDist=65; -- Camera dist from origin when the shake goes away
4201 Origin=hite.Position; -- Where the shake is coming from (Part, CFrame, or Vector3)
4202})
4203MagniDamage(hite, 11.5, 10,25, 0, "Normal")
4204for i = 0, 21 do
4205sphereMK(3,0.2,"Add",hite.CFrame*CFrame.Angles(math.rad(math.random(-360,360)),math.rad(math.random(-360,360)),math.rad(math.random(-360,360))),0.5,0.5,5,-0.005,MAINRUINCOLOR,0)
4206sphereMK(6,0.35,"Add",hite.CFrame*CFrame.Angles(math.rad(math.random(-360,360)),math.rad(math.random(-360,360)),math.rad(math.random(-360,360))),0.5,0.5,5,-0.005,SECONDRUINCOLOR,0)
4207end
4208CFuncs["Sound"].Create("rbxassetid://183763506", hite, 3, 1)
4209CFuncs["Sound"].Create("rbxassetid://178452221", hite, 1, 0.6)
4210game:GetService("Debris"):AddItem(hite, 5)
4211distlook = distlook + 15
4212end
4213wait(0.5)
4214eff.Enabled = false
4215wait(3.1)
4216eff:Destroy()
4217end))
4218 for i = 0,2,0.1 do
4219 swait()
4220 RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0)* angles(math.rad(0),math.rad(5),math.rad(90)),0.5)
4221Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(5),math.rad(0),math.rad(-90)),.5)
4222RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(0), math.rad(0), math.rad(120)), 0.5)
4223LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(10), math.rad(0), math.rad(-20)), 0.5)
4224RH.C0=clerp(RH.C0,cf(1,-1 - 0.05 * math.cos(sine / 25),0)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(-0.5),math.rad(0),math.rad(-10)),.5)
4225LH.C0=clerp(LH.C0,cf(-1,-1 - 0.05 * math.cos(sine / 25),0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(-2.5),math.rad(0),math.rad(-10)),.5)
4226 end
4227 attack = false
4228end
4229
4230function attackthree()
4231 attack = true
4232 hum.WalkSpeed = 5
4233 CFuncs["Sound"].Create("rbxassetid://136007472", root, 5, 1.5)
4234for i = 0,3.5,0.1 do
4235swait()
4236sphereMK(2.5,-4.5,"Add",root.CFrame*CFrame.Angles(math.rad(math.random(-360,360)),math.rad(math.random(-360,360)),math.rad(math.random(-360,360))),3.5,3.5,45,-0.035,SECONDRUINCOLOR,200)
4237slash(math.random(30,60)/10,5,true,"Round","Add","In",root.CFrame*CFrame.Angles(math.rad(math.random(-360,360)),math.rad(math.random(-360,360)),math.rad(math.random(-360,360))),vt(0.5,0.01,0.5),-0.5,MAINRUINCOLOR)
4238RH.C0=clerp(RH.C0,cf(1,-1 - 0.05 * math.cos(sine / 28),0)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(-2.5),math.rad(0),math.rad(30)),.2)
4239LH.C0=clerp(LH.C0,cf(-1,-1 - 0.05 * math.cos(sine / 28),0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(-2.5),math.rad(0),math.rad(-30)),.2)
4240RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,-0.3,-0.15)*angles(math.rad(30),math.rad(0),math.rad(0)),.2)
4241Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(30),math.rad(0),math.rad(0 - 5 * math.cos(sine / 0.2))),.2)
4242RW.C0=clerp(RW.C0,cf(1.05,0.4,-0.5)*angles(math.rad(140),math.rad(0),math.rad(-50)),.2)
4243LW.C0=clerp(LW.C0,cf(-1.05,0.4,-0.5)*angles(math.rad(140),math.rad(0),math.rad(50)),.2)
4244end
4245for i = 0, 24 do
4246slash(math.random(10,30)/10,5,true,"Round","Add","Out",root.CFrame*CFrame.Angles(math.rad(math.random(-360,360)),math.rad(math.random(-360,360)),math.rad(math.random(-360,360))),vt(0.01,0.01,0.01),math.random(150,350)/250,MAINRUINCOLOR)
4247end
4248CamShakeAll({
4249 Duration=1; -- Lasts for .1 seconds
4250 Intensity=2; -- Intensity of 5
4251 Position=Vector3.new(2,2,2); -- What axises the shake effects and how much (position)
4252 Rotation=Vector3.new(2,2,6); -- What axises the shake effects and how much (rotation)
4253 DropDist=50; -- Camera dist from origin when the shake starts to gradually get weaker
4254 IneffectiveDist=120; -- Camera dist from origin when the shake goes away
4255 Origin=root.Position; -- Where the shake is coming from (Part, CFrame, or Vector3)
4256})
4257MagniDamage(root,50,20,45,0,"Normal")
4258coroutine.resume(coroutine.create(function()
4259for i = 0, 46 do
4260swait()
4261sphere2(2,"Add",tors.CFrame*CFrame.Angles(math.rad(math.random(-360,360)),math.rad(math.random(-360,360)),math.rad(math.random(-360,360))),vt(1,1,1),-0.01,7,-0.01,MAINRUINCOLOR)
4262slash(math.random(10,30)/10,5,true,"Round","Add","Out",root.CFrame*CFrame.Angles(math.rad(math.random(-360,360)),math.rad(math.random(-360,360)),math.rad(math.random(-360,360))),vt(0.01,0.01,0.01),math.random(150,350)/250,SECONDRUINCOLOR)
4263end
4264end))
4265CFuncs["Sound"].Create("rbxassetid://206082327", root, 5,1)
4266CFuncs["Sound"].Create("rbxassetid://847061203", root, 6,1)
4267CFuncs["Sound"].Create("rbxassetid://239000203", root, 5,1)
4268CFuncs["Sound"].Create("rbxassetid://579687077", root, 5,0.75)
4269CFuncs["Sound"].Create("rbxassetid://1368637781", root, 7,1)
4270CFuncs["Sound"].Create("rbxassetid://763718160", root, 4, 1.1)
4271CFuncs["Sound"].Create("rbxassetid://782353443", root, 4.5, 1)
4272for i = 0,3,0.1 do
4273swait()
4274RH.C0=clerp(RH.C0,cf(1,-1 - 0.05 * math.cos(sine / 28),0)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(-2.5),math.rad(0),math.rad(-30)),.5)
4275LH.C0=clerp(LH.C0,cf(-1,-1 - 0.05 * math.cos(sine / 28),0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(-2.5),math.rad(0),math.rad(30)),.5)
4276RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0.3,-0.15)*angles(math.rad(-30),math.rad(0),math.rad(0)),.5)
4277Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(-30),math.rad(0),math.rad(0 - 2.5 * math.cos(sine / 0.2))),.5)
4278RW.C0=clerp(RW.C0,cf(1.45,0.4,0)*angles(math.rad(-20),math.rad(0 - 2 * math.cos(sine / 0.2)),math.rad(80 + 2 * math.cos(sine / 0.2))),.5)
4279LW.C0=clerp(LW.C0,cf(-1.45,0.4,0)*angles(math.rad(-20),math.rad(0 + 2 * math.cos(sine / 0.2)),math.rad(-80 - 2 * math.cos(sine / 0.2))),.5)
4280end
4281hum.WalkSpeed = storehumanoidWS
4282 attack = false
4283end
4284
4285local blush = Instance.new("Decal",hed)
4286blush.Texture = "rbxassetid://898404027"
4287blush.Face = "Front"
4288blush.Parent = nil
4289blush.Transparency = 1
4290----------------------------------- Abilities
4291
4292function ExtinctiveHeartbreak()
4293local targetted = nil
4294if mouse.Target.Parent ~= Character and mouse.Target.Parent.Parent ~= Character and mouse.Target.Parent:FindFirstChildOfClass("Humanoid") ~= nil then
4295targetted = mouse.Target.Parent
4296end
4297if targetted ~= nil then
4298attack = true
4299CFuncs["Sound"].Create("rbxassetid://847061203", root, 2.5,1)
4300for i = 0, 9 do
4301sphereMK(3,0.25,"Add",root.CFrame*CFrame.Angles(math.rad(math.random(-360,360)),math.rad(math.random(-360,360)),math.rad(math.random(-360,360))),1,1,10,-0.01,MAINRUINCOLOR,0)
4302end
4303for i = 0, 24 do
4304PixelBlock(1,math.random(4,8),"Add",root.CFrame*CFrame.Angles(math.rad(math.random(-360,360)),math.rad(math.random(-360,360)),math.rad(math.random(-360,360))),3,3,3,0.06,MAINRUINCOLOR,0)
4305end
4306sphere(3,"Add",root.CFrame,vt(0,0,0),0.25,MAINRUINCOLOR)
4307local originalpos = root.CFrame
4308RootPart.CFrame = targetted.Head.CFrame * CFrame.new(0,-2,2)
4309for i = 0, 9 do
4310sphereMK(3,0.25,"Add",root.CFrame*CFrame.Angles(math.rad(math.random(-360,360)),math.rad(math.random(-360,360)),math.rad(math.random(-360,360))),1,1,10,-0.01,MAINRUINCOLOR,0)
4311end
4312for i = 0, 24 do
4313PixelBlock(1,math.random(4,8),"Add",root.CFrame*CFrame.Angles(math.rad(math.random(-360,360)),math.rad(math.random(-360,360)),math.rad(math.random(-360,360))),3,3,3,0.06,MAINRUINCOLOR,0)
4314end
4315hum.WalkSpeed = 0
4316sphere(3,"Add",root.CFrame,vt(0,0,0),0.25,MAINRUINCOLOR)
4317local radm = math.random(1,3)
4318if radm == 1 then
4319bosschatfunc("YOU WONT BE NECCESSARY.",MAINRUINCOLOR.Color,2)
4320elseif radm == 2 then
4321bosschatfunc("YOUR EXISTANCE WILL BE GONE.",MAINRUINCOLOR.Color,2)
4322elseif radm == 3 then
4323bosschatfunc("DIE!",MAINRUINCOLOR.Color,2)
4324end
4325for i = 0,2,0.1 do
4326swait()
4327RH.C0=clerp(RH.C0,cf(1,-1 - 0.05 * math.cos(sine / 28),0)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(-2.5),math.rad(-10),math.rad(0)),.4)
4328LH.C0=clerp(LH.C0,cf(-1,-1 - 0.05 * math.cos(sine / 28),0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(-2.5),math.rad(0),math.rad(0)),.4)
4329RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,0 + 0.05 * math.cos(sine / 28))*angles(math.rad(0),math.rad(0),math.rad(80)),.4)
4330Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(20),math.rad(0),math.rad(10)),.8)
4331RW.C0=clerp(RW.C0,cf(1.5,0.5 + 0.1 * math.cos(sine / 28),0)*angles(math.rad(20),math.rad(0),math.rad(10)),.4)
4332LW.C0=clerp(LW.C0,cf(-1.5,0.5 + 0.1 * math.cos(sine / 28),0)*angles(math.rad(90),math.rad(0),math.rad(60)),.4)
4333end
4334CFuncs["Sound"].Create("rbxassetid://153092227", root, 5,1)
4335CFuncs["EchoSound"].Create("rbxassetid://153092227", root, 10, 1,0,10,0.25,0.5,1)
4336for i = 0,2,0.1 do
4337swait()
4338coroutine.resume(coroutine.create(function()
4339targetted.Head.CFrame = larm.CFrame*CFrame.new(0,-1,0)*CFrame.Angles(math.rad(-90),0,0)
4340for i,v in pairs(targetted:GetChildren()) do
4341if v:IsA("Part") or v:IsA("BasePart") then
4342v.Velocity = vt(0,0,0)
4343end
4344end
4345end))
4346RH.C0=clerp(RH.C0,cf(1,-1 - 0.05 * math.cos(sine / 28),0)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(-2.5),math.rad(0),math.rad(0)),.8)
4347LH.C0=clerp(LH.C0,cf(-1,-1 - 0.05 * math.cos(sine / 28),0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(-2.5),math.rad(10),math.rad(0)),.8)
4348RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0.25,0 + 0.05 * math.cos(sine / 28))*angles(math.rad(0),math.rad(0),math.rad(-80)),.8)
4349Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(20),math.rad(0),math.rad(80)),.8)
4350RW.C0=clerp(RW.C0,cf(1.5,0.5 + 0.1 * math.cos(sine / 28),0)*angles(math.rad(20),math.rad(0),math.rad(10)),.8)
4351LW.C0=clerp(LW.C0,cf(-1.5,0.5 + 0.1 * math.cos(sine / 28),0)*angles(math.rad(90),math.rad(0),math.rad(-80)),.8)
4352end
4353CFuncs["EchoSound"].Create("rbxassetid://824687369", char, 1.5, 1,0,10,0.25,0.5,1)
4354CFuncs["EchoSound"].Create("rbxassetid://153092227", char, 1.5, 0.9,0,10,0.25,0.5,1)
4355for i = 0, 1 do
4356CFuncs["EchoSound"].Create("rbxassetid://1690476035", char, 1.5, 1,0.1,10,0.15,0.5,1)
4357end
4358CFuncs["EchoSound"].Create("rbxassetid://1690476035", root, 10, 1,0.1,10,0.15,0.5,1)
4359chatfunc("RRRRROOAGHH!",Color3.new(1,0,0),"Inverted","Antique",0.75)
4360for i = 0,4,0.1 do
4361swait()
4362coroutine.resume(coroutine.create(function()
4363local dis = CreateParta(char,1,1,"Neon",MAINRUINCOLOR)
4364dis.CFrame = targetted.Head.CFrame*CFrame.new(math.random(-5,5),math.random(-5,5),math.random(-5,5))*CFrame.Angles(math.rad(math.random(-360,360)),math.rad(math.random(-360,360)),math.rad(math.random(-360,360)))
4365local at1 = Instance.new("Attachment",dis)
4366at1.Position = vt(-25000,0,0)
4367local at2 = Instance.new("Attachment",dis)
4368at2.Position = vt(25000,0,0)
4369local trl = Instance.new('Trail',dis)
4370trl.Attachment0 = at1
4371trl.FaceCamera = true
4372trl.Attachment1 = at2
4373trl.Texture = "rbxassetid://1049219073"
4374trl.LightEmission = 1
4375trl.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0, 0),NumberSequenceKeypoint.new(1, 1)})
4376trl.Color = ColorSequence.new(SECONDRUINCOLOR.Color)
4377trl.Lifetime = 5
4378local bv = Instance.new("BodyVelocity")
4379bv.maxForce = Vector3.new(1e9, 1e9, 1e9)
4380bv.velocity = dis.CFrame.lookVector*math.random(500,2500)
4381bv.Parent = dis
4382game:GetService("Debris"):AddItem(dis, 5)
4383targetted.Head.CFrame = larm.CFrame*CFrame.new(0,-1,0)*CFrame.Angles(math.rad(-90),0,0)
4384CFuncs["Sound"].Create("rbxassetid://782353443", targetted.Head, 4,1)
4385CFuncs["Sound"].Create("rbxassetid://824687369", targetted.Head, 6, 1)
4386CFuncs["Sound"].Create("rbxassetid://153092227", targetted.Head,6,math.random(75,150)/150)
4387CFuncs["Sound"].Create("rbxassetid://163680447", targetted.Head, 3,math.random(75,150)/150)
4388CFuncs["Sound"].Create("rbxassetid://782354021", targetted.Head, 2.5,0.75)
4389sphere2(5,"Add",targetted.Head.CFrame*CFrame.Angles(math.rad(math.random(-360,360)),math.rad(math.random(-360,360)),math.rad(math.random(-360,360))),vt(3,3,3),-0.03,15,-0.03,MAINRUINCOLOR)
4390targetted:FindFirstChildOfClass("Humanoid").CameraOffset = vt(math.random(-10,10)/5,math.random(-10,10)/5,math.random(-10,10)/5)
4391for i = 0, 2 do
4392slash(5,5,true,"Round","Add","Out",targetted.Head.CFrame*CFrame.Angles(math.rad(math.random(-360,360)),math.rad(math.random(-360,360)),math.rad(math.random(-360,360))),vt(0.01,0.01,0.01),math.random(50,350)/250,SECONDRUINCOLOR)
4393end
4394symbolizeBlink(targetted.Head,0,2092248396,MAINRUINCOLOR.Color,math.random(3,35),0,0,0,targetted.Head,true,math.random(3,9),0.25)
4395for i,v in pairs(targetted:GetChildren()) do
4396if v:IsA("Part") or v:IsA("BasePart") then
4397v.Velocity = vt(0,0,0)
4398end
4399end
4400end))
4401CamShakeAll({
4402 Duration=.1; -- Lasts for .1 seconds
4403 Intensity=5; -- Intensity of 5
4404 Position=Vector3.new(2,2,2); -- What axises the shake effects and how much (position)
4405 Rotation=Vector3.new(2,2,6); -- What axises the shake effects and how much (rotation)
4406 DropDist=200; -- Camera dist from origin when the shake starts to gradually get weaker
4407 IneffectiveDist=300; -- Camera dist from origin when the shake goes away
4408 Origin=sorb.Position; -- Where the shake is coming from (Part, CFrame, or Vector3)
4409})
4410RH.C0=clerp(RH.C0,cf(1,-1 - 0.05 * math.cos(sine / 28),0)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(-2.5),math.rad(0),math.rad(0)),.8)
4411LH.C0=clerp(LH.C0,cf(-1,-1 - 0.05 * math.cos(sine / 28),0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(-2.5),math.rad(10),math.rad(0)),.8)
4412RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0.25,0 + 0.05 * math.cos(sine / 28))*angles(math.rad(0),math.rad(0),math.rad(-80)),.8)
4413Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(-10),math.rad(0),math.rad(80)),.8)
4414RW.C0=clerp(RW.C0,cf(1.5,0.5 + 0.1 * math.cos(sine / 28),0)*angles(math.rad(20),math.rad(0),math.rad(40)),.8)
4415LW.C0=clerp(LW.C0,cf(-1.5,0.5 + 0.1 * math.cos(sine / 28),0)*angles(math.rad(170),math.rad(0),math.rad(-30)),.8)
4416end
4417for i = 0, 49 do
4418local dis = CreateParta(char,1,1,"Neon",MAINRUINCOLOR)
4419dis.CFrame = targetted.Head.CFrame*CFrame.new(math.random(-5,5),math.random(-5,5),math.random(-5,5))*CFrame.Angles(math.rad(math.random(-360,360)),math.rad(math.random(-360,360)),math.rad(math.random(-360,360)))
4420local at1 = Instance.new("Attachment",dis)
4421at1.Position = vt(-50000,0,0)
4422local at2 = Instance.new("Attachment",dis)
4423at2.Position = vt(50000,0,0)
4424local trl = Instance.new('Trail',dis)
4425trl.Attachment0 = at1
4426trl.FaceCamera = true
4427trl.Attachment1 = at2
4428trl.Texture = "rbxassetid://1049219073"
4429trl.LightEmission = 1
4430trl.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0, 0),NumberSequenceKeypoint.new(1, 1)})
4431trl.Color = ColorSequence.new(SECONDRUINCOLOR.Color)
4432trl.Lifetime = 5
4433local bv = Instance.new("BodyVelocity")
4434bv.maxForce = Vector3.new(1e9, 1e9, 1e9)
4435bv.velocity = dis.CFrame.lookVector*math.random(500,2500)
4436bv.Parent = dis
4437game:GetService("Debris"):AddItem(dis, 5)
4438end
4439for i = 0, 49 do
4440sphere2(math.random(10,75)/10,"Add",targetted.Head.CFrame*CFrame.Angles(math.rad(math.random(-360,360)),math.rad(math.random(-360,360)),math.rad(math.random(-360,360))),vt(5,5,5),-0.05,50,-0.05,MAINRUINCOLOR)
4441slash(math.random(10,30)/15,5,true,"Round","Add","Out",targetted.Head.CFrame*CFrame.Angles(math.rad(math.random(-360,360)),math.rad(math.random(-360,360)),math.rad(math.random(-360,360))),vt(0.01,0.01,0.01),math.random(40,500)/250,MAINRUINCOLOR)
4442end
4443CFuncs["EchoSound"].Create("rbxassetid://824687369", char, 2, 0.9,0,10,0.25,0.5,1)
4444for i = 0, 1 do
4445CFuncs["Sound"].Create("rbxassetid://221920821", targetted.Head, 5,0.9)
4446CFuncs["Sound"].Create("rbxassetid://221920821", targetted.Head, 7.5,0.75)
4447end
4448for i = 0, 4 do
4449CFuncs["Sound"].Create("rbxassetid://824687369", targetted.Head, 10, 1)
4450end
4451symbolizeBlink(targetted.Head,0,2109052855,MAINRUINCOLOR.Color,30,0,0,0,root,false,0,1)
4452symbolizeBlink(targetted.Head,0,2109052855,MAINRUINCOLOR.Color,30,0,0,0,root,false,0,2)
4453symbolizeBlink(targetted.Head,0,2109052855,MAINRUINCOLOR.Color,30,0,0,0,root,false,0,4)
4454dmg(targetted)
4455CFuncs["Sound"].Create("rbxassetid://847061203", root, 2.5,1)
4456for i = 0, 9 do
4457sphereMK(3,0.25,"Add",root.CFrame*CFrame.Angles(math.rad(math.random(-360,360)),math.rad(math.random(-360,360)),math.rad(math.random(-360,360))),1,1,10,-0.01,MAINRUINCOLOR,0)
4458end
4459for i = 0, 24 do
4460PixelBlock(1,math.random(4,8),"Add",root.CFrame*CFrame.Angles(math.rad(math.random(-360,360)),math.rad(math.random(-360,360)),math.rad(math.random(-360,360))),3,3,3,0.06,MAINRUINCOLOR,0)
4461end
4462sphere(3,"Add",root.CFrame,vt(0,0,0),0.25,MAINRUINCOLOR)
4463root.CFrame = originalpos
4464for i = 0, 9 do
4465sphereMK(3,0.25,"Add",root.CFrame*CFrame.Angles(math.rad(math.random(-360,360)),math.rad(math.random(-360,360)),math.rad(math.random(-360,360))),1,1,10,-0.01,MAINRUINCOLOR,0)
4466end
4467for i = 0, 24 do
4468PixelBlock(1,math.random(4,8),"Add",root.CFrame*CFrame.Angles(math.rad(math.random(-360,360)),math.rad(math.random(-360,360)),math.rad(math.random(-360,360))),3,3,3,0.06,MAINRUINCOLOR,0)
4469end
4470sphere(3,"Add",root.CFrame,vt(0,0,0),0.25,MAINRUINCOLOR)
4471attack = false
4472hum.WalkSpeed = storehumanoidWS
4473end
4474end
4475
4476local stealth = false
4477function StealthWarped()
4478if stealth then
4479return
4480end
4481attack = true
4482stealth = true
4483hum.WalkSpeed = 0
4484CFuncs["Sound"].Create("rbxassetid://838392947", root, 10, 1)
4485CFuncs["Sound"].Create("rbxassetid://1368598393", root, 10, 1)
4486for i = 0, 4, 0.1 do
4487swait()
4488block(10,"Add",sorb.CFrame*CFrame.new(0,-1,0),vt(1,1,1),0.01,0.01,0.01,MAINRUINCOLOR,MAINRUINCOLOR.Color)
4489block(10,"Add",sorb2.CFrame*CFrame.new(0,-1,0),vt(1,1,1),0.01,0.01,0.01,MAINRUINCOLOR,MAINRUINCOLOR.Color)
4490Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(-15),math.rad(0),math.rad(0)),.2)
4491RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(90), math.rad(0), math.rad(100)), 0.2)
4492LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(90), math.rad(0), math.rad(-100)), 0.2)
4493end
4494sphere2(4,"Add",sorb2.CFrame,vt(5,5,5),0.1,0.1,0.1,MAINRUINCOLOR)
4495sphere2(2,"Add",sorb2.CFrame,vt(5,5,5),0.1,0.1,0.1,MAINRUINCOLOR)
4496sphere2(4,"Add",sorb.CFrame,vt(5,5,5),0.1,0.1,0.1,MAINRUINCOLOR)
4497sphere2(2,"Add",sorb.CFrame,vt(5,5,5),0.1,0.1,0.1,MAINRUINCOLOR)
4498CFuncs["Sound"].Create("rbxassetid://840567549", root, 10, 1)
4499newTheme("rbxassetid://0",48.6,1,0.8)
4500char.Head.Transparency = 0.5
4501char["Left Arm"].Transparency = 0.5
4502char["Left Leg"].Transparency = 0.5
4503char["Right Arm"].Transparency = 0.5
4504char["Right Leg"].Transparency = 0.5
4505char.Torso.Transparency = 0.5
4506attack = false
4507hum.WalkSpeed = 60
4508storehumanoidWS = 60
4509swait(400)
4510char.Head.Transparency = 0
4511char["Left Arm"].Transparency = 0
4512char["Left Leg"].Transparency = 0
4513char["Right Arm"].Transparency = 0
4514char["Right Leg"].Transparency = 0
4515char.Torso.Transparency = 0
4516stealth = false
4517storehumanoidWS = 16
4518hum.WalkSpeed = storehumanoidWS
4519newTheme("rbxassetid://1119453744",48.6,1,0.8)
4520end
4521
4522function QuickSnap()
4523hum.WalkSpeed = 1
4524attack = true
4525for i = 0,0.5,0.1 do
4526swait()
4527RH.C0=clerp(RH.C0,cf(1,-1,0)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(0)),.2)
4528LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(0)),.2)
4529RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,-0.3,-0.05)*angles(math.rad(0),math.rad(0),math.rad(0)),.2)
4530Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(15),math.rad(0),math.rad(0)),.2)
4531RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*angles(math.rad(-40),math.rad(0),math.rad(50)),.2)
4532LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*angles(math.rad(-40),math.rad(0),math.rad(-50)),.2)
4533end
4534sphere2(5,"Add",root.CFrame,vt(1,1,1),1.5,1.5,1.5,MAINRUINCOLOR)
4535sphere2(5,"Add",root.CFrame,vt(1,1,1),1,1,1,SECONDRUINCOLOR)
4536for i = 0, 24 do
4537 slash(math.random(10,50)/10,5,true,"Round","Add","Out",root.CFrame*CFrame.Angles(math.rad(90),math.rad(math.random(-360,360)),math.rad(0)),vt(0.01,0.01,0.01),math.random(100,400)/250,SECONDRUINCOLOR)
4538end
4539CFuncs["Sound"].Create("rbxassetid://763716870", root, 8,1)
4540CFuncs["Sound"].Create("rbxassetid://782353443", root, 10,0.8)
4541CFuncs["Sound"].Create("rbxassetid://782225570", root, 9,0.5)
4542CFuncs["Sound"].Create("rbxassetid://763717569", root, 8,0.9)
4543local eff = Instance.new("ParticleEmitter",sorb2)
4544eff.Texture = "rbxassetid://2273224484"
4545eff.LightEmission = 1
4546eff.Color = ColorSequence.new(SECONDRUINCOLOR.Color)
4547eff.Rate = 900000000
4548eff.Lifetime = NumberRange.new(0.5,2)
4549eff.Size = NumberSequence.new({NumberSequenceKeypoint.new(0,8,0),NumberSequenceKeypoint.new(0.2,2,0),NumberSequenceKeypoint.new(0.8,2,0),NumberSequenceKeypoint.new(1,0,0)})
4550eff.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0,1,0),NumberSequenceKeypoint.new(0.1,0,0),NumberSequenceKeypoint.new(0.8,0,0),NumberSequenceKeypoint.new(1,1,0)})
4551eff.Speed = NumberRange.new(50,250)
4552eff.Drag = 5
4553eff.Rotation = NumberRange.new(-500,500)
4554eff.VelocitySpread = 9000
4555eff.RotSpeed = NumberRange.new(-50,50)
4556local eff2 = eff:Clone()
4557eff2.Parent = sorb
4558eff2.LightEmission = 0
4559eff2.Color = ColorSequence.new(MAINRUINCOLOR.Color)
4560for i = 0,4,0.1 do
4561swait(1)
4562root.CFrame = root.CFrame + root.CFrame.lookVector*7.5
4563local dis = CreateParta(char,0.25,1,"Neon",SECONDRUINCOLOR)
4564CreateMesh(dis,"Sphere",1,1,1)
4565dis.Anchored = true
4566dis.CFrame = sorb2.CFrame
4567local dis2 = CreateParta(char,0.25,1,"Neon",MAINRUINCOLOR)
4568CreateMesh(dis2,"Sphere",1,1,1)
4569dis2.Anchored = true
4570dis2.CFrame = sorb.CFrame
4571sphere2(5,"Add",dis.CFrame,vt(1,1,1),0.1,0.1,0.1,dis.BrickColor,dis.Color)
4572sphere2(5,"Add",dis2.CFrame,vt(1,1,1),0.1,0.1,0.1,dis2.BrickColor,dis2.Color)
4573game:GetService("Debris"):AddItem(dis, 5)
4574game:GetService("Debris"):AddItem(dis2, 5)
4575RH.C0=clerp(RH.C0,cf(1,-1 - 0.15 * math.cos(sine / 1.5),0)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(0 + 95 * math.cos(sine / 3))),.2)
4576LH.C0=clerp(LH.C0,cf(-1,-1 - 0.15 * math.cos(sine / 1.5),0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(0 + 95 * math.cos(sine / 3))),.2)
4577RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,-0.3,-0.05 + 0.15 * math.cos(sine / 1.5))*angles(math.rad(25 - 4 * math.cos(sine / 1.5)),math.rad(0),math.rad(0 - 1 * math.cos(sine / 3))),.2)
4578Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(-6 + 2 * math.cos(sine / 1.5)),math.rad(0),math.rad(0 + 1 * math.cos(sine / 3))),.2)
4579RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*angles(math.rad(70 + 4 * math.cos(sine / 1.5)),math.rad(0),math.rad(70)),.2)
4580LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*angles(math.rad(70 + 4 * math.cos(sine / 1.5)),math.rad(0),math.rad(-70)),.2)
4581sphereMK(2,-0.5,"Add",root.CFrame*CFrame.new(math.random(-5,5),math.random(-5,5),math.random(1,10))*CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)),0.25,0.25,3,-0.00375,MAINRUINCOLOR,0)
4582sphereMK(2,-0.5,"Add",root.CFrame*CFrame.new(math.random(-5,5),math.random(-5,5),math.random(1,10))*CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)),0.25,0.25,3,-0.00375,SECONDRUINCOLOR,0)
4583coroutine.resume(coroutine.create(function()
4584 swait(5)
4585coroutine.resume(coroutine.create(function()
4586CamShakeAll({
4587 Duration=0.25; -- Lasts for .1 seconds
4588 Intensity=0.9; -- Intensity of 5
4589 Position=Vector3.new(2,2,2); -- What axises the shake effects and how much (position)
4590 Rotation=Vector3.new(2,2,6); -- What axises the shake effects and how much (rotation)
4591 DropDist=75; -- Camera dist from origin when the shake starts to gradually get weaker
4592 IneffectiveDist=125; -- Camera dist from origin when the shake goes away
4593 Origin=dis.Position; -- Where the shake is coming from (Part, CFrame, or Vector3)
4594})
4595CamShakeAll({
4596 Duration=0.25; -- Lasts for .1 seconds
4597 Intensity=0.9; -- Intensity of 5
4598 Position=Vector3.new(2,2,2); -- What axises the shake effects and how much (position)
4599 Rotation=Vector3.new(2,2,6); -- What axises the shake effects and how much (rotation)
4600 DropDist=75; -- Camera dist from origin when the shake starts to gradually get weaker
4601 IneffectiveDist=125; -- Camera dist from origin when the shake goes away
4602 Origin=dis2.Position; -- Where the shake is coming from (Part, CFrame, or Vector3)
4603})
4604end))
4605 swait(20)
4606 dis.Transparency = 1
4607 dis2.Transparency = 1
4608MagniDamage(dis, 55, 50,99, 0, "Normal")
4609MagniDamage(dis2, 55, 50,99, 0, "Normal")
4610 for i = 0, 2 do
4611 slash(math.random(10,80)/10,5,true,"Round","Add","Out",dis.CFrame*CFrame.Angles(math.rad(math.random(-360,360)),math.rad(math.random(-360,360)),math.rad(math.random(-360,360))),vt(0.01,0.01,0.01),math.random(100,300)/250,dis.BrickColor)
4612 slash(math.random(10,80)/10,5,true,"Round","Add","Out",dis2.CFrame*CFrame.Angles(math.rad(math.random(-360,360)),math.rad(math.random(-360,360)),math.rad(math.random(-360,360))),vt(0.01,0.01,0.01),math.random(100,300)/250,dis2.BrickColor)
4613 end
4614 CFuncs["Sound"].Create("rbxassetid://782353117", dis, 1,0.75)
4615 CFuncs["Sound"].Create("rbxassetid://782353117", dis2, 1,0.75)
4616 CFuncs["Sound"].Create("rbxassetid://1666361078", dis, 1,1.25)
4617 CFuncs["Sound"].Create("rbxassetid://1666361078", dis2, 1,1.25)
4618 CFuncs["Sound"].Create("rbxassetid://782353443", dis, 2,1.15)
4619 CFuncs["Sound"].Create("rbxassetid://782353443", dis2, 2,1.15)
4620 sphere2(3,"Add",dis.CFrame,vt(1,1,1),0.8,0.8,0.8,dis.BrickColor,dis.Color)
4621 sphere2(3,"Add",dis2.CFrame,vt(1,1,1),0.8,0.8,0.8,dis2.BrickColor,dis2.Color)
4622dis:Destroy()
4623dis2:Destroy()
4624end))
4625end
4626eff.Enabled=false
4627eff2.Enabled=false
4628attack = false
4629hum.WalkSpeed = storehumanoidWS
4630wait(2)
4631eff:Destroy()
4632eff2:Destroy()
4633end
4634
4635function Ballesta_Shards()
4636attack = true
4637hum.WalkSpeed = 2
4638local keptcolor = BrickColor.new("Really red")
4639local keptcolor2 = SECONDRUINCOLOR
4640local rval = 0
4641local eval = 1
4642for i = 0,3,0.1 do
4643swait()
4644rval = rval + 30
4645eval = eval + 1.5
4646slash(math.random(40,70)/10,5,true,"Round","Add","Out",root.CFrame*CFrame.new(0,-2.5,0)*CFrame.Angles(math.rad(math.random(-5,5)),math.rad(math.random(-360,360)),math.rad(math.random(-5,5))),vt(0.01*rval/25,0.002,0.01*rval/25),math.random(5,20)/250,keptcolor2)
4647RH.C0=clerp(RH.C0,cf(1,-1 - 0.05 * math.cos(sine / 32),0)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(-3),math.rad(0 - 1 * math.cos(sine / 56)),math.rad(0 - 2 * math.cos(sine / 32))),.1)
4648LH.C0=clerp(LH.C0,cf(-1,-1 - 0.05 * math.cos(sine / 32),0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(-3),math.rad(0 - 1 * math.cos(sine / 56)),math.rad(0 + 2 * math.cos(sine / 32))),.1)
4649RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0.15 + 0.02 * math.cos(sine / 32),-0.1 + 0.05 * math.cos(sine / 32))*angles(math.rad(0 - 2 * math.cos(sine / 32)),math.rad(0),math.rad(0)),.1)
4650Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(35 - 2 * math.cos(sine / 37)),math.rad(0),math.rad(0)),.3)
4651RW.C0=clerp(RW.C0,cf(1,0.5 + 0.025 * math.cos(sine / 45),-0.5)*angles(math.rad(90 + 6 * math.cos(sine / 72)),math.rad(3 - 2 * math.cos(sine / 58)),math.rad(-80 + 2 * math.cos(sine / 45))),.3)
4652LW.C0=clerp(LW.C0,cf(-1,0.5 + 0.025 * math.cos(sine / 45),-0.5)*angles(math.rad(80 - 7 * math.cos(sine / 66)),math.rad(4 - 3 * math.cos(sine / 59)),math.rad(71 - 4 * math.cos(sine / 45))),.3)
4653end
4654for i = 0, 19 do
4655 slash(math.random(10,30)/10,5,true,"Round","Add","Out",root.CFrame*CFrame.new(0,-2.5,0)*CFrame.Angles(math.rad(math.random(-5,5)),math.rad(math.random(-360,360)),math.rad(math.random(-5,5))),vt(0.01,0.002,0.01),math.random(150,250)/250,keptcolor2)
4656end
4657CFuncs["Sound"].Create("rbxassetid://1368637781", root, 4,1)
4658CFuncs["Sound"].Create("rbxassetid://763718160", root, 4, 1.1)
4659CFuncs["Sound"].Create("rbxassetid://1310128035", root, 9, 0.9)
4660CFuncs["Sound"].Create("rbxassetid://199145739", root, 3,1)
4661MagniDamage(root, 50, 40,50, 0, "Normal")
4662sphere2(2,"Add",root.CFrame*CFrame.new(0,-3,0),vt(1,1,1),2,2,2,keptcolor,keptcolor.Color)
4663sphere2(3,"Add",root.CFrame*CFrame.new(0,-3,0),vt(1,1,1),2,2,2,keptcolor2,keptcolor2.Color)
4664
4665coroutine.resume(coroutine.create(function()
4666for i = 0, 51 do
4667swait()
4668local dis = CreateParta(char,0.5,1,"Neon",keptcolor)
4669dis.BrickColor = keptcolor
4670dis.Anchored = true
4671local at1 = Instance.new("Attachment",dis)
4672at1.Position = vt(-0.25,0,0)
4673local at2 = Instance.new("Attachment",dis)
4674at2.Position = vt(0.25,0,0)
4675local trl = Instance.new('Trail',dis)
4676trl.Attachment0 = at1
4677trl.FaceCamera = true
4678trl.Attachment1 = at2
4679trl.Texture = "rbxassetid://1049219073"
4680trl.LightEmission = 1
4681trl.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0, 0),NumberSequenceKeypoint.new(1, 1)})
4682trl.Color = ColorSequence.new(dis.Color)
4683trl.Lifetime = 0.6
4684dis.Velocity = vt(math.random(-50,50),math.random(125,210),math.random(-50,50))
4685CFuncs["Sound"].Create("rbxassetid://199145967", dis, 0.1,1)
4686dis.CFrame = root.CFrame*CFrame.new(math.random(-3,3),math.random(5,25),math.random(-3,3))*CFrame.Angles(math.rad(math.random(-360,360)),math.rad(math.random(-360,360)),math.rad(math.random(-360,360)))
4687CreateMesh(dis,"Sphere",0.5,0.5,4)
4688dis.Anchored = false
4689coroutine.resume(coroutine.create(function()
4690wait(1)
4691local a = Instance.new("Part",workspace)
4692 a.Name = "Direction"
4693 a.Anchored = true
4694 a.BrickColor = bc("Bright red")
4695a.Material = "Neon"
4696a.Transparency = 1
4697 a.CanCollide = false
4698 local ray = Ray.new(
4699 dis.CFrame.p, -- origin
4700 (mouse.Hit.p - dis.CFrame.p).unit * 500 -- direction
4701 )
4702 local ignore = dis
4703 local hit, position, normal = workspace:FindPartOnRay(ray, ignore)
4704 a.BottomSurface = 10
4705 a.TopSurface = 10
4706 local distance = (dis.CFrame.p - position).magnitude
4707 a.Size = Vector3.new(0.1, 0.1, 0.1)
4708 a.CFrame = CFrame.new(dis.CFrame.p, position) * CFrame.new(0, 0, 0)
4709dis.CFrame = a.CFrame
4710a:Destroy()
4711local bv = Instance.new("BodyVelocity")
4712bv.maxForce = Vector3.new(1e9, 1e9, 1e9)
4713bv.velocity = dis.CFrame.lookVector*200
4714bv.Parent = dis
4715game:GetService("Debris"):AddItem(dis, 5)
4716local hitted = false
4717coroutine.resume(coroutine.create(function()
4718dis.Touched:connect(function(hit)
4719 if hitted == false and hit.Parent ~= char then
4720 hitted = true
4721 CFuncs["Sound"].Create("rbxassetid://199146035", dis, 1.5,1)
4722 MagniDamage(dis, 20, 10,20, 0, "Normal")
4723 sphere2(5,"Add",dis.CFrame,vt(1,1,1),0.5,0.5,0.5,keptcolor2,keptcolor2.Color)
4724 sphere2(8,"Add",dis.CFrame,vt(1,1,1),0.5,0.5,0.5,keptcolor,keptcolor.Color)
4725 coroutine.resume(coroutine.create(function()
4726local eff = Instance.new("ParticleEmitter",dis)
4727eff.Texture = "rbxassetid://2344870656"
4728eff.LightEmission = 1
4729eff.Color = ColorSequence.new(dis.Color)
4730eff.Rate = 10000000
4731eff.Enabled = true
4732--eff.EmissionDirection = "Front"
4733eff.Lifetime = NumberRange.new(0.5)
4734eff.Size = NumberSequence.new({NumberSequenceKeypoint.new(0,75,0),NumberSequenceKeypoint.new(0.1,10,0),NumberSequenceKeypoint.new(0.8,20,0),NumberSequenceKeypoint.new(1,30,0)})
4735eff.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0,0.8,0),NumberSequenceKeypoint.new(0.5,0,0),NumberSequenceKeypoint.new(1,1,0)})
4736eff.Speed = NumberRange.new(100)
4737eff.Drag = 5
4738eff.Rotation = NumberRange.new(-500,500)
4739eff.SpreadAngle = Vector2.new(0,900)
4740eff.RotSpeed = NumberRange.new(-500,500)
4741wait(0.1)
4742eff.Enabled = false
4743 end))
4744coroutine.resume(coroutine.create(function()
4745local eff = Instance.new("ParticleEmitter",dis)
4746eff.Texture = "rbxassetid://695499847"
4747eff.LightEmission = 1
4748eff.Color = ColorSequence.new(dis.Color)
4749eff.Rate = 500000
4750eff.Lifetime = NumberRange.new(0.5,2)
4751eff.Size = NumberSequence.new({NumberSequenceKeypoint.new(0,0,0),NumberSequenceKeypoint.new(0.2,2,0),NumberSequenceKeypoint.new(0.8,2,0),NumberSequenceKeypoint.new(1,0,0)})
4752eff.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0,1,0),NumberSequenceKeypoint.new(0.1,0,0),NumberSequenceKeypoint.new(0.8,0,0),NumberSequenceKeypoint.new(1,1,0)})
4753eff.Speed = NumberRange.new(20,150)
4754eff.Drag = 5
4755eff.Rotation = NumberRange.new(-500,500)
4756eff.VelocitySpread = 9000
4757eff.RotSpeed = NumberRange.new(-150,150)
4758wait(0.5)
4759eff.Enabled = false
4760end))
4761dis.Anchored = true
4762dis.Transparency = 1
4763wait(8)
4764dis:Destroy()
4765end
4766end)
4767end))
4768end))
4769end
4770end))
4771coroutine.resume(coroutine.create(function()
4772local eff = Instance.new("ParticleEmitter",root)
4773eff.Texture = "rbxassetid://695499847"
4774eff.LightEmission = 0
4775eff.Color = ColorSequence.new(BrickColor.new("Crimson").Color)
4776eff.Rate = 500000
4777eff.Lifetime = NumberRange.new(0.5,2)
4778eff.Size = NumberSequence.new({NumberSequenceKeypoint.new(0,0,0),NumberSequenceKeypoint.new(0.2,3,0),NumberSequenceKeypoint.new(0.8,3,0),NumberSequenceKeypoint.new(1,0,0)})
4779eff.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0,1,0),NumberSequenceKeypoint.new(0.1,0,0),NumberSequenceKeypoint.new(0.8,0,0),NumberSequenceKeypoint.new(1,1,0)})
4780eff.Speed = NumberRange.new(30,250)
4781eff.Drag = 5
4782eff.Rotation = NumberRange.new(-500,500)
4783eff.VelocitySpread = 9000
4784eff.RotSpeed = NumberRange.new(-150,150)
4785wait(1.5)
4786eff.Enabled = false
4787end))
4788local eval2 = 1
4789sphere2(1,"Add",root.CFrame,vt(12.5,1,12.5),-0.05,3,-0.05,keptcolor)
4790sphere2(1,"Add",root.CFrame,vt(25,1,25),-0.1,6,-0.1,keptcolor2)
4791CamShakeAll({
4792 Duration=0.6; -- Lasts for .1 seconds
4793 Intensity=2; -- Intensity of 5
4794 Position=Vector3.new(2,2,2); -- What axises the shake effects and how much (position)
4795 Rotation=Vector3.new(2,2,4); -- What axises the shake effects and how much (rotation)
4796 DropDist=130; -- Camera dist from origin when the shake starts to gradually get weaker
4797 IneffectiveDist=165; -- Camera dist from origin when the shake goes away
4798 Origin=root.Position; -- Where the shake is coming from (Part, CFrame, or Vector3)
4799})
4800for i = 0,9,0.1 do
4801swait()
4802rval = rval + 20
4803eval = eval + 1.5
4804eval2 = eval2 + 10
4805slash(math.random(40,70)/10,5,true,"Round","Add","Out",root.CFrame*CFrame.new(0,3.5,0)*CFrame.Angles(math.rad(math.random(-5,5)),math.rad(math.random(-360,360)),math.rad(math.random(-5,5))),vt(0.01*eval2/60,0.002,0.01*eval2/60),math.random(5,20)/250,MAINRUINCOLOR)
4806RH.C0=clerp(RH.C0,cf(1,-1 - 0.05 * math.cos(sine / 32),0)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(-3),math.rad(0 - 1 * math.cos(sine / 56)),math.rad(-15 - 2 * math.cos(sine / 32))),.1)
4807LH.C0=clerp(LH.C0,cf(-1,-1 - 0.05 * math.cos(sine / 32),0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(-3),math.rad(0 - 1 * math.cos(sine / 56)),math.rad(15 + 2 * math.cos(sine / 32))),.1)
4808RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0.15 + 0.02 * math.cos(sine / 32),-0.1 + 0.05 * math.cos(sine / 32))*angles(math.rad(-15 - 2 * math.cos(sine / 32)),math.rad(0),math.rad(0)),.1)
4809Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(-25 - 2 * math.cos(sine / 37)),math.rad(0 + 1 * math.cos(sine / 58)),math.rad(0 + 2 * math.cos(sine / 53))),.1)
4810RW.C0=clerp(RW.C0,cf(1.35,1 + 0.025 * math.cos(sine / 45),0)*angles(math.rad(165 + 5 * math.cos(sine / 74)),math.rad(1 - 3 * math.cos(sine / 53)),math.rad(-10 + 3 * math.cos(sine / 45))),.1)
4811LW.C0=clerp(LW.C0,cf(-1.35,1 + 0.025 * math.cos(sine / 45),0)*angles(math.rad(165 - 3 * math.cos(sine / 73)),math.rad(2 - 1 * math.cos(sine / 55)),math.rad(13 - 3 * math.cos(sine / 45))),.1)
4812end
4813attack = false
4814hum.WalkSpeed = storehumanoidWS
4815end
4816
4817
4818function CursedSlash()
4819attack = true
4820hum.WalkSpeed = 2
4821local keptcolor = BrickColor.new("Black")
4822local keptcolor2 = SECONDRUINCOLOR
4823for i = 0,3,0.1 do
4824swait()
4825slash(math.random(80,90),90,true,"Round","Add","In",sword.CFrame*CFrame.new(0,0,0)*CFrame.Angles(math.rad(math.random(-5,5)),math.rad(math.random(-360,360)),math.rad(math.random(-90,90))),vt(0.01*2/60,0.002,0.01*2/60),math.random(5,20)/250,MAINRUINCOLOR)
4826RH.C0=clerp(RH.C0,cf(1,-1 - 0.05 * math.cos(sine / 32),0)*angles(math.rad(-5),math.rad(90),math.rad(-5)),.1)
4827LH.C0=clerp(LH.C0,cf(-1,-1 - 0.05 * math.cos(sine / 32),0)*angles(math.rad(5),math.rad(-90),math.rad(5)),.1)
4828RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0.01 + 0.001 * math.cos(sine / 32),0 + 0.05 * math.cos(sine / 32))*angles(math.rad(2 - 2 * math.cos(sine / 32)),math.rad(0),math.rad(-20 - 1 * math.cos(sine / 44))),.1)
4829Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * angles(math.rad(0 - 1.5 * math.cos(sine / 32)), math.rad(0 - 0.5 * math.cos(sine / 32)), math.rad(0 - 0.5 * math.cos(sine / 32))), 0.1)
4830RW.C0 = clerp(RW.C0, cf(1.5, 0.5, 0) * angles(math.rad(162 - 2 * math.cos(sine / 32)), math.rad(35), math.rad(-5 + 1.5 * math.cos(sine / 32))), 0.1)
4831LW.C0 = clerp(LW.C0, cf(-1.5, 0.5, 0) * angles(math.rad(15 - 2 * math.cos(sine / 32)), math.rad(0), math.rad(15 - 2 * math.cos(sine / 32))), 0.1)
4832end
4833MagniDamage(sword, 2, 15,30, 0, "Normal")
4834CamShakeAll({
4835 Duration=0.6; -- Lasts for .1 seconds
4836 Intensity=2; -- Intensity of 5
4837 Position=Vector3.new(2,2,2); -- What axises the shake effects and how much (position)
4838 Rotation=Vector3.new(2,2,4); -- What axises the shake effects and how much (rotation)
4839 DropDist=130; -- Camera dist from origin when the shake starts to gradually get weaker
4840 IneffectiveDist=165; -- Camera dist from origin when the shake goes away
4841 Origin=root.Position; -- Where the shake is coming from (Part, CFrame, or Vector3)
4842})
4843for i = 0,9,0.1 do
4844swait()
4845slash(math.random(40,70)/10,5,true,"Round","Add","Out",sword.CFrame*CFrame.new(0,0,0)*CFrame.Angles(math.rad(math.random(-5,5)),math.rad(math.random(-360,360)),math.rad(math.random(-90,90))),vt(0.01*2/60,0.002,0.01*2/60),math.random(5,20)/250,MAINRUINCOLOR)
4846MagniDamage(sword, 10, 1,5, 0, "Normal")
4847RH.C0=clerp(RH.C0,cf(1,-1 - 0.05 * math.cos(sine / 32),0)*angles(math.rad(-5),math.rad(90),math.rad(-5)),.1)
4848LH.C0=clerp(LH.C0,cf(-1,-1 - 0.05 * math.cos(sine / 32),0)*angles(math.rad(5),math.rad(-90),math.rad(5)),.1)
4849RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0.01 + 0.001 * math.cos(sine / 32),0 + 0.05 * math.cos(sine / 32))*angles(math.rad(2 - 2 * math.cos(sine / 32)),math.rad(0),math.rad(-20 - 1 * math.cos(sine / 44))),.1)
4850Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(0 - 2 * math.cos(sine / 37)),math.rad(0 + 1 * math.cos(sine / 58)),math.rad(0 + 2 * math.cos(sine / 53))),.1)
4851RW.C0=clerp(RW.C0,cf(1.5,0.5 + 0.1 * math.cos(sine / 28),-0.2)*angles(math.rad(17),math.rad(-360),math.rad(-15)),.1)
4852LW.C0=clerp(LW.C0,cf(-1.5,0.5 + 0.1 * math.cos(sine / 28),0)*angles(math.rad(-25),math.rad(0),math.rad(0)),.1)
4853end
4854attack = false
4855hum.WalkSpeed = storehumanoidWS
4856end
4857function desstomp()
4858 attack = true
4859bosschatfunc("To the depths of hell...",MAINRUINCOLOR.Color,4)
4860for i = 0, 8, 0.1 do
4861swait()
4862RH.C0=clerp(RH.C0,cf(1,-0.25,-0.5)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(20)),.2)
4863LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(20)),.2)
4864RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,1.4 + 0.5 * math.cos(sine / 32))*angles(math.rad(0 - 1 * math.cos(sine / 34)),math.rad(0),math.rad(0)),.1)
4865Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(-20),math.rad(0),math.rad(0)),.2)
4866RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*angles(math.rad(140),math.rad(0),math.rad(-20)),.2)
4867LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*angles(math.rad(140),math.rad(0),math.rad(20)),.2)
4868end
4869CFuncs["Sound"].Create("rbxassetid://438666141", root, 7.5,1)
4870CFuncs["Sound"].Create("rbxassetid://1208650519", root, 7.5, 1)
4871for i, v in pairs(FindNearestHead(Torso.CFrame.p, 105)) do
4872if v:FindFirstChild('Head') then
4873dmg(v)
4874end
4875end
4876sphere(5,"Add",root.CFrame*CFrame.new(0,-2.9,0),vt(0,0,0),1,MAINRUINCOLOR)
4877sphere(10,"Add",root.CFrame*CFrame.new(0,-2.9,0),vt(0,0,0),2,MAINRUINCOLOR)
4878sphere(1,"Add",root.CFrame*CFrame.new(0,-2.9,0),vt(200,0.1,200),0.01,MAINRUINCOLOR)
4879bosschatfunc("YOU GO!",MAINRUINCOLOR.Color,4)
4880CamShakeAll({
4881 Duration=0.2; -- Lasts for .1 seconds
4882 Intensity=4; -- Intensity of 5
4883 Position=Vector3.new(2,2,2); -- What axises the shake effects and how much (position)
4884 Rotation=Vector3.new(2,2,4); -- What axises the shake effects and how much (rotation)
4885 DropDist=200; -- Camera dist from origin when the shake starts to gradually get weaker
4886 IneffectiveDist=250; -- Camera dist from origin when the shake goes away
4887 Origin=root.Position; -- Where the shake is coming from (Part, CFrame, or Vector3)
4888})
4889for i = 0, 6, 0.1 do
4890swait()
4891sphereMK(2.5,0.75,"Add",root.CFrame*CFrame.new(math.random(-105,105),-5,math.random(-105,105))*CFrame.Angles(math.rad(90 + math.rad(math.random(-45,45))),math.rad(math.random(-45,45)),math.rad(math.random(-45,45))),2.5,2.5,25,-0.025,MAINRUINCOLOR,0)
4892sphereMK(2.5,0.75,"Add",root.CFrame*CFrame.new(math.random(-105,105),-5,math.random(-105,105))*CFrame.Angles(math.rad(90 + math.rad(math.random(-45,45))),math.rad(math.random(-45,45)),math.rad(math.random(-45,45))),2.5,2.5,25,-0.025,MAINRUINCOLOR,0)
4893RH.C0=clerp(RH.C0,cf(1,-1,-0.5)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(10)),.4)
4894LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(10)),.4)
4895RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,0)*angles(math.rad(10),math.rad(0),math.rad(0)),.4)
4896Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(30),math.rad(0),math.rad(0)),.4)
4897RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*angles(math.rad(0),math.rad(0),math.rad(-10)),.4)
4898LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*angles(math.rad(0),math.rad(0),math.rad(-10)),.4)
4899end
4900attack = false
4901end
4902function destaunt()
4903 attack = true
4904bosschatfunc("Did you expect a different and more recognisable name? My bad.",MAINRUINCOLOR.Color,4)
4905for i = 0,20,0.1 do
4906 swait()
4907RH.C0=clerp(RH.C0,cf(1,-0.5,-0.6)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(1.5),math.rad(0),math.rad(-20 - 5 * math.cos(sine / 34))),.2)
4908LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(-6),math.rad(22 - 2 * math.cos(sine / 56)),math.rad(-1 + 2 * math.cos(sine / 32))),.1)
4909RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,1.4 + 0.5 * math.cos(sine / 32))*angles(math.rad(0 - 1 * math.cos(sine / 34)),math.rad(0),math.rad(-35)),.1)
4910Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(5 - 5 * math.cos(sine / 10)),math.rad(0),math.rad(34)),.1)
4911RW.C0=clerp(RW.C0,cf(1.3,0.5 + 0.1 * math.cos(sine / 70),-0.9)*angles(math.rad(120 + 1 * math.cos(sine / 0.0001) ),math.rad(0),math.rad(-90 + 1 * math.cos(sine / 0.0001))),.1)
4912LW.C0=clerp(LW.C0,cf(-1.1,0.6 + 0.1 * math.cos(sine / 28),0.2)*angles(math.rad(220),math.rad(0),math.rad(45 + 1 * math.cos(sine / 50))),.1)
4913end
4914attack = false
4915end
4916-------------------------------------
4917
4918if Humanoid:findFirstChild("Animator")~=nil then
4919 Humanoid:findFirstChild("Animator").Parent=nil
4920end
4921
4922if Character:findFirstChild("Animate")~=nil then
4923 Character:findFirstChild("Animate").Parent=nil
4924end
4925local TransformCD = false
4926hum.WalkSpeed = 16
4927-------------------------------------
4928
4929 local NewInstance = function(instance,parent,properties)
4930 local inst = Instance.new(instance,parent)
4931 if(properties)then
4932 for i,v in next, properties do
4933 pcall(function() inst[i] = v end)
4934 end
4935 end
4936 return inst;
4937 end
4938
4939local attacktype = 1
4940mouse.Button1Down:connect(function()
4941 if attack == false and attacktype == 1 then
4942 attacktype = 2
4943 attackone()
4944 elseif attack == false and attacktype == 2 then
4945 attacktype = 3
4946 attacktwo()
4947 elseif attack == false and attacktype == 3 then
4948 attacktype = 1
4949 attackthree()
4950 elseif attack == false and attacktype == 4 then
4951 attacktype = 1
4952 --attackfour()
4953 end
4954end)
4955
4956local modeInformation={
4957 {Name='COMMOTIAUS',ThemePitch=1,Walkspeed=16,Rainbow=false,Chaos=false,Theme="rbxassetid://2071274388",Volume=1.2,TextColor=BrickColor.new("Bright bluish green").Color,Stroke=Color3.new(0,0.3,1),Font='SciFi',MainColor=BrickColor.new("Bright bluish green"),SecColor=BrickColor.new("Pastel light blue"),WingColor1=BrickColor.new("Bright bluish green"),WingColor2=BrickColor.new("Bright bluish green"),ExWing1={Trans=1,Color=BrickColor.new("Bright bluish green")},ExWing2={Trans=1,Color=BrickColor.new("Bright bluish green")},SecondWing=true,SecondTrail=false,MainTrail=false};
4958 {Name='DURABITINE',ThemePitch=1,Walkspeed=12,Rainbow=false,Chaos=false,Theme="rbxassetid://692083837",Volume=1.2,TextColor=BrickColor.new("Earth green").Color,Stroke=BrickColor.new("Forest green").Color,Font='Bodoni',MainColor=BrickColor.new("Earth green"),SecColor=BrickColor.new("Forest green"),WingColor1=BrickColor.new("Earth green"),WingColor2=BrickColor.new("Forest green"),ExWing1={Trans=1,Color=BrickColor.new("Earth green")},ExWing2={Trans=1,Color=BrickColor.new("Earth green")},SecondWing=true,SecondTrail=false,MainTrail=true};
4959 {Name='ENCHANTER',ThemePitch=1,Walkspeed=19,Rainbow=false,Chaos=false,Theme="rbxassetid://436447939",Volume=1.2,TextColor=Color3.new(0.1,0.1,0.1),Stroke=BrickColor.new"Royal purple".Color,Font='Antique',MainColor=BrickColor.new("Mulberry"),SecColor=BrickColor.new("Royal purple"),WingColor1=BrickColor.new("Mulberry"),WingColor2=BrickColor.new("Royal purple"),ExWing1={Trans=1,Color=BrickColor.new("Mulberry")},ExWing2={Trans=1,Color=BrickColor.new("Mulberry")},SecondWing=true,SecondTrail=false,MainTrail=true};
4960 {Name='LACONISM',ThemePitch=.8,Walkspeed=9,Rainbow=false,Chaos=false,Theme="rbxassetid://2668496921",Volume=1.3,TextColor=Color3.new(0,0,0),Stroke=BrickColor.new("Really black").Color,Font='Cartoon',MainColor=BrickColor.new("Really black"),SecColor=BrickColor.new("Really black"),WingColor1=BrickColor.new("Really black"),WingColor2=BrickColor.new("Really black"),ExWing1={Trans=1,Color=BrickColor.new("Really black")},ExWing2={Trans=1,Color=BrickColor.new("Really black")},SecondWing=true,SecondTrail=false,MainTrail=true};
4961 {Name='METALEMPSYSIS',ThemePitch=1,Walkspeed=37,Rainbow=false,Chaos=false,Theme="rbxassetid://1880845619",Volume=1.1,TextColor=Color3.new(0,0,0),Stroke=Color3.new(0.02,0.02,0.02),Font='SciFi',MainColor=BrickColor.new("Really black"),SecColor=BrickColor.new("Really black"),WingColor1=BrickColor.new("Really black"),WingColor2=BrickColor.new("Really black"),ExWing1={Trans=1,Color=BrickColor.new("Really black")},ExWing2={Trans=1,Color=BrickColor.new("Really black")},SecondWing=true,SecondTrail=false,MainTrail=true};
4962 {Name='AMBUSTUME',ThemePitch=1,Walkspeed=37,Rainbow=false,Chaos=false,Theme="rbxassetid://1290419263",Volume=0.9,TextColor=Color3.new(143/255, 76/255, 42/255),Stroke=Color3.new(86/255, 36/255, 36/255),Font='Bodoni',MainColor=BrickColor.new("Rust"),SecColor=BrickColor.new("Cocoa"),WingColor1=BrickColor.new("Rust"),WingColor2=BrickColor.new("Rust"),ExWing1={Trans=1,Color=BrickColor.new("Cocoa")},ExWing2={Trans=1,Color=BrickColor.new("Cocoa")},SecondWing=true,SecondTrail=false,MainTrail=true};
4963 {Name='CURSED',ThemePitch=0.5,Walkspeed=20,Rainbow=false,Chaos=false,Theme="rbxassetid://343860759",Volume=1.2,TextColor=Color3.new(0,0,0),Stroke=BrickColor.new"Dark stone grey".Color,Font='Bodoni',MainColor=BrickColor.new("Really black"),SecColor=BrickColor.new("Black"),WingColor1=BrickColor.new("Really black"),WingColor2=BrickColor.new("Really black"),ExWing1={Trans=1,Color=BrickColor.new("Black")},ExWing2={Trans=1,Color=BrickColor.new("Black")},SecondWing=true,SecondTrail=false,MainTrail=false};
4964 {Name='ACCESSIONIST',ThemePitch=1,Walkspeed=100,Rainbow=false,Chaos=false,Theme="rbxassetid://227551982",Volume=1.2,TextColor=Color3.new(239/255, 184/255, 56/255),Stroke=BrickColor.new"White".Color,Font='SourceSansBold',MainColor=BrickColor.new("White"),SecColor=BrickColor.new("Daisy orange"),WingColor1=BrickColor.new("White"),WingColor2=BrickColor.new("Daisy orange"),ExWing1={Trans=1,Color=BrickColor.new("White")},ExWing2={Trans=1,Color=BrickColor.new("Daisy orange")},SecondWing=true,SecondTrail=false,MainTrail=true};
4965 {Name='DESCENTED',ThemePitch=0.81,Walkspeed=55,Rainbow=false,Chaos=false,Theme="rbxassetid://150384451",Volume=1.2,TextColor=BrickColor.new"Alder".Color,Stroke=BrickColor.new"Cyan".Color,Font='Garamond',MainColor=BrickColor.new("Alder"),SecColor=BrickColor.new("Cyan"),WingColor1=BrickColor.new("Alder"),WingColor2=BrickColor.new("Cyan"),ExWing1={Trans=1,Color=BrickColor.new("White")},ExWing2={Trans=1,Color=BrickColor.new("Cyan")},SecondWing=true,SecondTrail=false,MainTrail=true};
4966 {Name='DISGUITIVE',ThemePitch=1,Walkspeed=125,Rainbow=false,Chaos=false,Theme="rbxassetid://189701469",Volume=1.2,TextColor=Color3.new(0,0,0.5),Stroke=BrickColor.new"Really blue".Color,Font='Arcade',MainColor=BrickColor.new("Navy blue"),SecColor=BrickColor.new("Navy blue"),WingColor1=BrickColor.new("Navy blue"),WingColor2=BrickColor.new("Really blue"),ExWing1={Trans=1,Color=BrickColor.new("Mulberry")},ExWing2={Trans=1,Color=BrickColor.new("Mulberry")},SecondWing=false,SecondTrail=false,MainTrail=true};
4967 {Name='SHAMBOLIACY',ThemePitch=1,Walkspeed=65,Rainbow=false,Chaos=false,Theme="rbxassetid://668243190",Volume=1.25,TextColor=Color3.new(0.1,0.1,0.1),Stroke=Color3.new(0.35,0,0),Font='SciFi',MainColor=BrickColor.new("Maroon"),SecColor=BrickColor.new("Really black"),WingColor1=BrickColor.new("Maroon"),WingColor2=BrickColor.new("Really black"),ExWing1={Trans=1,Color=BrickColor.new("Really black")},ExWing2={Trans=1,Color=BrickColor.new("Black")},SecondWing=true,SecondTrail=false,MainTrail=true};
4968 {Name='STEALTH',ThemePitch=1,Walkspeed=16,Rainbow=false,Chaos=false,Theme="rbxassetid://1119453744",Volume=0.8,TextColor=Color3.new(0.15,0.15,0.15),Stroke=Color3.new(0.3,0.3,0.3),Font='Antique',MainColor=BrickColor.new("Dark stone grey"),SecColor=BrickColor.new("Light blue"),WingColor1=BrickColor.new("Dark stone grey"),WingColor2=BrickColor.new("Light blue"),ExWing1={Trans=1,Color=BrickColor.new("Really black")},ExWing2={Trans=1,Color=BrickColor.new("Black")},SecondWing=true,SecondTrail=false,MainTrail=true};
4969 {Name='RETINENTIA',ThemePitch=1,Walkspeed=12,Rainbow=false,Chaos=false,Theme="rbxassetid://579259104",Volume=0.8,TextColor=Color3.new(.8,.8,.8),Stroke=Color3.new(0.1,0.1,0.1),Font='Bodoni',MainColor=BrickColor.new("Medium stone grey"),SecColor=BrickColor.new("Black"),WingColor1=BrickColor.new("Dark stone grey"),WingColor2=BrickColor.new("White"),ExWing1={Trans=1,Color=BrickColor.new("Really black")},ExWing2={Trans=1,Color=BrickColor.new("Black")},SecondWing=false,SecondTrail=false,MainTrail=true};
4970 {Name='SYMBOLICITY',ThemePitch=1,Walkspeed=125,Rainbow=false,Chaos=false,Theme="rbxassetid://899090278",Volume=1.25,TextColor=Color3.new(1,0,0),Stroke=Color3.new(1,1,1),Font='Arcade',MainColor=BrickColor.new("Really red"),SecColor=BrickColor.new("White"),WingColor1=BrickColor.new("Really red"),WingColor2=BrickColor.new("White"),ExWing1={Trans=1,Color=BrickColor.new("Really black")},ExWing2={Trans=1,Color=BrickColor.new("Black")},SecondWing=true,SecondTrail=false,MainTrail=true};
4971 {Name='ANTECEDENT',ThemePitch=1,Walkspeed=16,Rainbow=false,Chaos=false,Theme="rbxassetid://657143125",Volume=1.25,TextColor=Color3.new(1,0,.31),Stroke=Color3.new(1,0,1),Font='Arcade',MainColor=BrickColor.new("Really red"),SecColor=BrickColor.new("Hot pink"),WingColor1=Color3.new(1,0,.31),WingColor2=Color3.new(1,0,.31),ExWing1={Trans=1,Color=BrickColor.new("Really black")},ExWing2={Trans=1,Color=BrickColor.new("Black")},SecondWing=true,SecondTrail=false,MainTrail=true};
4972 {Name='EQUILIBRIUM',ThemePitch=1,Walkspeed=32,Rainbow=false,Chaos=false,Theme="rbxassetid://837090776",Volume=1.25,TextColor=Color3.new(1,1,1),Stroke=Color3.new(0,0,0),Font='Gotham',MainColor=BrickColor.new("Really black"),SecColor=BrickColor.new("Institutional white"),WingColor1=Color3.new(0,0,0),WingColor2=Color3.new(1,1,1),ExWing1={Trans=1,Color=BrickColor.new("Really black")},ExWing2={Trans=1,Color=BrickColor.new("Black")},SecondWing=true,SecondTrail=false,MainTrail=true};
4973}
4974
4975
4976--Ench 565863302
4977
4978--407122850 2128439818 1134696007
4979--^ die
4980
4981--[[local modeInformation2={ v v v for future flying modetypes
4982 {Name='SILENTIAC',ThemePitch=1,Walkspeed=9,Rainbow=false,Chaos=false,Theme="rbxassetid://209322206",TextColor=Color3.new(0,0,0),Stroke=BrickColor.new("Really black").Color,Font='Cartoon',MainColor=BrickColor.new("Really black"),SecColor=BrickColor.new("Really black"),WingColor1=BrickColor.new("Really black"),WingColor2=BrickColor.new("Really black"),ExWing1={Trans=1,Color=BrickColor.new("Really black")},ExWing2={Trans=1,Color=BrickColor.new("Really black")},SecondWing=true,SecondTrail=false,MainTrail=true};
4983 {Name='ACCESSION',ThemePitch=1,Walkspeed=70,Rainbow=false,Chaos=false,Theme="rbxassetid://227551982",TextColor=Color3.new(239, 184, 56),Stroke=BrickColor.new"White".Color,Font='SourceSansBold',MainColor=BrickColor.new("White"),SecColor=BrickColor.new("Daisy orange"),WingColor1=BrickColor.new("White"),WingColor2=BrickColor.new("Daisy orange"),ExWing1={Trans=1,Color=BrickColor.new("White")},ExWing2={Trans=1,Color=BrickColor.new("Daisy orange")},SecondWing=true,SecondTrail=false,MainTrail=true};
4984 {Name='DESCENTED',ThemePitch=0.81,Walkspeed=70,Rainbow=false,Chaos=false,Theme="rbxassetid://150384451",TextColor=BrickColor.new"Alder".Color,Stroke=BrickColor.new"Cyan".Color,Font='Garamond',MainColor=BrickColor.new("Alder"),SecColor=BrickColor.new("Cyan"),WingColor1=BrickColor.new("Alder"),WingColor2=BrickColor.new("Cyan"),ExWing1={Trans=1,Color=BrickColor.new("White")},ExWing2={Trans=1,Color=BrickColor.new("Cyan")},SecondWing=true,SecondTrail=false,MainTrail=true};
4985}]]
4986
4987RecolorTextAndRename("COMMOTIAUS",MAINRUINCOLOR.Color,Color3.new(0,0.3,1),Enum.Font.SciFi)
4988
4989mouse.KeyDown:connect(function(k)
4990if stealth==false and k == "q" and attack == false and TransformCD == false or stealth==false and k == "e" and attack == false and FlyingTypes==false and TransformCD == false then
4991 local pmode=ModeOfGlitch
4992 attack = true
4993 hum.WalkSpeed = 5
4994TransformCD = true
4995 CFuncs["Sound"].Create("rbxassetid://136007472", root, 5, 1.8)
4996
4997for i = 0,2,0.1 do
4998swait()
4999sphereMK(5,-4.5,"Add",sorb.CFrame*CFrame.Angles(math.rad(math.random(-360,360)),math.rad(math.random(-360,360)),math.rad(math.random(-360,360))),3.5,3.5,45,-0.035,MAINRUINCOLOR,225)
5000sphereMK(5,-4.5,"Add",sorb2.CFrame*CFrame.Angles(math.rad(math.random(-360,360)),math.rad(math.random(-360,360)),math.rad(math.random(-360,360))),3.5,3.5,45,-0.035,MAINRUINCOLOR,225)
5001RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,-0.1,-0.1)* angles(math.rad(20),math.rad(0),math.rad(0)),0.3)
5002Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(35),math.rad(0),math.rad(0)),.3)
5003RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, -0.5) * angles(math.rad(0), math.rad(0), math.rad(-90)), 0.3)
5004LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, -0.5) * angles(math.rad(0), math.rad(0), math.rad(90)), 0.3)
5005RH.C0=clerp(RH.C0,cf(1,-1 - 0.05 * math.cos(sine / 25),0)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(-1.5),math.rad(0),math.rad(20)),.3)
5006LH.C0=clerp(LH.C0,cf(-1,-1 - 0.05 * math.cos(sine / 25),0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(-2.5),math.rad(0),math.rad(-20)),.3)
5007end
5008swait(4)
5009if k == "e" then
5010ModeOfGlitch = ModeOfGlitch + 1
5011elseif k == "q" then
5012ModeOfGlitch = ModeOfGlitch - 1
5013end
5014if ModeOfGlitch > #modeInformation then
5015 ModeOfGlitch = 1
5016end
5017if ModeOfGlitch < 1 then
5018 ModeOfGlitch = #modeInformation
5019end
5020local info = modeInformation[ModeOfGlitch]
5021if(info and pmode~=ModeOfGlitch)then
5022storehumanoidWS = info.Walkspeed
5023hum.WalkSpeed = info.Walkspeed
5024MAINRUINCOLOR = info.MainColor
5025SECONDRUINCOLOR = info.SecColor
5026sphere2(3,"Add",tors.CFrame,vt(1,1,1),0.25,0.25,0.25,MAINRUINCOLOR)
5027sphere2(4,"Add",tors.CFrame,vt(1,1,1),0.5,0.5,0.5,SECONDRUINCOLOR)
5028sphere2(5,"Add",tors.CFrame,vt(1,1,1),0.75,0.75,0.75,MAINRUINCOLOR)
5029for i = 0, 24 do
5030slash(math.random(10,30)/10,5,true,"Round","Add","Out",root.CFrame*CFrame.Angles(math.rad(math.random(-360,360)),math.rad(math.random(-360,360)),math.rad(math.random(-360,360))),vt(0.01,0.01,0.01),math.random(150,350)/250,MAINRUINCOLOR)
5031end
5032CFuncs["Sound"].Create("rbxassetid://206082327", root, 5,1)
5033CFuncs["Sound"].Create("rbxassetid://1368637781", root, 7,1)
5034CFuncs["Sound"].Create("rbxassetid://763718160", root, 4, 1.1)
5035CFuncs["Sound"].Create("rbxassetid://1310128035", root, 9, 0.9)
5036hum.WalkSpeed = storehumanoidWS
5037rainbowmode = info.Rainbow
5038chaosmode = info.Chaos
5039cp = info.Theme:gsub("rbxassetid://","")
5040newTheme(info.Theme,0,info.ThemePitch,info.Volume)
5041RecolorTextAndRename(info.Name,info.TextColor,info.Stroke,info.Font)
5042RecolorThing(info.WingColor1,info.WingColor2,info.WingColor1,info.WingColor1,info.WingColor1,info.ExWing1.Trans,info.ExWing1.Color,info.ExWing2.Trans,info.ExWing1.Color,info.SecondWing,info.SecondTrail,info.MainTrail)
5043if ModeOfGlitch==11 then
5044for i, v in pairs(mw2:GetDescendants()) do
5045if v:IsA("Part") or v:IsA("BasePart") then
5046v.Color = Color3.new(0.35,0,0)
5047v.Material = "Neon"
5048v.Transparency = 0
5049elseif v:IsA("Trail") or v:IsA("ParticleEmitter") then
5050v.Color = ColorSequence.new(Color3.new(MRANDOM(0,1),0,0))
5051v.Enabled = true
5052end
5053end
5054end
5055for i = 0,2.5,0.1 do
5056swait()
5057RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0.1,-0.1)* angles(math.rad(-20),math.rad(0),math.rad(0)),0.3)
5058Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(-35),math.rad(0),math.rad(0)),.3)
5059RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(-20), math.rad(0), math.rad(35)), 0.3)
5060LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-20), math.rad(0), math.rad(-35)), 0.3)
5061RH.C0=clerp(RH.C0,cf(1,-1 - 0.05 * math.cos(sine / 25),0)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(-1.5),math.rad(0),math.rad(-20)),.3)
5062LH.C0=clerp(LH.C0,cf(-1,-1 - 0.05 * math.cos(sine / 25),0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(-2.5),math.rad(0),math.rad(20)),.3)
5063end
5064attack = false
5065wait(0.3)
5066TransformCD = false
5067end
5068end
5069if k == "i" and mutedtog == false then
5070mutedtog = true
5071kan.Volume = 0
5072elseif k == "i" and mutedtog == true then
5073mutedtog = false
5074kan.Volume = 1.25
5075end
5076if k == "h" then
5077local ggagag=math.random(1,4)
5078if ggagag==1 then
5079newbosschatfunc("ok.",MAINRUINCOLOR.Color,SECONDRUINCOLOR.Color,200)
5080elseif ggagag==2 then
5081newbosschatfunc("s",MAINRUINCOLOR.Color,SECONDRUINCOLOR.Color,200)
5082elseif ggagag==3 then
5083newbosschatfunc("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",MAINRUINCOLOR.Color,SECONDRUINCOLOR.Color,200)
5084elseif ggagag==4 then
5085newbosschatfunc("g",MAINRUINCOLOR.Color,SECONDRUINCOLOR.Color,200)
5086end
5087end
5088if k == "z" and attack == false and ModeOfGlitch == 1 then
5089ExtinctiveHeartbreak()
5090elseif k == "z" and attack == false and ModeOfGlitch == 12 then
5091StealthWarped()
5092elseif k == "z" and attack == false and ModeOfGlitch == 11 then
5093Ballesta_Shards()
5094elseif k == "z" and attack == false and ModeOfGlitch == 7 then
5095CursedSlash()
5096elseif k == "z" and attack == false and ModeOfGlitch == 9 then
5097QuickSnap()
5098elseif k == "z" and attack == false and ModeOfGlitch == 10 then
5099desstomp()
5100elseif k == "b" and attack == false and ModeOfGlitch == 10 then
5101destaunt()
5102end
5103end)
5104
5105plr.Chatted:connect(function(message)
5106newbosschatfunc(message,MAINRUINCOLOR.Color,SECONDRUINCOLOR.Color,200)
5107end)
5108
5109local no=0
5110local no2=0
5111local spin=0
5112coroutine.resume(coroutine.create(function()
5113while true do
5114swait()
5115spin=spin+1
5116
5117
5118if ModeOfGlitch ~= 7 then
5119for i,v in pairs(script.BloodCurse.BloodCurse:GetChildren()) do
5120if v:IsA("Part") then
5121v.Transparency = 1
5122end
5123end
5124elseif ModeOfGlitch == 7 then
5125for i,v in pairs(script.BloodCurse.BloodCurse:GetChildren()) do
5126if v:IsA("Part") then
5127v.Transparency = 0
5128end
5129end
5130end
5131
5132
5133
5134if ModeOfGlitch == 5 and attack==false or ModeOfGlitch==10 and attack==false then
5135no=no+1
5136if no>3 then
5137no=0
5138local rsiz = math.random(1,3)
5139sphereMK(math.random(3,6),math.random(-25,25)/750,"Add",sorb2.CFrame*CFrame.new(math.random(-20,20)/50,math.random(-20,20)/50,math.random(-20,20)/50)*CFrame.Angles(math.rad(90 + math.random(-360,360)),math.rad(math.random(-360,360)),math.rad(math.random(-360,360))),rsiz/10,rsiz/10,rsiz/10,0,MAINRUINCOLOR,0)
5140sphereMK(math.random(6,9),math.random(-10,10)/750,"Add",sorb2.CFrame*CFrame.new(math.random(-5,5)/50,math.random(-5,5)/50,math.random(-5,5)/50)*CFrame.Angles(math.rad(90 + math.random(-360,360)),math.rad(math.random(-360,360)),math.rad(math.random(-360,360))),rsiz/3,rsiz/3,rsiz/3,0,MAINRUINCOLOR,0)
5141end
5142end
5143
5144
5145if ModeOfGlitch==8 or ModeOfGlitch==10 or ModeOfGlitch==12 or ModeOfGlitch==14 then
5146effar.Enabled = true
5147effar.Color = ColorSequence.new(MAINRUINCOLOR.Color)
5148rotperm = rotperm + 2
5149no2=no2+1
5150if no2>4 then
5151no2=0
5152sphere2(8,"Add",root.CFrame*CFrame.Angles(0,math.rad(0 +rotperm),0)*CFrame.new(0+4*math.sin(sine / 45),1.4+3*math.cos(sine / 45),2.5),vt(1,1,1),-0.01,-0.01,-0.01,MAINRUINCOLOR)
5153sphere2(8,"Add",root.CFrame*CFrame.Angles(0,math.rad(90 +rotperm),0)*CFrame.new(0+4*math.sin(sine / 45),1.4+3*math.cos(sine / 45),2.5),vt(1,1,1),-0.01,-0.01,-0.01,MAINRUINCOLOR)
5154sphere2(8,"Add",root.CFrame*CFrame.Angles(0,math.rad(180 + rotperm),0)*CFrame.new(0+4*math.sin(sine / 45),1.4+3*math.cos(sine / 45),2.5),vt(1,1,1),-0.01,-0.01,-0.01,MAINRUINCOLOR)
5155sphere2(8,"Add",root.CFrame*CFrame.Angles(0,math.rad(270 +rotperm),0)*CFrame.new(0+4*math.sin(sine / 45),1.4+3*math.cos(sine / 45),2.5),vt(1,1,1),-0.01,-0.01,-0.01,MAINRUINCOLOR)
5156sphere2(8,"Add",root.CFrame*CFrame.Angles(0,math.rad(0 - rotperm),0)*CFrame.new(0+4*math.sin(sine / 45),1.4-3*math.cos(sine / 45),2.5),vt(1,1,1),-0.01,-0.01,-0.01,SECONDRUINCOLOR)
5157sphere2(8,"Add",root.CFrame*CFrame.Angles(0,math.rad(90 - rotperm),0)*CFrame.new(0+4*math.sin(sine / 45),1.4-3*math.cos(sine / 45),2.5),vt(1,1,1),-0.01,-0.01,-0.01,SECONDRUINCOLOR)
5158sphere2(8,"Add",root.CFrame*CFrame.Angles(0,math.rad(180 - rotperm),0)*CFrame.new(0+4*math.sin(sine / 45),1.4-3*math.cos(sine / 45),2.5),vt(1,1,1),-0.01,-0.01,-0.01,SECONDRUINCOLOR)
5159sphere2(8,"Add",root.CFrame*CFrame.Angles(0,math.rad(270 - rotperm),0)*CFrame.new(0+4*math.sin(sine / 45),1.4-3*math.cos(sine / 45),2.5),vt(1,1,1),-0.01,-0.01,-0.01,SECONDRUINCOLOR)
5160end
5161if ModeOfGlitch==10 then
5162sphere2(8,"Add",root.CFrame*CFrame.new(0,-3,0),vt(0,1,0),0.15+GetClientProperty(kan,'PlaybackLoudness')/850,0.01,0.15+GetClientProperty(kan,'PlaybackLoudness')/850,SECONDRUINCOLOR)
5163else
5164sphere2(8,"Add",root.CFrame*CFrame.new(0,-3,0),vt(0,1,0),0.15,0.01,0.15,SECONDRUINCOLOR)
5165end
5166else
5167effar.Enabled = false
5168end
5169
5170if ModeOfGlitch == 1 then
5171local hitfloor2,posfloor2=rayCast(RootPart.Position,-RootPart.CFrame.upVector,100,Character)
5172if hitfloor2 then
5173sphereMK(5,math.random(2,12)/25,"Add",CFrame.new(posfloor2)*CFrame.Angles(0,math.rad(spin*5.4),0),3,1,9,0,SECONDRUINCOLOR,-1)
5174sphereMK(5,math.random(2,12)/25,"Add",CFrame.new(posfloor2)*CFrame.Angles(0,math.rad(90+spin*5.4),0),3,1,9,0,SECONDRUINCOLOR,0)
5175sphereMK(5,math.random(2,12)/25,"Add",CFrame.new(posfloor2)*CFrame.Angles(0,math.rad(180+spin*5.4),0),3,1,9,0,SECONDRUINCOLOR,0)
5176sphereMK(5,math.random(2,12)/25,"Add",CFrame.new(posfloor2)*CFrame.Angles(0,math.rad(270+spin*5.4),0),3,1,9,0,SECONDRUINCOLOR,0)
5177end
5178elseif ModeOfGlitch == 4 then
5179block2(10,4,"Add",CFrame.new(RootPart.Position)*CFrame.Angles(math.random(-120,120),math.random(-120,120),math.random(-120,120))*CFrame.new(0,0,math.random(-150,150)/10),vt(math.random(10,80)/30,math.random(10,80)/30,math.random(10,80)/30),0,0,0,MAINRUINCOLOR,SECONDRUINCOLOR.Color)
5180block2(10,4,"Add",CFrame.new(RootPart.Position)*CFrame.Angles(math.random(-120,120),math.random(-120,120),math.random(-120,120))*CFrame.new(0,0,math.random(-150,150)/10),vt(math.random(10,80)/30,math.random(10,80)/30,math.random(10,80)/30),0,0,0,MAINRUINCOLOR,SECONDRUINCOLOR.Color)
5181elseif ModeOfGlitch == 8 or ModeOfGlitch == 10 or ModeOfGlitch==12 or ModeOfGlitch==14 then
5182sphereMK(6,math.random(5,15)/45,"Add",root.CFrame*CFrame.new(math.random(-7,7),-5,math.random(-7,7))*CFrame.Angles(math.rad(90 + math.random(-3,3)),math.rad(math.random(-3,3)),math.rad(math.random(-3,3))),0.1,0.1,3,0,MAINRUINCOLOR,0)
5183sphereMK(6,math.random(5,15)/45,"Add",root.CFrame*CFrame.new(math.random(-7,7),-5,math.random(-7,7))*CFrame.Angles(math.rad(90 + math.random(-3,3)),math.rad(math.random(-3,3)),math.rad(math.random(-3,3))),0.1,0.1,3,0,SECONDRUINCOLOR,0)
5184elseif ModeOfGlitch == 11 then
5185if hitfloor ~= nil then
5186sphereMK(10,math.random(10,25)/45,"Add",root.CFrame*CFrame.new(math.random(-20,20),-5,math.random(-20,20))*CFrame.Angles(math.rad(90 + math.random(-5,5)),math.rad(math.random(-5,5)),math.rad(math.random(-5,5))),0.25,0.25,8,0,MAINRUINCOLOR,0)
5187sphereMK(10,math.random(10,25)/45,"Add",root.CFrame*CFrame.new(math.random(-20,20),-5,math.random(-20,20))*CFrame.Angles(math.rad(90 + math.random(-5,5)),math.rad(math.random(-5,5)),math.rad(math.random(-5,5))),0.25,0.25,8,0,SECONDRUINCOLOR,0)
5188end
5189elseif ModeOfGlitch == 2 or ModeOfGlitch == 3 or ModeOfGlitch==5 or ModeOfGlitch==6 then
5190sphereMK(6,math.random(5,15)/45,"Add",root.CFrame*CFrame.new(math.random(-10,10),-5,math.random(-10,10))*CFrame.Angles(math.rad(90 + math.random(-3,3)),math.rad(math.random(-3,3)),math.rad(math.random(-3,3))),0.2,0.2,3,0,MAINRUINCOLOR,0)
5191elseif ModeOfGlitch == 13 then
5192no=no+1
5193if no>4 then
5194no=0
5195sphereMK(2,math.random(5,15)/60,"Add",root.CFrame*CFrame.new(math.random(-10,10),-5,math.random(-10,10))*CFrame.Angles(math.rad(90 + math.random(-3,3)),math.rad(math.random(-3,3)),math.rad(math.random(-3,3))),1,1,1,0,MAINRUINCOLOR,0)
5196sphereMK(2,math.random(5,15)/60,"Add",root.CFrame*CFrame.new(math.random(-10,10),-5,math.random(-10,10))*CFrame.Angles(math.rad(90 + math.random(-3,3)),math.rad(math.random(-3,3)),math.rad(math.random(-3,3))),1,1,1,0,SECONDRUINCOLOR,0)
5197end
5198elseif ModeOfGlitch==15 and GetClientProperty(kan,'PlaybackLoudness')/850 > .4 then
5199 sphere2(8,"Add",root.CFrame*CFrame.new(0,-3,0),vt(0,1,0),0.05+GetClientProperty(kan,'PlaybackLoudness')/1000,0.01,0.05+GetClientProperty(kan,'PlaybackLoudness')/1000,SECONDRUINCOLOR)
5200
5201elseif ModeOfGlitch==16 then
5202sphere2(8,"Add",root.CFrame*CFrame.new(-2+4*math.sin(sine / 24)+.5*math.sin(sine/8),1.4+3*math.cos(sine / 28)+2*math.sin(sine / 34),1-3*math.sin(sine / 21)),vt(1,1,1),-0.01,-0.01,-0.01,MAINRUINCOLOR)
5203sphere2(8,"Add",root.CFrame*CFrame.new(2-4*math.sin(sine / 24)-.5*math.sin(sine/8),-1.4-3*math.cos(sine / 28)-2*math.sin(sine / 34),-1+3*math.sin(sine / 21)),vt(1,1,1),-0.01,-0.01,-0.01,SECONDRUINCOLOR)
5204
5205end
5206end
5207end))
5208
5209
5210for i,v in pairs(script.BloodCurse.BloodCurse:GetChildren()) do
5211v.Anchored = false
5212end
5213
5214rotperm = 0
5215
5216
5217Humanoid.Name = "ETHEREAL"
5218Humanoid.MaxHealth = math.huge
5219Humanoid.Health = math.huge
5220Instance.new("ForceField",char).Visible = false
5221
5222local bguis = Instance.new("BillboardGui",tors)
5223bguis.Size = UDim2.new(25, 0, 25, 0)
5224local imgca = Instance.new("ImageLabel",bguis)
5225imgca.BackgroundTransparency = 1
5226imgca.ImageTransparency = 1
5227imgca.Size = UDim2.new(1,0,1,0)
5228imgca.Image = "rbxassetid://2344830904" --997291547,521073910,2312119891,2344830904
5229imgca.ImageColor3 = Color3.new(0,0,0)
5230local rvalu = 0
5231
5232idleanim=.4
5233local hai=0
5234local hai2=1
5235local khhkh=0
5236local asine1=0
5237local asine2=0
5238local asine3=0
5239local hahahaaa={"Black","Crimson","Maroon","Bright red","Cocoa","Really red"}
5240while true do
5241 ggg()
5242if ModeOfGlitch==5 then
5243hai=hai+1
5244if hai>math.random(2,5) then
5245hai=0
5246if hai2==1 then
5247hai2=2
5248MAINRUINCOLOR = BrickColor.new("Really black")
5249SECONDRUINCOLOR = BrickColor.new("Really black")
5250else
5251hai2=1
5252MAINRUINCOLOR = BrickColor.new(hahahaaa[math.random(1,#hahahaaa)])
5253SECONDRUINCOLOR = BrickColor.new(hahahaaa[math.random(1,#hahahaaa)])
5254end
5255end
5256end
5257if khhkh<50 then
5258khhkh=khhkh+1
5259end
5260
5261if khhkh>12 then
5262
5263asine1=asine1+change
5264end
5265
5266if khhkh>24 then
5267asine2=asine2+change
5268end
5269
5270if khhkh>36 then
5271asine3=asine3+change
5272end
5273if mutedtog == false then
5274kan.Volume = currentVol
5275elseif mutedtog == true then
5276kan.Volume = 0
5277end
5278local what = math.random()*0.6
5279if ModeOfGlitch == 5 then
5280modet.TextStrokeColor3 = Color3.new(what,0,0)
5281modet.TextColor3 = Color3.new(math.random(0,255)/255,0,0)
5282for i, v in pairs(mwY:GetChildren()) do
5283if v:IsA("Part") then
5284v.Color = Color3.new(MRANDOM(0,1),0,0)
5285v.Material = "Neon"
5286end
5287end
5288for i, v in pairs(mw2:GetDescendants()) do
5289if v:IsA("Part") or v:IsA("BasePart") then
5290v.Color = Color3.new(what,0,0)
5291v.Material = "Neon"
5292v.Transparency = 0
5293elseif v:IsA("Trail") or v:IsA("ParticleEmitter") then
5294v.Color = ColorSequence.new(Color3.new(MRANDOM(0,1),0,0))
5295v.Enabled = true
5296end
5297end
5298for i, v in pairs(mw1:GetDescendants()) do
5299if v:IsA("Part") or v:IsA("BasePart") then
5300v.Color = Color3.new(MRANDOM(0,1),0,0)
5301v.Material = "Neon"
5302v.Transparency = 0
5303elseif v:IsA("Trail") or v:IsA("ParticleEmitter") then
5304v.Color = ColorSequence.new(Color3.new(MRANDOM(0,1),0,0))
5305v.Enabled = true
5306end
5307end
5308end
5309local what = math.random()*0.6
5310if ModeOfGlitch == 4 then
5311 local gay = math.random()
5312modet.TextStrokeColor3 = Color3.new(gay,gay,gay)
5313modet.TextColor3 = Color3.new(gay,gay,gay)
5314for i, v in pairs(mwY:GetChildren()) do
5315if v:IsA("Part") then
5316v.Color = Color3.new(gay,gay,gay)
5317v.Material = "Neon"
5318end
5319end
5320for i, v in pairs(mw2:GetDescendants()) do
5321if v:IsA("Part") or v:IsA("BasePart") then
5322v.Color = Color3.new(gay,gay,gay)
5323v.Material = "Neon"
5324v.Transparency = 0
5325elseif v:IsA("Trail") or v:IsA("ParticleEmitter") then
5326v.Color = ColorSequence.new(Color3.new(gay,gay,gay))
5327v.Enabled = true
5328end
5329end
5330for i, v in pairs(mw1:GetDescendants()) do
5331if v:IsA("Part") or v:IsA("BasePart") then
5332v.Color = Color3.new(gay,gay,gay)
5333v.Material = "Neon"
5334v.Transparency = 0
5335elseif v:IsA("Trail") or v:IsA("ParticleEmitter") then
5336v.Color = ColorSequence.new(Color3.new(gay,gay,gay))
5337v.Enabled = true
5338end
5339end
5340end
5341kan:ClearAllChildren()
5342local succ = pcall(function()
5343kan.PlaybackSpeed = currentPitch
5344end)
5345if(not succ)then
5346local tp = kan.TimePosition
5347kan = Instance.new("Sound",Torso)
5348kan.PlaybackSpeed = currentPitch
5349kan.TimePosition = tp
5350kan.Name = "wrecked"
5351kan.Looped = true
5352kan:Play()
5353end
5354pcall(function()
5355kan.Pitch = currentPitch
5356kan.Volume = currentVol
5357kan.SoundId = currentThemePlaying
5358kan.Looped = true
5359kan.Parent = Torso
5360kan:Resume()
5361end)
5362if ModeOfGlitch ~= 1264532489 and ModeOfGlitch ~= 101 and ModeOfGlitch ~= 090 and ModeOfGlitch ~= 103 and ModeOfGlitch ~= 55469696922 and ModeOfGlitch ~= 4367677813 and ModeOfGlitch ~= 9999999921111 and ModeOfGlitch ~= 999999999556 and ModeOfGlitch ~= 765688533321 and ModeOfGlitch ~= 88893333388 and ModeOfGlitch ~= 808080808080808080808080 then
5363imgca.ImageTransparency = 1
5364elseif ModeOfGlitch == 1264532489 or ModeOfGlitch == 101 or ModeOfGlitch == 103 or ModeOfGlitch == 55469696922 or ModeOfGlitch == 4367677813 or ModeOfGlitch == 9999999921111 or ModeOfGlitch == 999999999556 or ModeOfGlitch == 765688533321 or ModeOfGlitch == 88893333388 or ModeOfGlitch == 808080808080808080808080 then
5365imgca.ImageColor3 = MAINRUINCOLOR.Color
5366imgca.ImageTransparency = 0 + 0.25 * math.cos(sine / 30)
5367elseif ModeOfGlitch == 090 then
5368imgca.ImageColor3 = Color3.new(r/255,g/255,b/255)
5369imgca.ImageTransparency = 0 + 0.25 * math.cos(sine / 30)
5370end
5371imgca.Rotation = imgca.Rotation + 5 + GetClientProperty(kan,'PlaybackLoudness')/100
5372bguis.Size = UDim2.new(15 + 3 * math.cos(sine / 30),0, 15 + 3 * math.cos(sine / 30),0)
5373modet.Rotation = - 5 * math.cos(sine / 32)
5374nedf.Rotation = 0 - 2 * math.cos(sine / 24)
5375--nedf.Position = UDim2.new(0.7,0 - 10 * math.cos(sine / 32),0.8,0 - 10 * math.cos(sine / 45))
5376fullscreenz.BackgroundColor3 = SECONDRUINCOLOR.Color
5377fullscreenz.BorderColor3 = MAINRUINCOLOR.Color
5378hh1.BackgroundColor3 = MAINRUINCOLOR.Color
5379hh2.BackgroundColor3 = MAINRUINCOLOR.Color
5380hh3.BackgroundColor3 = MAINRUINCOLOR.Color
5381hh1.Position=UDim2.new(-.1-.02*math.cos(asine3/66), 0, .5, 0)
5382hh2.Position=UDim2.new(-.14-.02*math.cos(asine2/66), 0, .5, 0)
5383hh3.Position=UDim2.new(-.16-.02*math.cos(asine1/66), 0, .5, 0)
5384hh1.Rotation=0+.8*math.sin(asine1/66)
5385hh2.Rotation=0+.8*math.sin(asine2/66)
5386nedf.TextColor3=SECONDRUINCOLOR.Color
5387nedf.TextStrokeColor3=MAINRUINCOLOR.Color
5388fullscreenz.Rotation=0+.8*math.sin(sine/66)
5389vis1.BackgroundColor3 = MAINRUINCOLOR.Color
5390vis2.BackgroundColor3 = MAINRUINCOLOR.Color
5391vis3.BackgroundColor3 = MAINRUINCOLOR.Color
5392vis4.BackgroundColor3 = MAINRUINCOLOR.Color
5393vis5.BackgroundColor3 = MAINRUINCOLOR.Color
5394
5395vis1.Size = UDim2.new(.1, 0, 0+ GetClientProperty(kan,'PlaybackLoudness')/330, 0)
5396vis2.Size = UDim2.new(.07, 0, 0+ GetClientProperty(kan,'PlaybackLoudness')/410, 0)
5397vis3.Size = UDim2.new(.045, 0, 0+ GetClientProperty(kan,'PlaybackLoudness')/470, 0)
5398vis4.Size = UDim2.new(.03, 0, 0+ GetClientProperty(kan,'PlaybackLoudness')/540, 0)
5399vis5.Size = UDim2.new(.012, 0, 0+ GetClientProperty(kan,'PlaybackLoudness')/590, 0)
5400
5401CameraManager()
5402swait()
5403kan:Resume()
5404if ModeOfGlitch == 2 or ModeOfGlitch == 15 or ModeOfGlitch == 16 then
5405rvalu = rvalu + 0.25 + GetClientProperty(kan,'PlaybackLoudness')/90
5406else
5407rvalu = rvalu + 0.5
5408end
5409if ModeOfGlitch==2 then
5410handleweld.C0=clerp(handleweld.C0,cf(0,0,0)*angles(math.rad(0),math.rad(0),math.rad(0)),.3)
5411handlexweld.C0=clerp(handleweld.C0,cf(0,0,-0.3)*angles(math.rad(0),math.rad(0),math.rad(0)),.3)
5412lwing1weld.C1=clerp(lwing1weld.C1,cf(0,2.25- .25 * math.cos(sine / 38),1.85)*angles(math.rad(0),math.rad(0),math.rad(60 + rvalu)),.3)
5413lwing2weld.C1=clerp(lwing2weld.C1,cf(0,2.25- .25 * math.cos(sine / 38),1.85)*angles(math.rad(0),math.rad(0),math.rad(180 + rvalu)),.3)
5414lwing3weld.C1=clerp(lwing3weld.C1,cf(0,2.25- .25 * math.cos(sine / 38),1.85)*angles(math.rad(0),math.rad(0),math.rad(-60 + rvalu)),.3)
5415rwing1weld.C1=clerp(rwing1weld.C1,cf(0,3+ 1 * math.cos(sine / 38),1.25)*angles(math.rad(0),math.rad(0),math.rad(120 - rvalu)),.3)
5416rwing2weld.C1=clerp(rwing2weld.C1,cf(0,3+ 1 * math.cos(sine / 38),1.25)*angles(math.rad(0),math.rad(0),math.rad(-120 - rvalu)),.3)
5417rwing3weld.C1=clerp(rwing3weld.C1,cf(0,3+ 1 * math.cos(sine / 38),1.25)*angles(math.rad(0),math.rad(0),math.rad(0 - rvalu)),.3)
5418elseif ModeOfGlitch == 3 or ModeOfGlitch==16 then
5419handleweld.C0=clerp(handleweld.C0,cf(0,0,0)*angles(math.rad(0),math.rad(0),math.rad(0)),.3)
5420handlexweld.C0=clerp(handleweld.C0,cf(0,0,0)*angles(math.rad(0),math.rad(0),math.rad(0)),.3)
5421rwing1weld.C1=clerp(rwing1weld.C1,cf(-5.25,3+ 1 * math.cos(sine / 23.5),0)*angles(math.rad(0),math.rad(0),math.rad(0))*angles(math.rad(0),math.rad(0+ 20 * math.cos(sine / 47)),math.rad(135+ 10 * math.cos(sine / 47))),.3)
5422rwing2weld.C1=clerp(rwing2weld.C1,cf(0,-6 + 0.75 * math.cos(sine / 34),0)*angles(math.rad(0),math.rad(0),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(0 + 10 * math.cos(sine / 47))),.3)
5423rwing3weld.C1=clerp(rwing3weld.C1,cf(5.25,3+ 1 * math.cos(sine / 23.5),0)*angles(math.rad(0),math.rad(0),math.rad(0))*angles(math.rad(0),math.rad(0+ 20 * math.cos(sine / 47)),math.rad(-135+ 10 * math.cos(sine / 47))),.3)
5424lwing1weld.C1=clerp(lwing1weld.C1,cf(-3.75,-2,0)*angles(math.rad(0),math.rad(0),math.rad(0))*angles(math.rad(0),math.rad(0+ 20 * math.cos(sine / 47)),math.rad(-135+ 10 * math.cos(sine / 47))),.3)
5425lwing2weld.C1=clerp(lwing2weld.C1,cf(0,1 + 0.75 * math.cos(sine / 34),0)*angles(math.rad(0),math.rad(0),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(180 + 10 * math.cos(sine / 47))),.3)
5426lwing3weld.C1=clerp(lwing3weld.C1,cf(3.75,-2,0)*angles(math.rad(0),math.rad(0),math.rad(0))*angles(math.rad(0),math.rad(0+ 20 * math.cos(sine / 47)),math.rad(135+ 10 * math.cos(sine / 47))),.3)
5427elseif ModeOfGlitch==4 then
5428handleweld.C0=clerp(handleweld.C0,cf(0,0,0)*angles(math.rad(0),math.rad(0),math.rad(0)),.3)
5429handlexweld.C0=clerp(handleweld.C0,cf(0,0,-0.3)*angles(math.rad(0),math.rad(0),math.rad(0)),.3)
5430lwing1weld.C1=clerp(lwing1weld.C1,cf(2.25+MRANDOM(-1,1),0+MRANDOM(-1,1),1.75+MRANDOM(-1,1))*angles(math.rad(0),math.rad(0),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(0+MRANDOM(-15,15))),.3)
5431lwing2weld.C1=clerp(lwing2weld.C1,cf(5+MRANDOM(-1,1),0+MRANDOM(-1,1),1.75+MRANDOM(-1,1))*angles(math.rad(0),math.rad(0),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(0+MRANDOM(-15,15))),.3)
5432lwing3weld.C1=clerp(lwing3weld.C1,cf(7.75+MRANDOM(-1,1),0+MRANDOM(-1,1),1.75+MRANDOM(-1,1))*angles(math.rad(0),math.rad(0),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(0+MRANDOM(-15,15))),.3)
5433rwing1weld.C1=clerp(rwing1weld.C1,cf(-2.25+MRANDOM(-1,1),0+MRANDOM(-1,1),1.75+MRANDOM(-1,1))*angles(math.rad(0),math.rad(0),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(0+MRANDOM(-15,15))),.3)
5434rwing2weld.C1=clerp(rwing2weld.C1,cf(-5+MRANDOM(-1,1),0+MRANDOM(-1,1),1.75+MRANDOM(-1,1))*angles(math.rad(0),math.rad(0),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(0+MRANDOM(-15,15))),.3)
5435rwing3weld.C1=clerp(rwing3weld.C1,cf(-7.75+MRANDOM(-1,1),0+MRANDOM(-1,1),1.75+MRANDOM(-1,1))*angles(math.rad(0),math.rad(0),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(0+MRANDOM(-15,15))),.3)
5436elseif ModeOfGlitch == 5 then
5437lwing1weld.C1=clerp(lwing1weld.C1,cf(0 + 2.5 * math.cos(sine / 180),1.5 + 0.75 * math.cos(sine / 25),0)*angles(math.rad(0 + 1 * math.cos(sine / 50)),math.rad(0 - 2 * math.cos(sine / 36)),math.rad(90 + 3600 * math.cos(sine / 360))),.3)
5438lwing2weld.C1=clerp(lwing2weld.C1,cf(0 + 2.5 * math.cos(sine / 180),1.5 + 0.75 * math.cos(sine / 25),0)*angles(math.rad(0 + 1 * math.cos(sine / 70)),math.rad(0 - 2 * math.cos(sine / 37)),math.rad(147.5 + 3600 * math.cos(sine / 360))),.3)
5439lwing3weld.C1=clerp(lwing3weld.C1,cf(0 + 2.5 * math.cos(sine / 180),1.5 + 0.75 * math.cos(sine / 25),0)*angles(math.rad(0 + 1 * math.cos(sine / 60)),math.rad(0 - 2 * math.cos(sine / 51)),math.rad(32.5 + 3600 * math.cos(sine / 360))),.3)
5440rwing1weld.C1=clerp(rwing1weld.C1,cf(0 + 2.5 * math.cos(sine / 180),1.5 + 0.75 * math.cos(sine / 25),0)*angles(math.rad(0 + 1 * math.cos(sine / 50)),math.rad(0 - 2 * math.cos(sine / 36)),math.rad(-90 + 3600 * math.cos(sine / 360))),.3)
5441rwing2weld.C1=clerp(rwing2weld.C1,cf(0 + 2.5 * math.cos(sine / 180),1.5 + 0.75 * math.cos(sine / 25),0)*angles(math.rad(0 + 1 * math.cos(sine / 70)),math.rad(0 - 2 * math.cos(sine / 37)),math.rad(-147.5 + 3600 * math.cos(sine / 360))),.3)
5442rwing3weld.C1=clerp(rwing3weld.C1,cf(0 + 2.5 * math.cos(sine / 180),1.5 + 0.75 * math.cos(sine / 25),0)*angles(math.rad(0 + 1 * math.cos(sine / 60)),math.rad(0 - 2 * math.cos(sine / 51)),math.rad(-32.5 + 3600 * math.cos(sine / 360))),.3)
5443elseif ModeOfGlitch==11 then
5444handleweld.C0=clerp(handleweld.C0,cf(0,0,0)*angles(math.rad(0),math.rad(0),math.rad(0)),.3)
5445handlexweld.C0=clerp(handleweld.C0,cf(0,0,-0.3)*angles(math.rad(0),math.rad(0),math.rad(0)),.3)
5446lwing1weld.C1=clerp(lwing1weld.C1,cf(-3- 0.75 * math.cos(sine / 32),1.5+ 0.5 * math.cos(sine / 18),1)*angles(math.rad(0),math.rad(0),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(0 - 7.5 * math.cos(sine / 16))),.3)
5447lwing2weld.C1=clerp(lwing2weld.C1,cf(0,4+ 0.5 * math.cos(sine / 18),1)*angles(math.rad(0),math.rad(0),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(180)),.3)
5448lwing3weld.C1=clerp(lwing3weld.C1,cf(3+ 0.75 * math.cos(sine / 32),1.5+ 0.5 * math.cos(sine / 18),1)*angles(math.rad(0),math.rad(0),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(0 + 7.5 * math.cos(sine / 16))),.3)
5449rwing1weld.C1=clerp(rwing1weld.C1,cf(-3- 0.75 * math.cos(sine / 32),4+ 0.5 * math.cos(sine / 18),1)*angles(math.rad(0),math.rad(0),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(180 - 7.5 * math.cos(sine / 16))),.3)
5450rwing2weld.C1=clerp(rwing2weld.C1,cf(0,1.5+ 0.5 * math.cos(sine / 18),1)*angles(math.rad(0),math.rad(0),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(0)),.3)
5451rwing3weld.C1=clerp(rwing3weld.C1,cf(3+ 0.75 * math.cos(sine / 32),4+ 0.5 * math.cos(sine / 18),1)*angles(math.rad(0),math.rad(0),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(180 + 7.5 * math.cos(sine / 16))),.3)
5452elseif ModeOfGlitch==12 or ModeOfGlitch==13 then
5453handleweld.C0=clerp(handleweld.C0,cf(0,0,0)*angles(math.rad(0),math.rad(0),math.rad(0)),.3)
5454handlexweld.C0=clerp(handleweld.C0,cf(0,0,-0.3)*angles(math.rad(0),math.rad(0),math.rad(0)),.3)
5455lwing1weld.C1=clerp(lwing1weld.C1,cf(2.25-0.25*math.cos(sine / 32),0,1.75)*angles(math.rad(0),math.rad(0),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(0 + 5 * math.cos(sine / 16))),.3)
5456lwing2weld.C1=clerp(lwing2weld.C1,cf(5-0.5*math.cos(sine / 32),0,1.75)*angles(math.rad(0),math.rad(0),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(0 + 7.5 * math.cos(sine / 16))),.3)
5457lwing3weld.C1=clerp(lwing3weld.C1,cf(7.75-0.75*math.cos(sine / 32),0,1.75)*angles(math.rad(0),math.rad(0),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(0 + 10 * math.cos(sine / 16))),.3)
5458rwing1weld.C1=clerp(rwing1weld.C1,cf(-2.25+0.25*math.cos(sine / 32),0,1.75)*angles(math.rad(0),math.rad(0),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(-0 - 5 * math.cos(sine / 16))),.3)
5459rwing2weld.C1=clerp(rwing2weld.C1,cf(-5+0.5*math.cos(sine / 32),0,1.75)*angles(math.rad(0),math.rad(0),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(-0 - 7.5 * math.cos(sine / 16))),.3)
5460rwing3weld.C1=clerp(rwing3weld.C1,cf(-7.75+0.75*math.cos(sine / 32),0,1.75)*angles(math.rad(0),math.rad(0),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(-0 - 10 * math.cos(sine / 16))),.3)
5461elseif ModeOfGlitch==14 then
5462handleweld.C0=clerp(handleweld.C0,cf(0,0,0)*angles(math.rad(0),math.rad(0),math.rad(0)),.3)
5463handlexweld.C0=clerp(handleweld.C0,cf(0,0,-0.3)*angles(math.rad(0),math.rad(0),math.rad(0)),.3)
5464lwing1weld.C1=clerp(lwing1weld.C1,cf(0,2.25- .25 * math.cos(sine / 38),1.85)*angles(math.rad(0),math.rad(0),math.rad(60 - 3600 * math.cos(sine / 360))),.3)
5465lwing2weld.C1=clerp(lwing2weld.C1,cf(0,2.25- .25 * math.cos(sine / 38),1.85)*angles(math.rad(0),math.rad(0),math.rad(180 - 3600 * math.cos(sine / 360))),.3)
5466lwing3weld.C1=clerp(lwing3weld.C1,cf(0,2.25- .25 * math.cos(sine / 38),1.85)*angles(math.rad(0),math.rad(0),math.rad(-60 - 3600 * math.cos(sine / 360))),.3)
5467rwing1weld.C1=clerp(rwing1weld.C1,cf(0,3+ 1 * math.cos(sine / 38),1.25)*angles(math.rad(0),math.rad(0),math.rad(120 + 3600 * math.cos(sine / 360))),.3)
5468rwing2weld.C1=clerp(rwing2weld.C1,cf(0,3+ 1 * math.cos(sine / 38),1.25)*angles(math.rad(0),math.rad(0),math.rad(-120 + 3600 * math.cos(sine / 360))),.3)
5469rwing3weld.C1=clerp(rwing3weld.C1,cf(0,3+ 1 * math.cos(sine / 38),1.25)*angles(math.rad(0),math.rad(0),math.rad(0 + 3600 * math.cos(sine / 360))),.3)
5470elseif ModeOfGlitch==15 then
5471for i = 6, 2, -1 do
5472 visWings[i]=visWings[i-1]
5473end
5474visWings[1]=GetClientProperty(kan,'PlaybackLoudness')/250
5475handleweld.C0=clerp(handleweld.C0,cf(0,0,0)*angles(math.rad(0),math.rad(0),math.rad(0)),.3)
5476handlexweld.C0=clerp(handleweld.C0,cf(0,0,-0.3)*angles(math.rad(0),math.rad(0),math.rad(0)),.3)
5477lwing1weld.C1=clerp(lwing1weld.C1,cf(2.25,0+visWings[3],1.75)*angles(math.rad(0),math.rad(0),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(0 + 1.25 * math.cos(sine / 32))),.3)
5478lwing2weld.C1=clerp(lwing2weld.C1,cf(5,0+visWings[2],1.75)*angles(math.rad(0),math.rad(0),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(0 + 1.875 * math.cos(sine / 32))),.3)
5479lwing3weld.C1=clerp(lwing3weld.C1,cf(7.75,0+visWings[1],1.75)*angles(math.rad(0),math.rad(0),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(0 + 2.5 * math.cos(sine / 32))),.3)
5480rwing1weld.C1=clerp(rwing1weld.C1,cf(-2.25,0+visWings[6],1.75)*angles(math.rad(0),math.rad(0),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(-0 - 1.25 * math.cos(sine / 32))),.3)
5481rwing2weld.C1=clerp(rwing2weld.C1,cf(-5,0+visWings[5],1.75)*angles(math.rad(0),math.rad(0),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(-0 - 1.875 * math.cos(sine / 32))),.3)
5482rwing3weld.C1=clerp(rwing3weld.C1,cf(-7.75,0+visWings[4],1.75)*angles(math.rad(0),math.rad(0),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(-0 - 2.5 * math.cos(sine / 32))),.3)
5483
5484else
5485handleweld.C0=clerp(handleweld.C0,cf(0,0,0)*angles(math.rad(0),math.rad(0),math.rad(0)),.3)
5486handlexweld.C0=clerp(handleweld.C0,cf(0,0,-0.3)*angles(math.rad(0),math.rad(0),math.rad(0)),.3)
5487lwing1weld.C1=clerp(lwing1weld.C1,cf(2.25,0,1.75)*angles(math.rad(0),math.rad(0),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(0 + 5 * math.cos(sine / 32))),.3)
5488lwing2weld.C1=clerp(lwing2weld.C1,cf(5,0,1.75)*angles(math.rad(0),math.rad(0),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(0 + 7.5 * math.cos(sine / 32))),.3)
5489lwing3weld.C1=clerp(lwing3weld.C1,cf(7.75,0,1.75)*angles(math.rad(0),math.rad(0),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(0 + 10 * math.cos(sine / 32))),.3)
5490rwing1weld.C1=clerp(rwing1weld.C1,cf(-2.25,0,1.75)*angles(math.rad(0),math.rad(0),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(-0 - 5 * math.cos(sine / 32))),.3)
5491rwing2weld.C1=clerp(rwing2weld.C1,cf(-5,0,1.75)*angles(math.rad(0),math.rad(0),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(-0 - 7.5 * math.cos(sine / 32))),.3)
5492rwing3weld.C1=clerp(rwing3weld.C1,cf(-7.75,0,1.75)*angles(math.rad(0),math.rad(0),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(-0 - 10 * math.cos(sine / 32))),.3)
5493end
5494 sine = sine + change
5495SINE=SINE+change
5496if(ModeOfGlitch==16)then
5497
5498end
5499
5500local torvel=(RootPart.Velocity*Vector3.new(1,0,1)).magnitude
5501local velderp=RootPart.Velocity.y
5502hitfloor,posfloor=rayCast(RootPart.Position,(CFrame.new(RootPart.Position,RootPart.Position - Vector3.new(0,1,0))).lookVector,4,Character)
5503if equipped==true or equipped==false then
5504if attack==false then
5505idle=idle+1
5506else
5507idle=0
5508end
5509if idle>=500 then
5510if attack==false then
5511--Sheath()
5512end
5513end
5514if RootPart.Velocity.y > 1 and hitfloor==nil then
5515Anim="Jump"
5516if attack==false then
5517RH.C0=clerp(RH.C0,cf(1,-0.35 - 0.05 * math.cos(sine / 25),-0.75)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(-5),math.rad(0),math.rad(-20)),.1)
5518LH.C0=clerp(LH.C0,cf(-1,-1 - 0.05 * math.cos(sine / 25),0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(-5),math.rad(0),math.rad(20)),.1)
5519RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,0 + 0.05 * math.cos(sine / 25))*angles(math.rad(-10),math.rad(0),math.rad(0)),.1)
5520Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(-2.5),math.rad(0),math.rad(0)),.1)
5521RW.C0=clerp(RW.C0,cf(1.45,0.5 + 0.1 * math.cos(sine / 25),0)*angles(math.rad(-5),math.rad(0),math.rad(25)),.1)
5522LW.C0=clerp(LW.C0,cf(-1.45,0.5 + 0.1 * math.cos(sine / 25),0)*angles(math.rad(-5),math.rad(0),math.rad(-25)),.1)
5523end
5524elseif RootPart.Velocity.y < -1 and hitfloor==nil then
5525Anim="Fall"
5526if attack==false then
5527RH.C0=clerp(RH.C0,cf(1,-0.35 - 0.05 * math.cos(sine / 25),-0.75)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(-5),math.rad(0),math.rad(-20)),.1)
5528LH.C0=clerp(LH.C0,cf(-1,-1 - 0.05 * math.cos(sine / 25),0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(-5),math.rad(0),math.rad(20)),.1)
5529RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,0 + 0.05 * math.cos(sine / 25))*angles(math.rad(10),math.rad(0),math.rad(0)),.1)
5530Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(2.5),math.rad(0),math.rad(0)),.1)
5531RW.C0=clerp(RW.C0,cf(1.45,0.5 + 0.1 * math.cos(sine / 25),0)*angles(math.rad(-15),math.rad(0),math.rad(55)),.1)
5532LW.C0=clerp(LW.C0,cf(-1.45,0.5 + 0.1 * math.cos(sine / 25),0)*angles(math.rad(-15),math.rad(0),math.rad(-55)),.1)
5533end
5534elseif torvel<1 and hitfloor~=nil then
5535Anim="Idle"
5536if attack==false then
5537if ModeOfGlitch == 2 then
5538RH.C0=clerp(RH.C0,cf(1,-1 - 0.05 * math.cos(sine / 32),0)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(-3),math.rad(0 - 1 * math.cos(sine / 56)),math.rad(1 - 2 * math.cos(sine / 32))),.1)
5539LH.C0=clerp(LH.C0,cf(-1,-1 - 0.05 * math.cos(sine / 32),0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(-3),math.rad(0 - 1 * math.cos(sine / 56)),math.rad(-1 + 2 * math.cos(sine / 32))),.1)
5540RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0.02 + 0.02 * math.cos(sine / 32),0 + 0.05 * math.cos(sine / 32))*angles(math.rad(2 - 2 * math.cos(sine / 32)),math.rad(0),math.rad(0 - 1 * math.cos(sine / 44))),.1)
5541Torso.Neck.C0=clerp(Torso.Neck.C0,necko*cf(0, 0, 0 + ((1) - 1))*angles(math.rad(25 - 2.5 * math.sin(sine / 32)),math.rad(0),math.rad(0 - 5 * math.sin(sine / 95))),0.1)
5542RW.C0=clerp(RW.C0,cf(1,0.4,-0.45)*angles(math.rad(82 + 6 * math.cos(sine / 72)),math.rad(3 - 1 * math.cos(sine / 58)),math.rad(-82 + 2 * math.cos(sine / 45))),.1)
5543LW.C0=clerp(LW.C0,cf(-1,0.55,-0.5)*angles(math.rad(69 - 7 * math.cos(sine / 66)),math.rad(4 - 2 * math.cos(sine / 59)),math.rad(61 - 4 * math.cos(sine / 45))),.1)
5544elseif ModeOfGlitch == 3 then
5545local snap = math.random(1,32)
5546if snap == 1 then
5547Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(22 - 8.5 * math.cos(sine / 41)+MRANDOM(-35,15)),math.rad(0 + 1 * math.cos(sine / 57)+MRANDOM(-65,65)),math.rad(0 - 30 * math.cos(sine / 47)+MRANDOM(-65,65))),.4)
5548end
5549RH.C0=clerp(RH.C0,cf(1,-1 - 0.05 * math.cos(sine / 32),0)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(-3),math.rad(0 - 1 * math.cos(sine / 56)),math.rad(1 - 2 * math.cos(sine / 32))),.1)
5550LH.C0=clerp(LH.C0,cf(-1,-1 - 0.05 * math.cos(sine / 32),0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(-3),math.rad(0 - 1 * math.cos(sine / 56)),math.rad(-1 + 2 * math.cos(sine / 32))),.1)
5551RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0.02 + 0.02 * math.cos(sine / 32),0 + 0.05 * math.cos(sine / 32))*angles(math.rad(2 - 2 * math.cos(sine / 32)),math.rad(0),math.rad(0 - 1 * math.cos(sine / 44))),.1)
5552Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(22 - 8.5 * math.cos(sine / 41)),math.rad(0 + 1 * math.cos(sine / 57)),math.rad(0 - 30 * math.cos(sine / 47))),.1)
5553RW.C0=clerp(RW.C0,cf(1,0.5 + 0.025 * math.cos(sine / 45),0.45)*angles(math.rad(-33 + 5 * math.cos(sine / 74)),math.rad(1 - 3 * math.cos(sine / 53)),math.rad(-33 - 10 * math.cos(sine / 47))),.1)
5554LW.C0=clerp(LW.C0,cf(-1,0.5 + 0.025 * math.cos(sine / 45),0.45)*angles(math.rad(-23 - 3 * math.cos(sine / 73)),math.rad(2 - 1 * math.cos(sine / 55)),math.rad(33 - 10 * math.cos(sine / 47))),.1)
5555elseif ModeOfGlitch == 4 then
5556local snap = math.random(1,24)
5557if snap == 1 then
5558Torso.Neck.C0=clerp(Torso.Neck.C0,necko*cf(0, 0, 0 + ((1) - 1))*angles(math.rad(35+math.random(-50,50)),math.rad(10+math.random(-50,50)),math.rad(0+math.random(-50,50))),.5)
5559end
5560local snap = math.random(1,78)
5561if snap == 1 then
5562Torso.Neck.C0=clerp(Torso.Neck.C0,necko*cf(0, 0, 0 + ((1) - 1))*angles(math.rad(35+math.random(-100,100)),math.rad(10+math.random(-100,100)),math.rad(0+math.random(-100,100))),.5)
5563end
5564RH.C0=clerp(RH.C0,cf(1,-1,0)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(-3.5+ 1 * math.cos(sine / 45)),math.rad(0),math.rad(0)),.1)
5565LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(-3.5+ 1 * math.cos(sine / 45)),math.rad(0),math.rad(0)),.1)
5566RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0 + 0.02 * math.cos(sine / 45),1 + 0.25 * math.cos(sine / 45))*angles(math.rad(0 - 2 * math.cos(sine / 45)+math.random(-5,5)),math.rad(0+math.random(-5,5)),math.rad(0+math.random(-5,5))),.1)
5567Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(23 - 2 * math.cos(sine / 37)+math.random(-5,5)),math.rad(0 + 1 * math.cos(sine / 58)+math.random(-5,5)),math.rad(0 + 2 * math.cos(sine / 53)+math.random(-5,5))),.1)
5568RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*angles(math.rad(2 + 5 * math.cos(sine / 74)+math.random(-5,5)),math.rad(1 - 3 * math.cos(sine / 53)+math.random(-5,5)),math.rad(14 + 5 * math.sin(sine / 45)+math.random(-5,5))),.1)
5569LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*angles(math.rad(5 - 3 * math.cos(sine / 73)+math.random(-5,5)),math.rad(2 - 1 * math.cos(sine / 55)+math.random(-5,5)),math.rad(-14 - 6 * math.sin(sine / 45)+math.random(-5,5))),.1)
5570elseif ModeOfGlitch == 5 then
5571RH.C0=clerp(RH.C0,cf(1,-1 - 0.1 * math.cos(sine / 24),0)*angles(math.rad(0),math.rad(80),math.rad(17 - 2 * math.cos(sine / 32)))*angles(math.rad(-3),math.rad(-5.5 - 2 * math.cos(sine / 56)),math.rad(-12 - 2 * math.cos(sine / 32))),.1)
5572LH.C0=clerp(LH.C0,cf(-1,-1 - 0.1 * math.cos(sine / 24),0)*angles(math.rad(0),math.rad(-82),math.rad(-17 - 2 * math.cos(sine / 32)))*angles(math.rad(-6),math.rad(22 - 2 * math.cos(sine / 56)),math.rad(-1 + 2 * math.cos(sine / 32))),.1)
5573RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,0 + 0.1 * math.cos(sine / 24))*angles(math.rad(15 - 2 * math.cos(sine / 32)),math.rad(0),math.rad(-22 + 2 * math.cos(sine / 56))),.1)
5574Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(15 - 2 * math.cos(sine / 37)),math.rad(0 + 1.8 * math.cos(sine / 43) - 5 * math.cos(sine / 0.25)),math.rad(22 - 2 * math.cos(sine / 56))),.1)
5575RW.C0=clerp(RW.C0,cf(1.35,0.4 + 0.025 * math.cos(sine / 30),0)*angles(math.rad(25 + 3 * math.cos(sine / 30)),math.rad(0),math.rad(-20 + 2 * math.cos(sine / 30))),.1)
5576LW.C0=clerp(LW.C0,cf(-1.5,0.5 + 0.025 * math.cos(sine / 30),0)*angles(math.rad(-25 + 2 * math.cos(sine / 30)),math.rad(0),math.rad(-12 + 5 * math.cos(sine / 30))),.1)
5577elseif ModeOfGlitch == 6 then -- soon to change anim
5578RH.C0=clerp(RH.C0,cf(1,-1 - 0.1 * math.cos(sine / 24),0)*angles(math.rad(0),math.rad(80),math.rad(17 - 2 * math.cos(sine / 32)))*angles(math.rad(-3),math.rad(5.5 - 2 * math.cos(sine / 56)),math.rad(1 - 2 * math.cos(sine / 32))),.1)
5579LH.C0=clerp(LH.C0,cf(-1,-1 - 0.1 * math.cos(sine / 24),0)*angles(math.rad(0),math.rad(-82),math.rad(-17 - 2 * math.cos(sine / 32)))*angles(math.rad(-6),math.rad(-22 - 2 * math.cos(sine / 56)),math.rad(12 + 2 * math.cos(sine / 32))),.1)
5580RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,0 + 0.1 * math.cos(sine / 24))*angles(math.rad(15 - 2 * math.cos(sine / 32)),math.rad(0),math.rad(22 + 2 * math.cos(sine / 56))),.1)
5581Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(15 - 2 * math.cos(sine / 37)),math.rad(0 + 1.8 * math.cos(sine / 43) - 5 * math.cos(sine / 0.25)),math.rad(-22 - 2 * math.cos(sine / 56))),.1)
5582RW.C0=clerp(RW.C0,cf(1.5,0.5 + 0.025 * math.cos(sine / 45),0)*angles(math.rad(5 + 3 * math.cos(sine / 43)),math.rad(-16 - 5 * math.cos(sine / 52)),math.rad(13 + 9 * math.cos(sine / 45))),.1)
5583LW.C0=clerp(LW.C0,cf(-1.5,0.5 + 0.025 * math.cos(sine / 45),0)*angles(math.rad(7 - 2 * math.cos(sine / 51)),math.rad(0 - 4 * math.cos(sine / 64)),math.rad(-22 - 2 * math.cos(sine / 45))),.1)
5584elseif ModeOfGlitch == 7 then -- Cursed by Unfair
5585local rsiz = math.random(1,2)
5586sphereMK(math.random(3,6),math.random(-25,25)/750,"Add",sorb2.CFrame*CFrame.new(math.random(-20,20)/50,math.random(-20,20)/50,math.random(-20,20)/50)*CFrame.Angles(math.rad(90 + math.random(-360,360)),math.rad(math.random(-360,360)),math.rad(math.random(-360,360))),rsiz/10,rsiz/10,rsiz/10,0,MAINRUINCOLOR,0)
5587sphereMK(math.random(6,9),math.random(-10,10)/750,"Add",sorb2.CFrame*CFrame.new(math.random(-5,5)/50,math.random(-5,5)/50,math.random(-5,5)/50)*CFrame.Angles(math.rad(90 + math.random(-360,360)),math.rad(math.random(-360,360)),math.rad(math.random(-360,360))),rsiz/3,rsiz/3,rsiz/3,0,MAINRUINCOLOR,0)
5588RH.C0=clerp(RH.C0,cf(1,-1 - 0.05 * math.cos(sine / 32),0)*angles(math.rad(-5),math.rad(90),math.rad(-5)),.1)
5589LH.C0=clerp(LH.C0,cf(-1,-1 - 0.05 * math.cos(sine / 32),0)*angles(math.rad(5),math.rad(-90),math.rad(5)),.1)
5590RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0.01 + 0.001 * math.cos(sine / 32),0 + 0.05 * math.cos(sine / 32))*angles(math.rad(2 - 2 * math.cos(sine / 32)),math.rad(0),math.rad(-20 - 1 * math.cos(sine / 44))),.1)
5591Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(22 - 8.5 * math.cos(sine / 41)+MRANDOM(-5,5)),math.rad(0 + 1 * math.cos(sine / 57)+MRANDOM(-5,5)),math.rad(20 + 10 * math.cos(sine / 47)+MRANDOM(-5,5))),.1)
5592RW.C0=clerp(RW.C0,cf(1.5,0.5 + 0.025 * math.cos(sine / 45),0)*angles(math.rad(10 + 3 * math.cos(sine / 43)),math.rad(35 - 2 * math.cos(sine / 52)),math.rad(13 + 0.9 * math.cos(sine / 45))),.1)
5593LW.C0=clerp(LW.C0,cf(-1.5,0.5 + 0.025 * math.cos(sine / 45),0)*angles(math.rad(134 - 0.2 * math.cos(sine / 51)),math.rad(0 - 4 * math.cos(sine / 64)),math.rad(47 - 0.2 * math.cos(sine / 45))),.1)
5594elseif ModeOfGlitch == 8 then -- Accession by Unfair
5595RH.C0=clerp(RH.C0,cf(1,-0.4,-0.5)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(-3),math.rad(0 - 1 * math.cos(sine / 56)),math.rad(-10 - 7 * math.cos(sine / 56))),.1)
5596LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(-3),math.rad(0 - 1 * math.cos(sine / 56)),math.rad(10 + 3 * math.cos(sine / 52))),.1)
5597RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,1.4 + 0.5 * math.cos(sine / 32))*angles(math.rad(2 - 2 * math.cos(sine / 32)),math.rad(0),math.rad(0 - 1 * math.cos(sine / 44))),.1)
5598Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(15 - 2.5 * math.cos(sine / 41)),math.rad(0 + 1 * math.cos(sine / 57)),math.rad(0 - 0.3 * math.cos(sine / 47))),.1)
5599RW.C0=clerp(RW.C0,cf(1,0.5 + 0.025 * math.cos(sine / 45),-0.5)*angles(math.rad(90 + 6 * math.cos(sine / 72)),math.rad(3 - 2 * math.cos(sine / 58)),math.rad(-80 + 2 * math.cos(sine / 45))),.3)
5600LW.C0=clerp(LW.C0,cf(-1,0.5 + 0.025 * math.cos(sine / 45),-0.5)*angles(math.rad(80 - 7 * math.cos(sine / 66)),math.rad(4 - 3 * math.cos(sine / 59)),math.rad(71 - 4 * math.cos(sine / 45))),.3)
5601elseif ModeOfGlitch == 9 then -- Descented by Unfair
5602RH.C0=clerp(RH.C0,cf(1,-1 - 0.05 * math.cos(sine / 32),0)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(-3),math.rad(0 - 1 * math.cos(sine / 56)),math.rad(1 - 2 * math.cos(sine / 32))),.1)
5603LH.C0=clerp(LH.C0,cf(-1,-1 - 0.05 * math.cos(sine / 32),0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(-3),math.rad(0 - 1 * math.cos(sine / 56)),math.rad(-1 + 2 * math.cos(sine / 32))),.1)
5604RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0.02 + 0.02 * math.cos(sine / 32),0 + 0.05 * math.cos(sine / 32))*angles(math.rad(2 - 2 * math.cos(sine / 32)),math.rad(0),math.rad(0 - 1 * math.cos(sine / 44))),.1)
5605Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(22 - 3 * math.cos(sine / 37)),math.rad(0 + 1 * math.cos(sine / 58)),math.rad(0 + 2 * math.cos(sine / 53))),.1)
5606RW.C0=clerp(RW.C0,cf(1,0.5 + 0.05 * math.cos(sine / 45),0.45)*angles(math.rad(-23 + 6 * math.cos(sine / 74)),math.rad(1 - 2 * math.cos(sine / 53)),math.rad(-53 + 3 * math.cos(sine / 45))),.1)
5607LW.C0=clerp(LW.C0,cf(-1,0.5 + 0.05 * math.cos(sine / 45),-0.5)*angles(math.rad(84 - 3 * math.cos(sine / 73)),math.rad(8 - 5 * math.cos(sine / 55)),math.rad(80 - 3 * math.cos(sine / 45))),.1)
5608elseif ModeOfGlitch == 10 then
5609local snap = math.random(1,100)
5610if snap == 1 then
5611Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(23 + math.random(-5,5)),math.rad(math.random(-5,5)),math.rad(22 + math.random(-5,5))),1)
5612end
5613RH.C0=clerp(RH.C0,cf(1,-0.5,-0.6)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(1.5),math.rad(0),math.rad(-20 - 5 * math.cos(sine / 34))),.2)
5614LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(-6),math.rad(22 - 2 * math.cos(sine / 56)),math.rad(-1 + 2 * math.cos(sine / 32))),.1)
5615RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,1.4 + 0.5 * math.cos(sine / 32))*angles(math.rad(0 - 1 * math.cos(sine / 34)),math.rad(0),math.rad(-35)),.1)
5616Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(5 - 3 * math.cos(sine / 45)),math.rad(0),math.rad(34)),.1)
5617RW.C0=clerp(RW.C0,cf(1.5,0.5 + 0.1 * math.cos(sine / 70),0)*angles(math.rad(0 + 1 * math.cos(sine / 0.0001) ),math.rad(0),math.rad(10 + 1 * math.cos(sine / 0.0001))),.1)
5618LW.C0=clerp(LW.C0,cf(-1.1,0.6 + 0.1 * math.cos(sine / 28),0.2)*angles(math.rad(220),math.rad(0),math.rad(45 + 1 * math.cos(sine / 50))),.1)
5619elseif ModeOfGlitch == 11 then
5620RH.C0=clerp(RH.C0,cf(1,-1 - 0.1 * math.cos(sine / 32),0)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(-3),math.rad(-5.5 - 2 * math.cos(sine / 56)),math.rad(-12 - 2 * math.cos(sine / 32))),.1)
5621LH.C0=clerp(LH.C0,cf(-1,-1 - 0.1 * math.cos(sine / 32),0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(-6),math.rad(22 - 2 * math.cos(sine / 56)),math.rad(-1 + 2 * math.cos(sine / 32))),.1)
5622RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0.01 + 0.03 * math.cos(sine / 32),0 + 0.1 * math.cos(sine / 32))*angles(math.rad(1 - 4 * math.cos(sine / 32)),math.rad(0),math.rad(-22 + 2 * math.cos(sine / 56))),.1)
5623Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(15 - 6 * math.cos(sine / 32)),math.rad(0 + 2 * math.cos(sine / 58)),math.rad(0 + 5 * math.sin(sine / 32))),.1)
5624RW.C0 = clerp(RW.C0, CF(1.1, 0.4 + 0.05 * Sin(sine / 30), 0.025 * Cos(sine / 20)) * angles(Rad(-30), Rad(-0), Rad(-30)), 0.1)
5625LW.C0=clerp(LW.C0,cf(-1,0.5 + 0.025 * math.cos(sine / 45),-0.5)*angles(math.rad(89 - 7 * math.cos(sine / 66)),math.rad(4 - 3 * math.cos(sine / 59)),math.rad(67 - 4 * math.cos(sine / 45))),.1)
5626elseif ModeOfGlitch == 12 then
5627RH.C0=clerp(RH.C0,cf(1,-1.3,-0.6)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(30),math.rad(0 - 1 * math.cos(sine / 56)),math.rad(15 - 2 * math.cos(sine / 39))),.1)
5628LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(0),math.rad(0 - 1 * math.cos(sine / 56)),math.rad(0 + 6 * math.cos(sine / 31))),.1)
5629RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0 + 0.02 * math.cos(sine / 32),1 + 0.15 * math.cos(sine / 32))*angles(math.rad(-66 - 2 * math.cos(sine / 32)),math.rad(0),math.rad(0)),.1)
5630Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(0 - 2 * math.cos(sine / 37)),math.rad(0 + 1 * math.cos(sine / 58)),math.rad(0 + 2 * math.cos(sine / 53))),.1)
5631RW.C0=clerp(RW.C0,cf(1,0.5 + 0.025 * math.cos(sine / 45),0.45)*angles(math.rad(183 + 5 * math.cos(sine / 74)),math.rad(1 - 3 * math.cos(sine / 53)),math.rad(-33 + 3 * math.cos(sine / 45))),.1)
5632LW.C0=clerp(LW.C0,cf(-1,0.5 + 0.025 * math.cos(sine / 45),0.45)*angles(math.rad(183 - 3 * math.cos(sine / 73)),math.rad(2 - 1 * math.cos(sine / 55)),math.rad(33 - 3 * math.cos(sine / 45))),.1)
5633elseif ModeOfGlitch == 13 then
5634RH.C0=clerp(RH.C0,cf(1,-1 - 0.05 * math.cos(sine / 28),0)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(-2.5),math.rad(0),math.rad(0 + 1 * math.cos(sine / 34))),.1)
5635LH.C0=clerp(LH.C0,cf(-1,-1 + 0.05 * math.cos(sine / 28),0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(-2.5),math.rad(20),math.rad(0 + 1 * math.cos(sine / 34))),.1)
5636RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,0 + 0.05 * math.cos(sine / 28))*angles(math.rad(0 - 1 * math.cos(sine / 34)),math.rad(0),math.rad(0)),.1)
5637Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(5 - 2.5 * math.cos(sine / 28)),math.rad(20),math.rad(0)),.1)
5638RW.C0=clerp(RW.C0,cf(1.5,0.5 + 0.05 * math.cos(sine / 28),0)*angles(math.rad(180),math.rad(45),math.rad(0)),.1)
5639LW.C0=clerp(LW.C0,cf(-1.5,0.5 + 0.05 * math.cos(sine / 28),0)*angles(math.rad(0),math.rad(0),math.rad(10)),.1)
5640elseif ModeOfGlitch == 14 then
5641RH.C0=clerp(RH.C0,cf(1,-1 + 0.05 * math.cos(sine / 28),0)*angles(math.rad(-10),math.rad(90),math.rad(0))*angles(math.rad(-5),math.rad(0),math.rad(0 + 1 * math.cos(sine / 34))),.1)
5642LH.C0=clerp(LH.C0,cf(-1,-1 + 0.05 * math.cos(sine / 28),0)*angles(math.rad(-10),math.rad(-90),math.rad(0))*angles(math.rad(-5),math.rad(0),math.rad(0 + 1 * math.cos(sine / 34))),.1)
5643RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0 + 0.01 * math.cos(sine / 32),2 + 0.35 * math.cos(sine / 32))*angles(math.rad(0 - 2 * math.cos(sine / 18)),math.rad(0),math.rad(0)),.1)
5644Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(13 - 5 * math.cos(sine / 0.5265)),math.rad(0 - 5 * math.cos(sine / 0.25)),math.rad(-15 - 5 * math.cos(sine / 62))),.1)
5645RW.C0=clerp(RW.C0,cf(1.2,0.5 + 0.05 * math.cos(sine / 28),0.3)*angles(math.rad(-30),math.rad(0),math.rad(-20)),.1)
5646LW.C0=clerp(LW.C0,cf(-1.2,0.5 + 0.05 * math.cos(sine / 28),0.3)*angles(math.rad(-30),math.rad(0),math.rad(20)),.1)
5647
5648elseif(ModeOfGlitch == 15)then -- Antecedent
5649local snap = math.random(1,10)
5650if snap == 1 then
5651Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(23 + math.random(-5,5)),math.rad(math.random(-5,5)),math.rad(0 + math.random(-5,5))),1)
5652end
5653RH.C0=clerp(RH.C0,cf(1,-1 - 0.1 * math.cos(sine / 32),0)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(-3),math.rad(-5.5 - 2 * math.cos(sine / 56)),math.rad(-12 - 2 * math.cos(sine / 32))),.1)
5654LH.C0=clerp(LH.C0,cf(-1,-1 - 0.1 * math.cos(sine / 32),0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(-6),math.rad(-10 +10 * math.cos(sine / 56)),math.rad(-1 + 2 * math.cos(sine / 32))),.1)
5655RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0.01 + 0.03 * math.cos(sine / 32),0 + 0.1 * math.cos(sine / 32))*angles(math.rad(1 - 2 * math.cos(sine / 32)),math.rad(0),math.rad(10-10 * math.cos(sine / 56))),.1)
5656Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(23 - 2 * math.cos(sine / 37)),math.rad(0 + 5 * math.cos(sine / 43) - 5 * math.cos(sine / 0.25)),math.rad(-10 + 10 * math.cos(sine / 56))),.1)
5657RW.C0=clerp(RW.C0,cf(1.5,0.5 + 0.025 * math.cos(sine / 45),0)*angles(math.rad(5 + 3 * math.cos(sine / 43)),math.rad(-16 - 5 * math.cos(sine / 52)),math.rad(-3 + 9 * math.cos(sine / 45))),.1)
5658LW.C0=clerp(LW.C0,cf(-1.5,0.5 + 0.025 * math.cos(sine / 45),0+.1*math.sin(sine/52))*angles(math.rad(7 - 2 * math.cos(sine / 51)),math.rad(-10+10 * math.cos(sine / 52)),math.rad(-12 + 5 * math.cos(sine / 45))),.1)
5659elseif(ModeOfGlitch == 16)then -- Balanced
5660--Balanced Anim by Derpz
5661-- ^ thanks Derpz
5662local color = math.random(0,1)
5663sphere2(8,"Add",larm.CFrame*CFrame.new(0,-1,0)*CFrame.Angles(math.rad(math.random(-360,360)),math.rad(math.random(-360,360)),math.rad(math.random(-360,360))),vt(1,1,1),-0.01,0.05,-0.01,BrickColor.new(Color3.new(color,color,color)),Color3.new(color,color,color))
5664
5665RH.C0=clerp(RH.C0,cf(1,-1 - 0.1 * math.cos(sine / 30),0)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(-2.5),math.rad(0),math.rad(0 - 1 * math.cos(sine / 34))),.1)
5666LH.C0=clerp(LH.C0,cf(-1,-1 - 0.1 * math.cos(sine / 30),0)*angles(math.rad(0),math.rad(-80),math.rad(0))*angles(math.rad(-2.5),math.rad(0),math.rad(0 - 1 * math.cos(sine / 34))),.1)
5667RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,0 + 0.1 * math.cos(sine / 30))*angles(math.rad(0 - 1 * math.cos(sine / 34)),math.rad(0),math.rad(0)),.1)
5668Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(30 - 3 * math.cos(sine / 45)),math.rad(0),math.rad(0)),.1)
5669RW.C0=clerp(RW.C0,cf(1.2,0.5 + 0.05 * math.cos(sine / 50),0.3)*angles(math.rad(-50),math.rad(0),math.rad(-50 - 5 * math.cos(sine / 50))),.1)
5670LW.C0=clerp(LW.C0,cf(-1.5,0.5 + 0.05 * math.cos(sine / 50),0)*angles(math.rad(180),math.rad(0),math.rad(-20 + 5 * math.cos(sine / 50))),.1)
5671
5672else
5673local snap = math.random(1,10)
5674if snap == 1 then
5675Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(23 + math.random(-5,5)),math.rad(math.random(-5,5)),math.rad(22 + math.random(-5,5))),1)
5676end
5677RH.C0=clerp(RH.C0,cf(1,-1 - 0.1 * math.cos(sine / 32),0)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(-3),math.rad(-5.5 - 2 * math.cos(sine / 56)),math.rad(-12 - 2 * math.cos(sine / 32))),.1)
5678LH.C0=clerp(LH.C0,cf(-1,-1 - 0.1 * math.cos(sine / 32),0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(-6),math.rad(22 - 2 * math.cos(sine / 56)),math.rad(-1 + 2 * math.cos(sine / 32))),.1)
5679RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0.01 + 0.03 * math.cos(sine / 32),0 + 0.1 * math.cos(sine / 32))*angles(math.rad(1 - 2 * math.cos(sine / 32)),math.rad(0),math.rad(-22 + 2 * math.cos(sine / 56))),.1)
5680Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(23 - 2 * math.cos(sine / 37)),math.rad(0 + 5 * math.cos(sine / 43) - 5 * math.cos(sine / 0.25)),math.rad(22 - 2 * math.cos(sine / 56))),.1)
5681RW.C0=clerp(RW.C0,cf(1.5,0.5 + 0.025 * math.cos(sine / 45),0)*angles(math.rad(5 + 3 * math.cos(sine / 43)),math.rad(-16 - 5 * math.cos(sine / 52)),math.rad(13 + 9 * math.cos(sine / 45))),.1)
5682LW.C0=clerp(LW.C0,cf(-1.5,0.5 + 0.025 * math.cos(sine / 45),0)*angles(math.rad(7 - 2 * math.cos(sine / 51)),math.rad(0 - 4 * math.cos(sine / 64)),math.rad(-22 - 2 * math.cos(sine / 45))),.1)
5683end
5684end
5685elseif torvel>2 and Humanoid.WalkSpeed<32 and hitfloor~=nil then
5686Anim="Walk"
5687if attack==false then
5688if ModeOfGlitch == 3 then
5689RH.C0=clerp(RH.C0,cf(1,-1 + 0.05 * math.cos(sine / 4),0)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(0),math.rad(0 + 5 * math.cos(sine / 8)),math.rad(0 + 35 * math.cos(sine / 8))),.1)
5690LH.C0=clerp(LH.C0,cf(-1,-1 + 0.05 * math.cos(sine / 4),0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(0),math.rad(0 + 5 * math.cos(sine / 8)),math.rad(0 + 35 * math.cos(sine / 8))),.1)
5691RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,-0.05,-0.05 - 0.05 * math.cos(sine / 4))*angles(math.rad(5 + 3 * math.cos(sine / 8)),math.rad(0 + root.RotVelocity.Y/1.5),math.rad(0 - root.RotVelocity.Y - 5 * math.cos(sine / 8))),.1)
5692Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(10 - 3 * math.cos(sine / 4)),math.rad(0 + root.RotVelocity.Y/1.5),math.rad(0 - hed.RotVelocity.Y*1.5 + 5 * math.cos(sine / 8) - 30 * math.cos(sine / 47))),.1)
5693RW.C0=clerp(RW.C0,cf(1,0.5 + 0.025 * math.cos(sine / 45),0.45)*angles(math.rad(-33 + 5 * math.cos(sine / 74)),math.rad(1 - 3 * math.cos(sine / 53)),math.rad(-33 - 10 * math.cos(sine / 47))),.1)
5694LW.C0=clerp(LW.C0,cf(-1,0.5 + 0.025 * math.cos(sine / 45),0.45)*angles(math.rad(-23 - 3 * math.cos(sine / 73)),math.rad(2 - 1 * math.cos(sine / 55)),math.rad(33 - 10 * math.cos(sine / 47))),.1)
5695elseif ModeOfGlitch == 4 then
5696local snap = math.random(1,24)
5697if snap == 1 then
5698Torso.Neck.C0=clerp(Torso.Neck.C0,necko*cf(0, 0, 0 + ((1) - 1))*angles(math.rad(35+math.random(-50,50)),math.rad(10+math.random(-50,50)),math.rad(0+math.random(-50,50))),.5)
5699end
5700local snap = math.random(1,48)
5701if snap == 1 then
5702Torso.Neck.C0=clerp(Torso.Neck.C0,necko*cf(0, 0, 0 + ((1) - 1))*angles(math.rad(35+math.random(-100,100)),math.rad(10+math.random(-100,100)),math.rad(0+math.random(-100,100))),.5)
5703end
5704RH.C0=clerp(RH.C0,cf(1,-1,0)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(0)),.1)
5705LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(0)),.1)
5706RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,1+ 0.1 * math.cos(sine / 29))*angles(math.rad(2.5),math.rad(0),math.rad(0)),.1)
5707Torso.Neck.C0=clerp(Torso.Neck.C0,necko*cf(0, 0, 0 + ((1) - 1))*angles(math.rad(35),math.rad(10),math.rad(0)),0.5)
5708RW.C0=clerp(RW.C0,cf(1.5+math.random(-.5,.5),0.5+math.random(-.5,.5),0+math.random(-.5,.5))*angles(math.rad(0+math.random(-5,5)),math.rad(0+math.random(-5,5)),math.rad(0+math.random(-5,5))),.1)
5709LW.C0=clerp(LW.C0,cf(-1.5+math.random(-.5,.5),0.5+math.random(-.5,.5),0+math.random(-.5,.5))*angles(math.rad(0+math.random(-5,5)),math.rad(0+math.random(-5,5)),math.rad(0+math.random(-5,5))),.1)
5710elseif ModeOfGlitch == 7 then
5711local rsiz = math.random(1,2)
5712sphereMK(math.random(3,6),math.random(-25,25)/750,"Add",sorb2.CFrame*CFrame.new(math.random(-20,20)/50,math.random(-20,20)/50,math.random(-20,20)/50)*CFrame.Angles(math.rad(90 + math.random(-360,360)),math.rad(math.random(-360,360)),math.rad(math.random(-360,360))),rsiz/10,rsiz/10,rsiz/10,0,MAINRUINCOLOR,0)
5713sphereMK(math.random(6,9),math.random(-10,10)/750,"Add",sorb2.CFrame*CFrame.new(math.random(-5,5)/50,math.random(-5,5)/50,math.random(-5,5)/50)*CFrame.Angles(math.rad(90 + math.random(-360,360)),math.rad(math.random(-360,360)),math.rad(math.random(-360,360))),rsiz/3,rsiz/3,rsiz/3,0,MAINRUINCOLOR,0)
5714RH.C0=clerp(RH.C0,cf(1,-1 + 0.05 * math.cos(sine / 4),0)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(0),math.rad(0 + 5 * math.cos(sine / 8)),math.rad(0 + 35 * math.cos(sine / 8))),.1)
5715LH.C0=clerp(LH.C0,cf(-1,-1 + 0.05 * math.cos(sine / 4),0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(0),math.rad(0 + 5 * math.cos(sine / 8)),math.rad(0 + 35 * math.cos(sine / 8))),.1)
5716RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,-0.05,-0.05 - 0.05 * math.cos(sine / 4))*angles(math.rad(5 + 3 * math.cos(sine / 8)),math.rad(0 + root.RotVelocity.Y/1.5),math.rad(0 - root.RotVelocity.Y - 5 * math.cos(sine / 8))),.1)
5717Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(25 - 3 * math.cos(sine / 4)+MRANDOM(-5,5)),math.rad(0 + root.RotVelocity.Y/1.5+MRANDOM(-5,5)),math.rad(0 - hed.RotVelocity.Y*1.5 + 5 * math.cos(sine / 8)+MRANDOM(-5,5))),.1)
5718RW.C0=clerp(RW.C0,cf(1.5,0.5,0 + 0.025 * math.cos(sine / 8))*angles(math.rad(-25 - 5 * math.cos(sine / 4)),math.rad(0),math.rad(25 - 0.015 * math.cos(sine / 4))),.1)
5719LW.C0=clerp(LW.C0,cf(-1.5,0.5,0 - 0.25 * math.cos(sine / 8))*angles(math.rad(0 + 50 * math.cos(sine / 8)),math.rad(0),math.rad(-10 + 15 * math.cos(sine / 4))),.1)
5720elseif ModeOfGlitch==12 then
5721RH.C0=clerp(RH.C0,cf(1,-1 - 0.05 * math.cos(sine / 32),-0.2)*angles(math.rad(-40),math.rad(90),math.rad(0)),.1)
5722LH.C0=clerp(LH.C0,cf(-1,-1 - 0.05 * math.cos(sine / 32),-0.3)*angles(math.rad(-40),math.rad(-90),math.rad(0)),.1)
5723RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0 - 0.45 * math.cos(sine / 49),0,1 + 0.25 * math.cos(sine / 28))*angles(math.rad(50),math.rad(0 - root.RotVelocity.Y),math.rad(0 - root.RotVelocity.Y *4.5 + 3 * math.cos(sine / 47))),.05)
5724Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(-35 + 2.5 * math.cos(sine / 41)),math.rad(0 + 1 * math.cos(sine / 57)),math.rad(0)),.1)
5725RW.C0=clerp(RW.C0,cf(1.5,0.5 + 0.025 * math.cos(sine / 45),0)*angles(math.rad(0 - 0.3 * math.cos(sine / 43)),math.rad(-35 - 2 * math.cos(sine / 52)),math.rad(19 + 0.9 * math.cos(sine / 45))),.1)
5726LW.C0=clerp(LW.C0,cf(-1.5,0.5 + 0.025 * math.cos(sine / 45),0)*angles(math.rad(0 - 0.2 * math.cos(sine / 51)),math.rad(35 - 4 * math.cos(sine / 64)),math.rad(-19 - 0.2 * math.cos(sine / 45))),.1)
5727else
5728RH.C0=clerp(RH.C0,cf(1,-1 + 0.05 * math.cos(sine / 4),0)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(0),math.rad(0 + 5 * math.cos(sine / 8)),math.rad(0 + 35 * math.cos(sine / 8))),.1)
5729LH.C0=clerp(LH.C0,cf(-1,-1 + 0.05 * math.cos(sine / 4),0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(0),math.rad(0 + 5 * math.cos(sine / 8)),math.rad(0 + 35 * math.cos(sine / 8))),.1)
5730RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,-0.05,-0.05 - 0.05 * math.cos(sine / 4))*angles(math.rad(5 + 3 * math.cos(sine / 8)),math.rad(0 + root.RotVelocity.Y/1.5),math.rad(0 - root.RotVelocity.Y - 5 * math.cos(sine / 8))),.1)
5731Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(10 - 3 * math.cos(sine / 4)),math.rad(0 + root.RotVelocity.Y/1.5),math.rad(0 - hed.RotVelocity.Y*1.5 + 5 * math.cos(sine / 8))),.1)
5732RW.C0=clerp(RW.C0,cf(1.5,0.5,0 + 0.25 * math.cos(sine / 8))*angles(math.rad(0 - 50 * math.cos(sine / 8)),math.rad(0),math.rad(10 - 15 * math.cos(sine / 4))),.1)
5733LW.C0=clerp(LW.C0,cf(-1.5,0.5,0 - 0.25 * math.cos(sine / 8))*angles(math.rad(0 + 50 * math.cos(sine / 8)),math.rad(0),math.rad(-10 + 15 * math.cos(sine / 4))),.1)
5734end
5735end
5736elseif torvel>=4 and Humanoid.WalkSpeed>=32 and hitfloor~=nil then
5737Anim="Run"
5738if attack==false then
5739if ModeOfGlitch==8 or ModeOfGlitch==10 or ModeOfGlitch == 14 or ModeOfGlitch==12 then
5740RH.C0=clerp(RH.C0,cf(1,-1 - 0.05 * math.cos(sine / 32),-0.2)*angles(math.rad(-40),math.rad(90),math.rad(0)),.1)
5741LH.C0=clerp(LH.C0,cf(-1,-1 - 0.05 * math.cos(sine / 32),-0.3)*angles(math.rad(-40),math.rad(-90),math.rad(0)),.1)
5742RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0 - 0.15 * math.cos(sine / 29),0 + 0.125 * math.cos(sine / 34),1 + 0.25 * math.cos(sine / 28))*angles(math.rad(50),math.rad(0 - root.RotVelocity.Y),math.rad(0 - root.RotVelocity.Y *4.5 + 3 * math.cos(sine / 47))),.05)
5743Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(-35 + 2.5 * math.cos(sine / 41)),math.rad(0 + 1 * math.cos(sine / 57)),math.rad(0)),.1)
5744RW.C0=clerp(RW.C0,cf(1.5,0.5 + 0.025 * math.cos(sine / 45),0)*angles(math.rad(0 - 0.3 * math.cos(sine / 43)),math.rad(-35 - 2 * math.cos(sine / 52)),math.rad(19 + 0.9 * math.cos(sine / 45))),.1)
5745LW.C0=clerp(LW.C0,cf(-1.5,0.5 + 0.025 * math.cos(sine / 45),0)*angles(math.rad(0 - 0.2 * math.cos(sine / 51)),math.rad(35 - 4 * math.cos(sine / 64)),math.rad(-19 - 0.2 * math.cos(sine / 45))),.1)
5746else
5747RH.C0=clerp(RH.C0,cf(1,-1 - 0.15 * math.cos(sine / 3),0)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(0 + 95 * math.cos(sine / 6))),.1)
5748LH.C0=clerp(LH.C0,cf(-1,-1 - 0.15 * math.cos(sine / 3),0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(0 + 95 * math.cos(sine / 6))),.1)
5749RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,-0.3,-0.05 + 0.15 * math.cos(sine / 3))*angles(math.rad(25 - 4 * math.cos(sine / 3)),math.rad(0 + root.RotVelocity.Y*1.5),math.rad(0 - root.RotVelocity.Y - 1 * math.cos(sine / 6))),.1)
5750Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(-6 + 2 * math.cos(sine / 3)),math.rad(0 + root.RotVelocity.Y*1.5),math.rad(0 - hed.RotVelocity.Y*1.5 + 1 * math.cos(sine / 6))),.1)
5751RW.C0=clerp(RW.C0,cf(1.5,0.5,0 + 0.5 * math.cos(sine / 6))*angles(math.rad(0 - 140 * math.cos(sine / 6)),math.rad(0),math.rad(5 - 20 * math.cos(sine / 3))),.1)
5752LW.C0=clerp(LW.C0,cf(-1.5,0.5,0 - 0.5 * math.cos(sine / 6))*angles(math.rad(0 + 140 * math.cos(sine / 6)),math.rad(0),math.rad(-5 + 20 * math.cos(sine / 3))),.1)
5753sphereMK(2,-0.5,"Add",root.CFrame*CFrame.new(math.random(-5,5),math.random(-5,5),math.random(1,10))*CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)),0.25,0.25,3,-0.00375,MAINRUINCOLOR,0)
5754sphereMK(2,-0.5,"Add",root.CFrame*CFrame.new(math.random(-5,5),math.random(-5,5),math.random(1,10))*CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)),0.25,0.25,3,-0.00375,SECONDRUINCOLOR,0)
5755end
5756end
5757end
5758end
5759end
5760ArtificialHB = Instance.new("BindableEvent", script)
5761ArtificialHB.Name = "ArtificialHB"
5762
5763script:WaitForChild("ArtificialHB")
5764Frame_Speed = 1 / 60
5765frame = Frame_Speed
5766tf = 0
5767allowframeloss = false
5768tossremainder = false
5769lastframe = tick()
5770
5771game:GetService("RunService").Heartbeat:connect(function(s, p)
5772 tf = tf + s
5773 if tf >= frame then
5774 if allowframeloss then
5775 ArtificialHB:Fire()
5776 lastframe = tick()
5777 else
5778 for i = 1, math.floor(tf / frame) do
5779 ArtificialHB:Fire()
5780 end
5781 lastframe = tick()
5782 end
5783 if tossremainder then
5784 tf = 0
5785 else
5786 tf = tf - frame * math.floor(tf / frame)
5787 end
5788 end
5789end)
5790
5791------------------
5792function swait(num)
5793if num == 0 or num == nil then
5794 ArtificialHB.Event:wait()
5795 else
5796 for i = 1, num do
5797 ArtificialHB.Event:wait()
5798 end
5799 end
5800end
5801Create=function(obj)
5802 local inst = Instance.new(obj)
5803 return function(props)
5804 for prop,valu in next, props do
5805 inst[prop]=valu
5806 end
5807 return inst
5808 end
5809 end
5810Echo = function(id, par, vol, pit, timepos,delays,echodelay,fedb,dryl)
5811 local Sas = Create("Sound"){
5812 Volume = vol,
5813 Name = "EffectSoundo",
5814 Pitch = pit or 1,
5815 SoundId = id,
5816 TimePosition = timepos,
5817 Parent = par or workspace,
5818 }
5819 local E = Create("EchoSoundEffect"){
5820 Delay = echodelay,
5821 Name = "Echo",
5822 Feedback = fedb,
5823 DryLevel = dryl,
5824 Parent = Sas,
5825 }
5826 wait()
5827 Sas:play()
5828 game:GetService("Debris"):AddItem(Sas, delays)
5829end
5830
5831script:WaitForChild'NewDialog'
5832
5833v=game:service'Players'.localPlayer
5834function newbosschatfunc(kan,ModeOfGlitch,modet,text,color,color2,watval)
5835coroutine.resume(coroutine.create(function()
5836if v.PlayerGui:FindFirstChild("NewDialog")~= nil then
5837v.PlayerGui:FindFirstChild("NewDialog"):destroy()
5838end
5839local Bruh=script.NewDialog:Clone()
5840Bruh.Parent=v.PlayerGui
5841local Bruh2=Bruh.H
5842game:GetService("Debris"):AddItem(Bruh,120)
5843--local scrg = Instance.new("ScreenGui",v.PlayerGui)
5844Echo("rbxassetid://525200869", Bruh, 0.5, 1,0,10,0.1,0.25,1)
5845
5846--V bad code - salvo
5847Bruh2.BackgroundColor3=color
5848Bruh2.H1.BackgroundColor3=color
5849Bruh2.H12.BackgroundColor3=color
5850Bruh2.H13.BackgroundColor3=color
5851Bruh2.H14.BackgroundColor3=color
5852Bruh2.H1.BorderColor3=color2
5853Bruh2.H12.BorderColor3=color2
5854Bruh2.H13.BorderColor3=color2
5855Bruh2.H14.BorderColor3=color2
5856Bruh2.H.TextColor3=color
5857Bruh2.H.TextStrokeColor3=color2
5858Bruh2.H.BackgroundColor3=color2
5859Bruh2.H.H1.BackgroundColor3=color2
5860Bruh2.H.H2.BackgroundColor3=color2
5861Bruh2.H.H3.BackgroundColor3=color2
5862Bruh2.US.TextColor3=color2
5863Bruh2.US.TextStrokeColor3=color
5864Bruh2.PULSE.BackgroundColor3=color2
5865
5866Bruh2.H.Text=text
5867
5868Bruh2.US.Text=modet
5869
5870Bruh2:TweenPosition(UDim2.new(0,0,.8,0), "Out", "Quad", .2,true)
5871
5872
5873local function pul()
5874Bruh2.PULSE:TweenSize(UDim2.new(1.1,0,1.3,0), "Out", "Quint", 1,true)
5875Bruh2.PULSE.BackgroundTransparency=0
5876end
5877
5878local dah=false
5879coroutine.resume(coroutine.create(function(aaaa)
5880 for i = 1,string.len(text),1 do
5881 swait()
5882 aaaa.Text = string.sub(text,1,i)
5883 end
5884end),Bruh2.H)
5885coroutine.resume(coroutine.create(function(t1,t2,t3,t4)
5886local mo1=1
5887local mo2=10
5888local mo3=0
5889repeat
5890
5891local hahahaaa={"Black","Crimson","Maroon","Bright red","Cocoa","Really red"}
5892t1.Rotation=t1.Rotation+1
5893t2.Rotation=t2.Rotation+1.6
5894t3.Rotation=t3.Rotation+2.6
5895t4.Rotation=t4.Rotation+3.8
5896t1:TweenPosition(UDim2.new(.02+.01*math.sin((tick()*100) / 47),0,-.2+.01*math.cos((tick()*100) / 50),0), "Out", "Quint", .1,true)
5897t2:TweenPosition(UDim2.new(.1-.01*math.cos((tick()*100) / 48),0,-.14-.01*math.sin((tick()*100) / 49),0), "Out", "Quint", .1,true)
5898t3:TweenPosition(UDim2.new(.18-.01*math.sin((tick()*100) / 49),0,-.07-.01*math.cos((tick()*100) / 48),0), "Out", "Quint", .1,true)
5899t4:TweenPosition(UDim2.new(.23+.01*math.cos((tick()*100) / 50),0,-.04+.01*math.sin((tick()*100) / 47),0), "Out", "Quint", .1,true)
5900if ModeOfGlitch==5 then
5901 local MAINRUINCOLOR = hahahaaa[math.random(1,#hahahaaa)]
5902 local SECONDRUINCOLOR = hahahaaa[math.random(1,#hahahaaa)]
5903Bruh2.BackgroundColor3=MAINRUINCOLOR.Color
5904Bruh2.H1.BackgroundColor3=MAINRUINCOLOR.Color
5905Bruh2.H12.BackgroundColor3=MAINRUINCOLOR.Color
5906Bruh2.H13.BackgroundColor3=MAINRUINCOLOR.Color
5907Bruh2.H14.BackgroundColor3=MAINRUINCOLOR.Color
5908Bruh2.H1.BorderColor3=SECONDRUINCOLOR.Color
5909Bruh2.H12.BorderColor3=SECONDRUINCOLOR.Color
5910Bruh2.H13.BorderColor3=SECONDRUINCOLOR.Color
5911Bruh2.H14.BorderColor3=SECONDRUINCOLOR.Color
5912Bruh2.H.TextColor3=MAINRUINCOLOR.Color
5913Bruh2.H.TextStrokeColor3=SECONDRUINCOLOR.Color
5914Bruh2.H.BackgroundColor3=SECONDRUINCOLOR.Color
5915Bruh2.H.H1.BackgroundColor3=SECONDRUINCOLOR.Color
5916Bruh2.H.H2.BackgroundColor3=SECONDRUINCOLOR.Color
5917Bruh2.H.H3.BackgroundColor3=SECONDRUINCOLOR.Color
5918Bruh2.US.TextColor3=SECONDRUINCOLOR.Color
5919Bruh2.US.TextStrokeColor3=MAINRUINCOLOR.Color
5920Bruh2.PULSE.BackgroundColor3=SECONDRUINCOLOR.Color
5921else
5922Bruh2.BackgroundColor3=color
5923Bruh2.H1.BackgroundColor3=color
5924Bruh2.H12.BackgroundColor3=color
5925Bruh2.H13.BackgroundColor3=color
5926Bruh2.H14.BackgroundColor3=color
5927Bruh2.H1.BorderColor3=color2
5928Bruh2.H12.BorderColor3=color2
5929Bruh2.H13.BorderColor3=color2
5930Bruh2.H14.BorderColor3=color2
5931Bruh2.H.TextColor3=color
5932Bruh2.H.TextStrokeColor3=color2
5933Bruh2.H.BackgroundColor3=color2
5934Bruh2.H.H1.BackgroundColor3=color2
5935Bruh2.H.H2.BackgroundColor3=color2
5936Bruh2.H.H3.BackgroundColor3=color2
5937Bruh2.US.TextColor3=color2
5938Bruh2.US.TextStrokeColor3=color
5939Bruh2.PULSE.BackgroundColor3=color2
5940end
5941Bruh2.PULSE.BackgroundTransparency=Bruh2.PULSE.BackgroundTransparency+.04
5942mo1=mo1+2
5943mo2=mo2-2
5944mo3=mo3+1
5945if mo1>=10 then
5946mo1=1
5947end
5948if mo2<=1 then
5949mo2=10
5950end
5951if mo3>=69 then
5952mo3=0
5953Bruh2.PULSE.Size=UDim2.new(1,0,1,0)
5954pul()
5955end
5956for i,ss in pairs(Bruh2.H:GetChildren()) do
5957if ss:IsA("Frame") then
5958if ss.Name=="V"..mo1 then
5959ss:TweenSize(UDim2.new(0+(kan.PlaybackLoudness/650),0,.1,0), "Out", "Quart", .2,true)
5960elseif ss.Name=="V"..mo2 then
5961ss:TweenSize(UDim2.new(0+(kan.PlaybackLoudness/650),0,.1,0), "Out", "Quart", .2,true)
5962end
5963end
5964end
5965
5966if dah then
5967Bruh2.Rotation=Bruh2.Rotation-.2
5968end
5969
5970swait()
5971until t1.Parent==nil or t2.Parent==nil or t3.Parent==nil or t4.Parent==nil
5972end),Bruh2.H1,Bruh2.H12,Bruh2.H13,Bruh2.H14)
5973
5974pcall(function()
5975for i=1,watval do
5976swait()
5977Bruh2:TweenPosition(UDim2.new(0,0,.8+.02*math.cos((tick()*100) / 61),0), "Out", "Quad", .2,true)
5978if Bruh.Parent==nil then
5979break
5980end
5981end
5982
5983if Bruh.Parent~=nil and Bruh2.Parent~=nil then
5984Bruh2:TweenPosition(UDim2.new(-.1,0,2,0), "In", "Quart", 1.6,true)
5985dah=true
5986swait(180)
5987Bruh:Remove()
5988
5989end
5990end)
5991
5992script:destroy()
5993end))
5994end
5995
5996--(kan,ModeOfGlitch,modet,text,color,color2,watval)
5997newbosschatfunc(script.Music.Value,script.Mode.Value,script.ModeName.Value,script.Text.Value,script.Color1.Value,script.Color2.Value,script.Ghghghghgh.Value)
5998local camera = workspace.CurrentCamera
5999local camshaker = require(script:WaitForChild'CameraShaker')
6000local camshakeins = camshaker.CameraShakeInstance
6001local plr = game:service'Players'.localPlayer
6002local camShake = camshaker.new(Enum.RenderPriority.Camera.Value, function(shakeCf)
6003 camera.CFrame = camera.CFrame * shakeCf
6004end)
6005
6006camShake:Start()
6007
6008function StartShake(Settings)
6009 local ID = tostring(function() end):sub(10)
6010 local shake = plr.Character:FindFirstChild(script.Name..'ShakeVal') or Instance.new("StringValue")
6011 shake.Name = script.Name..'ShakeVal'
6012 shake.Value = ID
6013
6014
6015 Settings.ShakeStart = Settings.ShakeStart or 10;
6016 Settings.ShakeEnd = Settings.ShakeEnd or 100;
6017 Settings.Duration = Settings.Duration or 1;
6018 local instance = camshakeins.new(Settings.Intensity or 5,Settings.Roughness or 10,Settings.FadeIn or .1,0)
6019 instance.RotationInfluence=Settings.Rotation or Vector3.new(1,1,5)
6020 instance.PositionInfluence=Settings.Position or Vector3.new(1,1,1)
6021
6022 camShake:ShakeSustain(instance)
6023 local start = time();
6024 if(Settings.Origin and typeof(Settings.Origin)=='CFrame')then Settings.Origin=Settings.Origin.p end
6025 if(Settings.Origin and (typeof(Settings.Origin)=='Vector3' or typeof(Settings.Origin)=='Instance' and Settings.Origin:IsA'BasePart'))then
6026 local pos = (typeof(Settings.Origin)=='Instance' and Settings.Origin.Position or Settings.Origin)
6027 local dist = (camera.CFrame.p-pos).magnitude
6028 local modifier = dist < Settings.ShakeStart and 1 or dist < Settings.ShakeEnd and (0 - 1) / (Settings.ShakeEnd - Settings.ShakeStart) * (dist - Settings.ShakeStart) + 1 or 0
6029 instance:SetScaleMagnitude(modifier)
6030 coroutine.wrap(function()
6031 repeat wait()
6032 local pos = (typeof(Settings.Origin)=='Instance' and Settings.Origin.Position or Settings.Origin)
6033 local dist = (camera.CFrame.p-pos).magnitude
6034 local modifier = dist < Settings.ShakeStart and 1 or dist < Settings.ShakeEnd and (0 - 1) / (Settings.ShakeEnd - Settings.ShakeStart) * (dist - Settings.ShakeStart) + 1 or 0
6035 instance:SetScaleMagnitude(modifier)
6036 until time()-start>=Settings.Duration or shake.Value~=ID
6037 if(shake.Value~=ID)then
6038 instance.sustain=false
6039 else
6040 instance:StartFadeOut(Settings.FadeOut or 2)
6041 end
6042 end)()
6043 else
6044 repeat wait() until time()-start>=Settings.Duration or shake.Value~=ID
6045 if(shake.Value~=ID)then
6046 instance.sustain=false
6047 else
6048 instance:StartFadeOut(Settings.FadeOut or 2)
6049 end
6050 end
6051end
6052StartShake{
6053 Intensity=script:WaitForChild'intensity'.Value;
6054 Roughness=script:WaitForChild'speed'.Value;
6055 Rotation=script:WaitForChild'rot'.Value;
6056 Position=script:WaitForChild'pos'.Value;
6057 Duration=script:WaitForChild'duration'.Value;
6058 ShakeStart=script:WaitForChild'startdist'.Value;
6059 ShakeEnd=script:WaitForChild'enddist'.Value;
6060 Origin=(function()
6061 local origin = script:FindFirstChild'origin'
6062 if(origin)then
6063 if(origin:IsA'ObjectValue')then
6064 return origin.Value
6065 elseif(origin:IsA'CFrameValue')then
6066 return origin.Value.p
6067 elseif(origin:IsA'Vector3Value')then
6068 return origin.Value
6069 end
6070 end
6071 return nil
6072 end)()
6073}
6074-- Camera Shaker
6075-- Crazyman32
6076-- February 26, 2018
6077
6078--[[
6079
6080 CameraShaker.CameraShakeInstance
6081
6082 cameraShaker = CameraShaker.new(renderPriority, callbackFunction)
6083
6084 CameraShaker:Start()
6085 CameraShaker:Stop()
6086 CameraShaker:Shake(shakeInstance)
6087 CameraShaker:ShakeSustain(shakeInstance)
6088 CameraShaker:ShakeOnce(magnitude, roughness [, fadeInTime, fadeOutTime, posInfluence, rotInfluence])
6089 CameraShaker:StartShake(magnitude, roughness [, fadeInTime, posInfluence, rotInfluence])
6090
6091
6092
6093 EXAMPLE:
6094
6095 local camShake = CameraShaker.new(Enum.RenderPriority.Camera.Value, function(shakeCFrame)
6096 camera.CFrame = playerCFrame * shakeCFrame
6097 end)
6098
6099 camShake:Start()
6100
6101 -- Explosion shake:
6102 camShake:Shake(CameraShaker.Presets.Explosion)
6103
6104 wait(1)
6105
6106 -- Custom shake:
6107 camShake:ShakeOnce(3, 1, 0.2, 1.5)
6108
6109
6110
6111 NOTE:
6112
6113 This was based entirely on the EZ Camera Shake asset for Unity3D. I was given written
6114 permission by the developer, Road Turtle Games, to port this to Roblox.
6115
6116 Original asset link: https://assetstore.unity.com/packages/tools/camera/ez-camera-shake-33148
6117
6118
6119--]]
6120
6121
6122
6123local CameraShaker = {}
6124CameraShaker.__index = CameraShaker
6125
6126local profileBegin = debug.profilebegin
6127local profileEnd = debug.profileend
6128local profileTag = "CameraShakerUpdate"
6129
6130local V3 = Vector3.new
6131local CF = CFrame.new
6132local ANG = CFrame.Angles
6133local RAD = math.rad
6134local v3Zero = V3()
6135
6136local CameraShakeInstance = require(script.CameraShakeInstance)
6137local CameraShakeState = CameraShakeInstance.CameraShakeState
6138
6139local defaultPosInfluence = V3(0.15, 0.15, 0.15)
6140local defaultRotInfluence = V3(1, 1, 1)
6141
6142
6143CameraShaker.CameraShakeInstance = CameraShakeInstance
6144CameraShaker.Presets = require(script.CameraShakePresets)
6145
6146
6147function CameraShaker.new(renderPriority, callback)
6148
6149 assert(type(renderPriority) == "number", "RenderPriority must be a number (e.g.: Enum.RenderPriority.Camera.Value)")
6150 assert(type(callback) == "function", "Callback must be a function")
6151
6152 local self = setmetatable({
6153 _running = false;
6154 _renderName = "CameraShaker";
6155 _renderPriority = renderPriority;
6156 _posAddShake = v3Zero;
6157 _rotAddShake = v3Zero;
6158 _camShakeInstances = {};
6159 _removeInstances = {};
6160 _callback = callback;
6161 }, CameraShaker)
6162
6163 return self
6164
6165end
6166
6167
6168function CameraShaker:Start()
6169 if (self._running) then return end
6170 self._running = true
6171 local callback = self._callback
6172 game:GetService("RunService"):BindToRenderStep(self._renderName, self._renderPriority, function(dt)
6173 profileBegin(profileTag)
6174 local cf = self:Update(dt)
6175 profileEnd()
6176 callback(cf)
6177 end)
6178end
6179
6180
6181function CameraShaker:Stop()
6182 if (not self._running) then return end
6183 game:GetService("RunService"):UnbindFromRenderStep(self._renderName)
6184 self._running = false
6185end
6186
6187
6188function CameraShaker:Update(dt)
6189
6190 local posAddShake = v3Zero
6191 local rotAddShake = v3Zero
6192
6193 local instances = self._camShakeInstances
6194
6195 -- Update all instances:
6196 for i = 1,#instances do
6197
6198 local c = instances[i]
6199
6200 local state = c:GetState()
6201
6202 if (state == CameraShakeState.Inactive and c.DeleteOnInactive) then
6203 self._removeInstances[#self._removeInstances + 1] = i
6204 elseif (state ~= CameraShakeState.Inactive) then
6205 posAddShake = posAddShake + (c:UpdateShake(dt) * c.PositionInfluence)
6206 rotAddShake = rotAddShake + (c:UpdateShake(dt) * c.RotationInfluence)
6207 end
6208
6209 end
6210
6211 -- Remove dead instances:
6212 for i = #self._removeInstances,1,-1 do
6213 local instIndex = self._removeInstances[i]
6214 table.remove(instances, instIndex)
6215 self._removeInstances[i] = nil
6216 end
6217
6218 return CF(posAddShake) *
6219 ANG(0, RAD(rotAddShake.Y), 0) *
6220 ANG(RAD(rotAddShake.X), 0, RAD(rotAddShake.Z))
6221
6222end
6223
6224
6225function CameraShaker:Shake(shakeInstance)
6226 assert(type(shakeInstance) == "table" and shakeInstance._camShakeInstance , "ShakeInstance must be of type CameraShakeInstance")
6227 self._camShakeInstances[#self._camShakeInstances + 1] = shakeInstance
6228 return shakeInstance
6229end
6230
6231
6232function CameraShaker:ShakeSustain(shakeInstance)
6233 assert(type(shakeInstance) == "table" and shakeInstance._camShakeInstance , "ShakeInstance must be of type CameraShakeInstance")
6234 self._camShakeInstances[#self._camShakeInstances + 1] = shakeInstance
6235 shakeInstance:StartFadeIn(shakeInstance.fadeInDuration)
6236 return shakeInstance
6237end
6238
6239
6240function CameraShaker:ShakeOnce(magnitude, roughness, fadeInTime, fadeOutTime, posInfluence, rotInfluence)
6241 local shakeInstance = CameraShakeInstance.new(magnitude, roughness, fadeInTime, fadeOutTime)
6242 shakeInstance.PositionInfluence = (typeof(posInfluence) == "Vector3" and posInfluence or defaultPosInfluence)
6243 shakeInstance.RotationInfluence = (typeof(rotInfluence) == "Vector3" and rotInfluence or defaultRotInfluence)
6244 self._camShakeInstances[#self._camShakeInstances + 1] = shakeInstance
6245 return shakeInstance
6246end
6247
6248
6249function CameraShaker:StartShake(magnitude, roughness, fadeInTime, posInfluence, rotInfluence)
6250 local shakeInstance = CameraShakeInstance.new(magnitude, roughness, fadeInTime)
6251 shakeInstance.PositionInfluence = (typeof(posInfluence) == "Vector3" and posInfluence or defaultPosInfluence)
6252 shakeInstance.RotationInfluence = (typeof(rotInfluence) == "Vector3" and rotInfluence or defaultRotInfluence)
6253 shakeInstance:StartFadeIn(fadeInTime)
6254 self._camShakeInstances[#self._camShakeInstances + 1] = shakeInstance
6255 return shakeInstance
6256end
6257
6258
6259return CameraShaker
6260-- Camera Shake Instance
6261-- Crazyman32
6262-- February 26, 2018
6263
6264--[[
6265
6266 cameraShakeInstance = CameraShakeInstance.new(magnitude, roughness, fadeInTime, fadeOutTime)
6267
6268--]]
6269
6270
6271
6272local CameraShakeInstance = {}
6273CameraShakeInstance.__index = CameraShakeInstance
6274
6275local V3 = Vector3.new
6276local NOISE = math.noise
6277
6278
6279CameraShakeInstance.CameraShakeState = {
6280 FadingIn = 0;
6281 FadingOut = 1;
6282 Sustained = 2;
6283 Inactive = 3;
6284}
6285
6286
6287function CameraShakeInstance.new(magnitude, roughness, fadeInTime, fadeOutTime)
6288
6289 if (fadeInTime == nil) then fadeInTime = 0 end
6290 if (fadeOutTime == nil) then fadeOutTime = 0 end
6291
6292 assert(type(magnitude) == "number", "Magnitude must be a number")
6293 assert(type(roughness) == "number", "Roughness must be a number")
6294 assert(type(fadeInTime) == "number", "FadeInTime must be a number")
6295 assert(type(fadeOutTime) == "number", "FadeOutTime must be a number")
6296
6297 local self = setmetatable({
6298 Magnitude = magnitude;
6299 Roughness = roughness;
6300 PositionInfluence = V3();
6301 RotationInfluence = V3();
6302 DeleteOnInactive = true;
6303 roughMod = 1;
6304 magnMod = 1;
6305 fadeOutDuration = fadeOutTime;
6306 fadeInDuration = fadeInTime;
6307 sustain = (fadeInTime > 0);
6308 currentFadeTime = (fadeInTime > 0 and 0 or 1);
6309 tick = Random.new():NextNumber(-100, 100);
6310 _camShakeInstance = true;
6311 }, CameraShakeInstance)
6312
6313 return self
6314
6315end
6316
6317
6318function CameraShakeInstance:UpdateShake(dt)
6319
6320 local _tick = self.tick
6321 local currentFadeTime = self.currentFadeTime
6322
6323 local offset = V3(
6324 NOISE(_tick, 0) * 0.5,
6325 NOISE(0, _tick) * 0.5,
6326 NOISE(_tick, _tick) * 0.5
6327 )
6328
6329 if (self.fadeInDuration > 0 and self.sustain) then
6330 if (currentFadeTime < 1) then
6331 currentFadeTime = currentFadeTime + (dt / self.fadeInDuration)
6332 elseif (self.fadeOutDuration > 0) then
6333 self.sustain = false
6334 end
6335 end
6336
6337 if (not self.sustain) then
6338 currentFadeTime = currentFadeTime - (dt / self.fadeOutDuration)
6339 end
6340
6341 if (self.sustain) then
6342 self.tick = _tick + (dt * self.Roughness * self.roughMod)
6343 else
6344 self.tick = _tick + (dt * self.Roughness * self.roughMod * currentFadeTime)
6345 end
6346
6347 self.currentFadeTime = currentFadeTime
6348
6349 return offset * self.Magnitude * self.magnMod * currentFadeTime
6350
6351end
6352
6353
6354function CameraShakeInstance:StartFadeOut(fadeOutTime)
6355 if (fadeOutTime == 0) then
6356 self.currentFadeTime = 0
6357 end
6358 self.fadeOutDuration = fadeOutTime
6359 self.fadeInDuration = 0
6360 self.sustain = false
6361end
6362
6363
6364function CameraShakeInstance:StartFadeIn(fadeInTime)
6365 if (fadeInTime == 0) then
6366 self.currentFadeTime = 1
6367 end
6368 self.fadeInDuration = fadeInTime or self.fadeInDuration
6369 self.fadeOutDuration = 0
6370 self.sustain = true
6371end
6372
6373
6374function CameraShakeInstance:GetScaleRoughness()
6375 return self.roughMod
6376end
6377
6378
6379function CameraShakeInstance:SetScaleRoughness(v)
6380 self.roughMod = v
6381end
6382
6383
6384function CameraShakeInstance:GetScaleMagnitude()
6385 return self.magnMod
6386end
6387
6388
6389function CameraShakeInstance:SetScaleMagnitude(v)
6390 self.magnMod = v
6391end
6392
6393
6394function CameraShakeInstance:GetNormalizedFadeTime()
6395 return self.currentFadeTime
6396end
6397
6398
6399function CameraShakeInstance:IsShaking()
6400 return (self.currentFadeTime > 0 or self.sustain)
6401end
6402
6403
6404function CameraShakeInstance:IsFadingOut()
6405 return ((not self.sustain) and self.currentFadeTime > 0)
6406end
6407
6408
6409function CameraShakeInstance:IsFadingIn()
6410 return (self.currentFadeTime < 1 and self.sustain and self.fadeInDuration > 0)
6411end
6412
6413
6414function CameraShakeInstance:GetState()
6415 if (self:IsFadingIn()) then
6416 return CameraShakeInstance.CameraShakeState.FadingIn
6417 elseif (self:IsFadingOut()) then
6418 return CameraShakeInstance.CameraShakeState.FadingOut
6419 elseif (self:IsShaking()) then
6420 return CameraShakeInstance.CameraShakeState.Sustained
6421 else
6422 return CameraShakeInstance.CameraShakeState.Inactive
6423 end
6424end
6425
6426
6427return CameraShakeInstance
6428-- Camera Shake Presets
6429-- Crazyman32
6430-- February 26, 2018
6431
6432--[[
6433
6434 CameraShakePresets.Bump
6435 CameraShakePresets.Explosion
6436 CameraShakePresets.Earthquake
6437 CameraShakePresets.BadTrip
6438 CameraShakePresets.HandheldCamera
6439 CameraShakePresets.Vibration
6440 CameraShakePresets.RoughDriving
6441
6442--]]
6443
6444
6445
6446local CameraShakeInstance = require(script.Parent.CameraShakeInstance)
6447
6448local CameraShakePresets = {
6449
6450
6451 -- A high-magnitude, short, yet smooth shake.
6452 -- Should happen once.
6453 Bump = function()
6454 local c = CameraShakeInstance.new(2.5, 4, 0.1, 0.75)
6455 c.PositionInfluence = Vector3.new(0.15, 0.15, 0.15)
6456 c.RotationInfluence = Vector3.new(1, 1, 1)
6457 return c
6458 end;
6459
6460
6461 -- An intense and rough shake.
6462 -- Should happen once.
6463 Explosion = function()
6464 local c = CameraShakeInstance.new(5, 10, 0, 1.5)
6465 c.PositionInfluence = Vector3.new(0.25, 0.25, 0.25)
6466 c.RotationInfluence = Vector3.new(4, 1, 1)
6467 return c
6468 end;
6469
6470
6471 -- A continuous, rough shake
6472 -- Sustained.
6473 Earthquake = function()
6474 local c = CameraShakeInstance.new(0.6, 3.5, 2, 10)
6475 c.PositionInfluence = Vector3.new(0.25, 0.25, 0.25)
6476 c.RotationInfluence = Vector3.new(1, 1, 4)
6477 return c
6478 end;
6479
6480
6481 -- A bizarre shake with a very high magnitude and low roughness.
6482 -- Sustained.
6483 BadTrip = function()
6484 local c = CameraShakeInstance.new(10, 0.15, 5, 10)
6485 c.PositionInfluence = Vector3.new(0, 0, 0.15)
6486 c.RotationInfluence = Vector3.new(2, 1, 4)
6487 return c
6488 end;
6489
6490
6491 -- A subtle, slow shake.
6492 -- Sustained.
6493 HandheldCamera = function()
6494 local c = CameraShakeInstance.new(1, 0.25, 5, 10)
6495 c.PositionInfluence = Vector3.new(0, 0, 0)
6496 c.RotationInfluence = Vector3.new(1, 0.5, 0.5)
6497 return c
6498 end;
6499
6500
6501 -- A very rough, yet low magnitude shake.
6502 -- Sustained.
6503 Vibration = function()
6504 local c = CameraShakeInstance.new(0.4, 20, 2, 2)
6505 c.PositionInfluence = Vector3.new(0, 0.15, 0)
6506 c.RotationInfluence = Vector3.new(1.25, 0, 4)
6507 return c
6508 end;
6509
6510
6511 -- A slightly rough, medium magnitude shake.
6512 -- Sustained.
6513 RoughDriving = function()
6514 local c = CameraShakeInstance.new(1, 2, 1, 1)
6515 c.PositionInfluence = Vector3.new(0, 0, 0)
6516 c.RotationInfluence = Vector3.new(1, 1, 1)
6517 return c
6518 end;
6519
6520
6521}
6522
6523
6524return setmetatable({}, {
6525 __index = function(t, i)
6526 local f = CameraShakePresets[i]
6527 if (type(f) == "function") then
6528 return f()
6529 end
6530 error("No preset found with index \"" .. i .. "\"")
6531 end;
6532})
6533local me = game:service'Players'.tiop_doop1;
6534local mouse = me:GetMouse();
6535local UIS = game:service'UserInputService'
6536local ch = me.Character;
6537
6538local UserEvent = ch:WaitForChild('UserInputEvent',30)
6539
6540UIS.InputChanged:connect(function(io,gpe)
6541 if(io.UserInputType == Enum.UserInputType.MouseMovement)then
6542 UserEvent:FireServer{Mouse=true,Target=mouse.Target,Hit=mouse.Hit}
6543 end
6544end)
6545
6546mouse.Changed:connect(function(o)
6547 if(o == 'Target' or o == 'Hit')then
6548 UserEvent:FireServer{Mouse=true,Target=mouse.Target,Hit=mouse.Hit}
6549 end
6550end)
6551
6552UIS.InputBegan:connect(function(io,gpe)
6553 if(gpe)then return end
6554 UserEvent:FireServer{InputObject=true,KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState}
6555end)
6556
6557UIS.InputEnded:connect(function(io,gpe)
6558 if(gpe)then return end
6559 UserEvent:FireServer{InputObject=true,KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState}
6560end)
6561
6562mouse.KeyDown:connect(function(k)
6563 UserEvent:FireServer{KeyEvent='Down',Key=k}
6564end)
6565
6566mouse.KeyUp:connect(function(k)
6567 UserEvent:FireServer{KeyEvent='Up',Key=k}
6568end)
6569
6570local ClientProp = ch:WaitForChild('GetClientProperty',30)
6571
6572local sounds = {}
6573
6574
6575function regSound(o)
6576 if(o:IsA'Sound')then
6577
6578 local lastLoudness = o.PlaybackLoudness
6579 ClientProp:InvokeServer(o,lastLoudness)
6580 table.insert(sounds,{o,lastLoudness})
6581 --ClientProp:InvokeServer(o,o.PlaybackLoudness)
6582 end
6583end
6584
6585ClientProp.OnClientInvoke = function(inst,prop)
6586 if(inst == 'RegSound')then
6587 regSound(prop)
6588 for i = 1, #sounds do
6589 if(sounds[i][1] == prop)then
6590 return sounds[i][2]
6591 end
6592 end
6593 else
6594 return inst[prop]
6595 end
6596end
6597
6598for _,v in next, workspace:GetDescendants() do regSound(v) end
6599workspace.DescendantAdded:connect(regSound)
6600me.Character.DescendantAdded:connect(regSound)
6601
6602game:service'RunService'.RenderStepped:connect(function()
6603 for i = 1, #sounds do
6604 local tab = sounds[i]
6605 local object,last=unpack(tab)
6606 if(object.PlaybackLoudness ~= last)then
6607 sounds[i][2]=object.PlaybackLoudness
6608 ClientProp:InvokeServer(object,sounds[i][2])
6609 end
6610 end
6611end)
6612local NEVER_BREAK_JOINTS = false -- If you set this to true it will never break joints (this can create some welding issues, but can save stuff like hinges).
6613
6614
6615local function CallOnChildren(Instance, FunctionToCall)
6616 FunctionToCall(Instance)
6617
6618 for _, Child in next, Instance:GetChildren() do
6619 CallOnChildren(Child, FunctionToCall)
6620 end
6621end
6622
6623local function GetNearestParent(Instance, ClassName)
6624 local Ancestor = Instance
6625 repeat
6626 Ancestor = Ancestor.Parent
6627 if Ancestor == nil then
6628 return nil
6629 end
6630 until Ancestor:IsA(ClassName)
6631
6632 return Ancestor
6633end
6634
6635local function GetBricks(StartInstance)
6636 local List = {}
6637 CallOnChildren(StartInstance, function(Item)
6638 if Item:IsA("BasePart") then
6639 List[#List+1] = Item;
6640 end
6641 end)
6642
6643 return List
6644end
6645
6646local function Modify(Instance, Values)
6647 assert(type(Values) == "table", "Values is not a table");
6648
6649 for Index, Value in next, Values do
6650 if type(Index) == "number" then
6651 Value.Parent = Instance
6652 else
6653 Instance[Index] = Value
6654 end
6655 end
6656 return Instance
6657end
6658
6659local function Make(ClassType, Properties)
6660 return Modify(Instance.new(ClassType), Properties)
6661end
6662
6663local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
6664local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
6665
6666local function HasWheelJoint(Part)
6667 for _, SurfaceName in pairs(Surfaces) do
6668 for _, HingSurfaceName in pairs(HingSurfaces) do
6669 if Part[SurfaceName].Name == HingSurfaceName then
6670 return true
6671 end
6672 end
6673 end
6674
6675 return false
6676end
6677
6678local function ShouldBreakJoints(Part)
6679 if NEVER_BREAK_JOINTS then
6680 return false
6681 end
6682
6683 if HasWheelJoint(Part) then
6684 return false
6685 end
6686
6687 local Connected = Part:GetConnectedParts()
6688
6689 if #Connected == 1 then
6690 return false
6691 end
6692
6693 for _, Item in pairs(Connected) do
6694 if HasWheelJoint(Item) then
6695 return false
6696 elseif not Item:IsDescendantOf(script.Parent) then
6697 return false
6698 end
6699 end
6700
6701 return true
6702end
6703
6704local function WeldTogether(Part0, Part1, JointType, WeldParent)
6705 JointType = JointType or "Weld"
6706 local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
6707
6708 local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
6709 Modify(NewWeld, {
6710 Name = "qCFrameWeldThingy";
6711 Part0 = Part0;
6712 Part1 = Part1;
6713 C0 = CFrame.new();--Part0.CFrame:inverse();
6714 C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
6715 Parent = Part1;
6716 })
6717
6718 if not RelativeValue then
6719 RelativeValue = Make("CFrameValue", {
6720 Parent = Part1;
6721 Name = "qRelativeCFrameWeldValue";
6722 Archivable = true;
6723 Value = NewWeld.C1;
6724 })
6725 end
6726
6727 return NewWeld
6728end
6729
6730local function WeldParts(Parts, MainPart, JointType)
6731 for _, Part in pairs(Parts) do
6732 if ShouldBreakJoints(Part) then
6733 Part:BreakJoints()
6734 end
6735 end
6736
6737 for _, Part in pairs(Parts) do
6738 if Part ~= MainPart then
6739 WeldTogether(MainPart, Part, JointType, MainPart)
6740 end
6741 end
6742end
6743
6744local function PerfectionWeld()
6745 local Tool = GetNearestParent(script, "Tool")
6746
6747 local Parts = GetBricks(script.Parent)
6748 local PrimaryPart = script.Parent.BloodCurse.hitbox
6749
6750 if PrimaryPart then
6751 WeldParts(Parts, PrimaryPart, "Weld")
6752 else
6753 warn("qWeld - Unable to weld part")
6754 end
6755
6756 return Tool
6757end
6758
6759local Tool = PerfectionWeld()
6760
6761
6762if Tool and script.ClassName == "Script" then
6763 script.Parent.AncestryChanged:connect(function()
6764 PerfectionWeld()
6765 end)
6766end
6767local NEVER_BREAK_JOINTS = false -- If you set this to true it will never break joints (this can create some welding issues, but can save stuff like hinges).
6768
6769
6770local function CallOnChildren(Instance, FunctionToCall)
6771 FunctionToCall(Instance)
6772
6773 for _, Child in next, Instance:GetChildren() do
6774 CallOnChildren(Child, FunctionToCall)
6775 end
6776end
6777
6778local function GetNearestParent(Instance, ClassName)
6779 local Ancestor = Instance
6780 repeat
6781 Ancestor = Ancestor.Parent
6782 if Ancestor == nil then
6783 return nil
6784 end
6785 until Ancestor:IsA(ClassName)
6786
6787 return Ancestor
6788end
6789
6790local function GetBricks(StartInstance)
6791 local List = {}
6792 CallOnChildren(StartInstance, function(Item)
6793 if Item:IsA("BasePart") then
6794 List[#List+1] = Item;
6795 end
6796 end)
6797
6798 return List
6799end
6800
6801local function Modify(Instance, Values)
6802 assert(type(Values) == "table", "Values is not a table");
6803
6804 for Index, Value in next, Values do
6805 if type(Index) == "number" then
6806 Value.Parent = Instance
6807 else
6808 Instance[Index] = Value
6809 end
6810 end
6811 return Instance
6812end
6813
6814local function Make(ClassType, Properties)
6815 return Modify(Instance.new(ClassType), Properties)
6816end
6817
6818local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
6819local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
6820
6821local function HasWheelJoint(Part)
6822 for _, SurfaceName in pairs(Surfaces) do
6823 for _, HingSurfaceName in pairs(HingSurfaces) do
6824 if Part[SurfaceName].Name == HingSurfaceName then
6825 return true
6826 end
6827 end
6828 end
6829
6830 return false
6831end
6832
6833local function ShouldBreakJoints(Part)
6834 if NEVER_BREAK_JOINTS then
6835 return false
6836 end
6837
6838 if HasWheelJoint(Part) then
6839 return false
6840 end
6841
6842 local Connected = Part:GetConnectedParts()
6843
6844 if #Connected == 1 then
6845 return false
6846 end
6847
6848 for _, Item in pairs(Connected) do
6849 if HasWheelJoint(Item) then
6850 return false
6851 elseif not Item:IsDescendantOf(script.Parent) then
6852 return false
6853 end
6854 end
6855
6856 return true
6857end
6858
6859local function WeldTogether(Part0, Part1, JointType, WeldParent)
6860 JointType = JointType or "Weld"
6861 local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
6862
6863 local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
6864 Modify(NewWeld, {
6865 Name = "qCFrameWeldThingy";
6866 Part0 = Part0;
6867 Part1 = Part1;
6868 C0 = CFrame.new();--Part0.CFrame:inverse();
6869 C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
6870 Parent = Part1;
6871 })
6872
6873 if not RelativeValue then
6874 RelativeValue = Make("CFrameValue", {
6875 Parent = Part1;
6876 Name = "qRelativeCFrameWeldValue";
6877 Archivable = true;
6878 Value = NewWeld.C1;
6879 })
6880 end
6881
6882 return NewWeld
6883end
6884
6885local function WeldParts(Parts, MainPart, JointType)
6886 for _, Part in pairs(Parts) do
6887 if ShouldBreakJoints(Part) then
6888 Part:BreakJoints()
6889 end
6890 end
6891
6892 for _, Part in pairs(Parts) do
6893 if Part ~= MainPart then
6894 WeldTogether(MainPart, Part, JointType, MainPart)
6895 end
6896 end
6897end
6898
6899local function PerfectionWeld()
6900 local Tool = GetNearestParent(script, "Tool")
6901
6902 local Parts = GetBricks(script.Parent)
6903 local PrimaryPart = script.Parent.Wing.Welder
6904
6905 if PrimaryPart then
6906 WeldParts(Parts, PrimaryPart, "Weld")
6907 else
6908 warn("qWeld - Unable to weld part")
6909 end
6910
6911 return Tool
6912end
6913
6914local Tool = PerfectionWeld()
6915
6916
6917if Tool and script.ClassName == "Script" then
6918 script.Parent.AncestryChanged:connect(function()
6919 PerfectionWeld()
6920 end)
6921end
6922local NEVER_BREAK_JOINTS = false -- If you set this to true it will never break joints (this can create some welding issues, but can save stuff like hinges).
6923
6924
6925local function CallOnChildren(Instance, FunctionToCall)
6926 FunctionToCall(Instance)
6927
6928 for _, Child in next, Instance:GetChildren() do
6929 CallOnChildren(Child, FunctionToCall)
6930 end
6931end
6932
6933local function GetNearestParent(Instance, ClassName)
6934 local Ancestor = Instance
6935 repeat
6936 Ancestor = Ancestor.Parent
6937 if Ancestor == nil then
6938 return nil
6939 end
6940 until Ancestor:IsA(ClassName)
6941
6942 return Ancestor
6943end
6944
6945local function GetBricks(StartInstance)
6946 local List = {}
6947 CallOnChildren(StartInstance, function(Item)
6948 if Item:IsA("BasePart") then
6949 List[#List+1] = Item;
6950 end
6951 end)
6952
6953 return List
6954end
6955
6956local function Modify(Instance, Values)
6957 assert(type(Values) == "table", "Values is not a table");
6958
6959 for Index, Value in next, Values do
6960 if type(Index) == "number" then
6961 Value.Parent = Instance
6962 else
6963 Instance[Index] = Value
6964 end
6965 end
6966 return Instance
6967end
6968
6969local function Make(ClassType, Properties)
6970 return Modify(Instance.new(ClassType), Properties)
6971end
6972
6973local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
6974local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
6975
6976local function HasWheelJoint(Part)
6977 for _, SurfaceName in pairs(Surfaces) do
6978 for _, HingSurfaceName in pairs(HingSurfaces) do
6979 if Part[SurfaceName].Name == HingSurfaceName then
6980 return true
6981 end
6982 end
6983 end
6984
6985 return false
6986end
6987
6988local function ShouldBreakJoints(Part)
6989 if NEVER_BREAK_JOINTS then
6990 return false
6991 end
6992
6993 if HasWheelJoint(Part) then
6994 return false
6995 end
6996
6997 local Connected = Part:GetConnectedParts()
6998
6999 if #Connected == 1 then
7000 return false
7001 end
7002
7003 for _, Item in pairs(Connected) do
7004 if HasWheelJoint(Item) then
7005 return false
7006 elseif not Item:IsDescendantOf(script.Parent) then
7007 return false
7008 end
7009 end
7010
7011 return true
7012end
7013
7014local function WeldTogether(Part0, Part1, JointType, WeldParent)
7015 JointType = JointType or "Weld"
7016 local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
7017
7018 local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
7019 Modify(NewWeld, {
7020 Name = "qCFrameWeldThingy";
7021 Part0 = Part0;
7022 Part1 = Part1;
7023 C0 = CFrame.new();--Part0.CFrame:inverse();
7024 C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
7025 Parent = Part1;
7026 })
7027
7028 if not RelativeValue then
7029 RelativeValue = Make("CFrameValue", {
7030 Parent = Part1;
7031 Name = "qRelativeCFrameWeldValue";
7032 Archivable = true;
7033 Value = NewWeld.C1;
7034 })
7035 end
7036
7037 return NewWeld
7038end
7039
7040local function WeldParts(Parts, MainPart, JointType)
7041 for _, Part in pairs(Parts) do
7042 if ShouldBreakJoints(Part) then
7043 Part:BreakJoints()
7044 end
7045 end
7046
7047 for _, Part in pairs(Parts) do
7048 if Part ~= MainPart then
7049 WeldTogether(MainPart, Part, JointType, MainPart)
7050 end
7051 end
7052end
7053
7054local function PerfectionWeld()
7055 local Tool = GetNearestParent(script, "Tool")
7056
7057 local Parts = GetBricks(script.Parent)
7058 local PrimaryPart = script.Parent.CursedSword.hitbox
7059
7060 if PrimaryPart then
7061 WeldParts(Parts, PrimaryPart, "Weld")
7062 else
7063 warn("qWeld - Unable to weld part")
7064 end
7065
7066 return Tool
7067end
7068
7069local Tool = PerfectionWeld()
7070
7071
7072if Tool and script.ClassName == "Script" then
7073 script.Parent.AncestryChanged:connect(function()
7074 PerfectionWeld()
7075 end)
7076end
7077-- Smooth Interpolation Curve Generator
7078-- @documentation https://rostrap.github.io/Libraries/Interpolation/Bezier/
7079-- @source https://raw.githubusercontent.com/RoStrap/Interpolation/master/Bezier.lua
7080-- @rostrap Bezier
7081-- @author Validark
7082-- @original https://github.com/gre/bezier-easing
7083-- @testsite http://cubic-bezier.com/
7084-- @testsite http://greweb.me/bezier-easing-editor/example/
7085
7086-- Bezier.new(x1, y1, x2, y2)
7087-- @param numbers (x1, y1, x2, y2) The control points of your curve
7088-- @returns function(t [b, c, d])
7089-- @param number t the time elapsed [0, d]
7090-- @param number b beginning value being interpolated (default = 0)
7091-- @param number c change in value being interpolated (equivalent to: ending - beginning) (default = 1)
7092-- @param number d duration interpolation is occurring over (default = 1)
7093
7094-- These values are established by empiricism with tests (tradeoff: performance VS precision)
7095local NEWTON_ITERATIONS = 4
7096local NEWTON_MIN_SLOPE = 0.001
7097local SUBDIVISION_PRECISION = 0.0000001
7098local SUBDIVISION_MAX_ITERATIONS = 10
7099local K_SPLINE_TABLE_SIZE = 11
7100
7101local K_SAMPLE_STEP_SIZE = 1 / (K_SPLINE_TABLE_SIZE - 1)
7102
7103
7104local Resources={
7105LoadLibrary=function(self,name)
7106local lib = shared[name:lower()]
7107if(lib and lib:IsA'ModuleScript')then
7108return require(lib)
7109else
7110warn'lol that no exist'
7111return {}
7112end
7113end
7114}
7115
7116local Table = Resources:LoadLibrary("Table")
7117local Debug = Resources:LoadLibrary("Debug")
7118
7119local function Linear(t, b, c, d)
7120 return (c or 1)*t / (d or 1) + (b or 0)
7121end
7122
7123local Bezier = {}
7124
7125function Bezier.new(x1, y1, x2, y2)
7126 if not (x1 and y1 and x2 and y2) then Debug.Error("Need 4 numbers to construct a Bezier curve") end
7127 if not (0 <= x1 and x1 <= 1 and 0 <= x2 and x2 <= 1) then Debug.Error("The x values must be within range [0, 1]") end
7128
7129 if x1 == y1 and x2 == y2 then
7130 return Linear
7131 end
7132
7133 -- Precompute redundant values
7134 local e, f = 3*x1, 3*x2
7135 local g, h, i = 1 - f + e, f - 2*e, 3*(1 - f + e)
7136 local j, k = 2*h, 3*y1
7137 local l, m = 1 - 3*y2 + k, 3*y2 - 2*k
7138
7139 -- Precompute samples table
7140 local SampleValues = {}
7141 for a = 0, K_SPLINE_TABLE_SIZE - 1 do
7142 local z = a*K_SAMPLE_STEP_SIZE
7143 SampleValues[a] = ((g*z + h)*z + e)*z -- CalcBezier
7144 end
7145
7146 return function(t, b, c, d)
7147 t = (c or 1)*t / (d or 1) + (b or 0)
7148
7149 if t == 0 or t == 1 then -- Make sure the endpoints are correct
7150 return t
7151 end
7152
7153 local CurrentSample = K_SPLINE_TABLE_SIZE - 2
7154
7155 for a = 1, CurrentSample do
7156 if SampleValues[a] > t then
7157 CurrentSample = a - 1
7158 break
7159 end
7160 end
7161
7162 -- Interpolate to provide an initial guess for t
7163 local IntervalStart = CurrentSample*K_SAMPLE_STEP_SIZE
7164 local GuessForT = IntervalStart + K_SAMPLE_STEP_SIZE*(t - SampleValues[CurrentSample]) / (SampleValues[CurrentSample + 1] - SampleValues[CurrentSample])
7165 local InitialSlope = (i*GuessForT + j)*GuessForT + e
7166
7167 if InitialSlope >= NEWTON_MIN_SLOPE then
7168 for NewtonRaphsonIterate = 1, NEWTON_ITERATIONS do
7169 local CurrentSlope = (i*GuessForT + j)*GuessForT + e
7170 if CurrentSlope == 0 then break end
7171 GuessForT = GuessForT - (((g*GuessForT + h)*GuessForT + e)*GuessForT - t) / CurrentSlope
7172 end
7173 elseif InitialSlope ~= 0 then
7174 local IntervalStep = IntervalStart + K_SAMPLE_STEP_SIZE
7175
7176 for BinarySubdivide = 1, SUBDIVISION_MAX_ITERATIONS do
7177 GuessForT = IntervalStart + 0.5*(IntervalStep - IntervalStart)
7178 local BezierCalculation = ((g*GuessForT + h)*GuessForT + e)*GuessForT - t
7179
7180 if BezierCalculation > 0 then
7181 IntervalStep = GuessForT
7182 else
7183 IntervalStart = GuessForT
7184 BezierCalculation = -BezierCalculation
7185 end
7186
7187 if BezierCalculation <= SUBDIVISION_PRECISION then break end
7188 end
7189 end
7190
7191 return ((l*GuessForT + m)*GuessForT + k)*GuessForT
7192 end
7193end
7194
7195return Table.Lock(Bezier)
7196-- Color utilities with Material Design's 2014 Color Palette
7197-- @documentation https://rostrap.github.io/Libraries/RoStrapUI/Color/
7198-- @source https://raw.githubusercontent.com/RoStrap/RoStrapUI/master/Color.lua
7199-- @rostrap Color
7200-- @author Validark
7201
7202
7203local Resources={
7204LoadLibrary=function(self,name)
7205local lib = shared[name:lower()]
7206if(lib and lib:IsA'ModuleScript')then
7207return require(lib)
7208else
7209warn'lol that no exist'
7210return {}
7211end
7212end
7213}
7214
7215local Table = Resources:LoadLibrary("Table")
7216
7217local rgb = Color3.fromRGB
7218
7219local Color = {
7220 Red = {
7221 [50] = rgb(255, 235, 238);
7222 [100] = rgb(255, 205, 210);
7223 [200] = rgb(239, 154, 154);
7224 [300] = rgb(229, 115, 115);
7225 [400] = rgb(239, 83, 80);
7226 [500] = rgb(244, 67, 54);
7227 [600] = rgb(229, 57, 53);
7228 [700] = rgb(211, 47, 47);
7229 [800] = rgb(198, 40, 40);
7230 [900] = rgb(183, 28, 28);
7231
7232 Accent = {
7233 [100] = rgb(255, 138, 128);
7234 [200] = rgb(255, 82, 82);
7235 [400] = rgb(255, 23, 68);
7236 [700] = rgb(213, 0, 0);
7237 };
7238 };
7239
7240 Pink = {
7241 [50] = rgb(252, 228, 236);
7242 [100] = rgb(248, 187, 208);
7243 [200] = rgb(244, 143, 177);
7244 [300] = rgb(240, 98, 146);
7245 [400] = rgb(236, 64, 122);
7246 [500] = rgb(233, 30, 99);
7247 [600] = rgb(216, 27, 96);
7248 [700] = rgb(194, 24, 91);
7249 [800] = rgb(173, 20, 87);
7250 [900] = rgb(136, 14, 79);
7251
7252 Accent = {
7253 [100] = rgb(255, 128, 171);
7254 [200] = rgb(255, 64, 129);
7255 [400] = rgb(245, 0, 87);
7256 [700] = rgb(197, 17, 98);
7257 };
7258 };
7259
7260 Purple = {
7261 [50] = rgb(243, 229, 245);
7262 [100] = rgb(225, 190, 231);
7263 [200] = rgb(206, 147, 216);
7264 [300] = rgb(186, 104, 200);
7265 [400] = rgb(171, 71, 188);
7266 [500] = rgb(156, 39, 176);
7267 [600] = rgb(142, 36, 170);
7268 [700] = rgb(123, 31, 162);
7269 [800] = rgb(106, 27, 154);
7270 [900] = rgb(74, 20, 140);
7271
7272 Accent = {
7273 [100] = rgb(234, 128, 252);
7274 [200] = rgb(224, 64, 251);
7275 [400] = rgb(213, 0, 249);
7276 [700] = rgb(170, 0, 255);
7277 };
7278 };
7279
7280 DeepPurple = {
7281 [50] = rgb(237, 231, 246);
7282 [100] = rgb(209, 196, 233);
7283 [200] = rgb(179, 157, 219);
7284 [300] = rgb(149, 117, 205);
7285 [400] = rgb(126, 87, 194);
7286 [500] = rgb(103, 58, 183);
7287 [600] = rgb(94, 53, 177);
7288 [700] = rgb(81, 45, 168);
7289 [800] = rgb(69, 39, 160);
7290 [900] = rgb(49, 27, 146);
7291
7292 Accent = {
7293 [100] = rgb(179, 136, 255);
7294 [200] = rgb(124, 77, 255);
7295 [400] = rgb(101, 31, 255);
7296 [700] = rgb(98, 0, 234);
7297 };
7298 };
7299
7300 Indigo = {
7301 [50] = rgb(232, 234, 246);
7302 [100] = rgb(197, 202, 233);
7303 [200] = rgb(159, 168, 218);
7304 [300] = rgb(121, 134, 203);
7305 [400] = rgb(92, 107, 192);
7306 [500] = rgb(63, 81, 181);
7307 [600] = rgb(57, 73, 171);
7308 [700] = rgb(48, 63, 159);
7309 [800] = rgb(40, 53, 147);
7310 [900] = rgb(26, 35, 126);
7311
7312 Accent = {
7313 [100] = rgb(140, 158, 255);
7314 [200] = rgb(83, 109, 254);
7315 [400] = rgb(61, 90, 254);
7316 [700] = rgb(48, 79, 254);
7317 };
7318 };
7319
7320 Blue = {
7321 [50] = rgb(227, 242, 253);
7322 [100] = rgb(187, 222, 251);
7323 [200] = rgb(144, 202, 249);
7324 [300] = rgb(100, 181, 246);
7325 [400] = rgb(66, 165, 245);
7326 [500] = rgb(33, 150, 243);
7327 [600] = rgb(30, 136, 229);
7328 [700] = rgb(25, 118, 210);
7329 [800] = rgb(21, 101, 192);
7330 [900] = rgb(13, 71, 161);
7331
7332 Accent = {
7333 [100] = rgb(130, 177, 255);
7334 [200] = rgb(68, 138, 255);
7335 [400] = rgb(41, 121, 255);
7336 [700] = rgb(41, 98, 255);
7337 };
7338 };
7339
7340 LightBlue = {
7341 [50] = rgb(225, 245, 254);
7342 [100] = rgb(179, 229, 252);
7343 [200] = rgb(129, 212, 250);
7344 [300] = rgb(79, 195, 247);
7345 [400] = rgb(41, 182, 246);
7346 [500] = rgb(3, 169, 244);
7347 [600] = rgb(3, 155, 229);
7348 [700] = rgb(2, 136, 209);
7349 [800] = rgb(2, 119, 189);
7350 [900] = rgb(1, 87, 155);
7351
7352 Accent = {
7353 [100] = rgb(128, 216, 255);
7354 [200] = rgb(64, 196, 255);
7355 [400] = rgb(0, 176, 255);
7356 [700] = rgb(0, 145, 234);
7357 };
7358 };
7359
7360 Cyan = {
7361 [50] = rgb(224, 247, 250);
7362 [100] = rgb(178, 235, 242);
7363 [200] = rgb(128, 222, 234);
7364 [300] = rgb(77, 208, 225);
7365 [400] = rgb(38, 198, 218);
7366 [500] = rgb(0, 188, 212);
7367 [600] = rgb(0, 172, 193);
7368 [700] = rgb(0, 151, 167);
7369 [800] = rgb(0, 131, 143);
7370 [900] = rgb(0, 96, 100);
7371
7372 Accent = {
7373 [100] = rgb(132, 255, 255);
7374 [200] = rgb(24, 255, 255);
7375 [400] = rgb(0, 229, 255);
7376 [700] = rgb(0, 184, 212);
7377 };
7378 };
7379
7380 Teal = {
7381 [50] = rgb(224, 242, 241);
7382 [100] = rgb(178, 223, 219);
7383 [200] = rgb(128, 203, 196);
7384 [300] = rgb(77, 182, 172);
7385 [400] = rgb(38, 166, 154);
7386 [500] = rgb(0, 150, 136);
7387 [600] = rgb(0, 137, 123);
7388 [700] = rgb(0, 121, 107);
7389 [800] = rgb(0, 105, 92);
7390 [900] = rgb(0, 77, 64);
7391
7392 Accent = {
7393 [100] = rgb(167, 255, 235);
7394 [200] = rgb(100, 255, 218);
7395 [400] = rgb(29, 233, 182);
7396 [700] = rgb(0, 191, 165);
7397 };
7398 };
7399
7400 Green = {
7401 [50] = rgb(232, 245, 233);
7402 [100] = rgb(200, 230, 201);
7403 [200] = rgb(165, 214, 167);
7404 [300] = rgb(129, 199, 132);
7405 [400] = rgb(102, 187, 106);
7406 [500] = rgb(76, 175, 80);
7407 [600] = rgb(67, 160, 71);
7408 [700] = rgb(56, 142, 60);
7409 [800] = rgb(46, 125, 50);
7410 [900] = rgb(27, 94, 32);
7411
7412 Accent = {
7413 [100] = rgb(185, 246, 202);
7414 [200] = rgb(105, 240, 174);
7415 [400] = rgb(0, 230, 118);
7416 [700] = rgb(0, 200, 83);
7417 };
7418 };
7419
7420 LightGreen = {
7421 [50] = rgb(241, 248, 233);
7422 [100] = rgb(220, 237, 200);
7423 [200] = rgb(197, 225, 165);
7424 [300] = rgb(174, 213, 129);
7425 [400] = rgb(156, 204, 101);
7426 [500] = rgb(139, 195, 74);
7427 [600] = rgb(124, 179, 66);
7428 [700] = rgb(104, 159, 56);
7429 [800] = rgb(85, 139, 47);
7430 [900] = rgb(51, 105, 30);
7431
7432 Accent = {
7433 [100] = rgb(204, 255, 144);
7434 [200] = rgb(178, 255, 89);
7435 [400] = rgb(118, 255, 3);
7436 [700] = rgb(100, 221, 23);
7437 };
7438 };
7439
7440 Lime = {
7441 [50] = rgb(249, 251, 231);
7442 [100] = rgb(240, 244, 195);
7443 [200] = rgb(230, 238, 156);
7444 [300] = rgb(220, 231, 117);
7445 [400] = rgb(212, 225, 87);
7446 [500] = rgb(205, 220, 57);
7447 [600] = rgb(192, 202, 51);
7448 [700] = rgb(175, 180, 43);
7449 [800] = rgb(158, 157, 36);
7450 [900] = rgb(130, 119, 23);
7451
7452 Accent = {
7453 [100] = rgb(244, 255, 129);
7454 [200] = rgb(238, 255, 65);
7455 [400] = rgb(198, 255, 0);
7456 [700] = rgb(174, 234, 0);
7457 };
7458 };
7459
7460 Yellow = {
7461 [50] = rgb(255, 253, 231);
7462 [100] = rgb(255, 249, 196);
7463 [200] = rgb(255, 245, 157);
7464 [300] = rgb(255, 241, 118);
7465 [400] = rgb(255, 238, 88);
7466 [500] = rgb(255, 235, 59);
7467 [600] = rgb(253, 216, 53);
7468 [700] = rgb(251, 192, 45);
7469 [800] = rgb(249, 168, 37);
7470 [900] = rgb(245, 127, 23);
7471
7472 Accent = {
7473 [100] = rgb(255, 255, 141);
7474 [200] = rgb(255, 255, 0);
7475 [400] = rgb(255, 234, 0);
7476 [700] = rgb(255, 214, 0);
7477 };
7478 };
7479
7480 Amber = {
7481 [50] = rgb(255, 248, 225);
7482 [100] = rgb(255, 236, 179);
7483 [200] = rgb(255, 224, 130);
7484 [300] = rgb(255, 213, 79);
7485 [400] = rgb(255, 202, 40);
7486 [500] = rgb(255, 193, 7);
7487 [600] = rgb(255, 179, 0);
7488 [700] = rgb(255, 160, 0);
7489 [800] = rgb(255, 143, 0);
7490 [900] = rgb(255, 111, 0);
7491
7492 Accent = {
7493 [100] = rgb(255, 229, 127);
7494 [200] = rgb(255, 215, 64);
7495 [400] = rgb(255, 196, 0);
7496 [700] = rgb(255, 171, 0);
7497 };
7498 };
7499
7500 Orange = {
7501 [50] = rgb(255, 243, 224);
7502 [100] = rgb(255, 224, 178);
7503 [200] = rgb(255, 204, 128);
7504 [300] = rgb(255, 183, 77);
7505 [400] = rgb(255, 167, 38);
7506 [500] = rgb(255, 152, 0);
7507 [600] = rgb(251, 140, 0);
7508 [700] = rgb(245, 124, 0);
7509 [800] = rgb(239, 108, 0);
7510 [900] = rgb(230, 81, 0);
7511
7512 Accent = {
7513 [100] = rgb(255, 209, 128);
7514 [200] = rgb(255, 171, 64);
7515 [400] = rgb(255, 145, 0);
7516 [700] = rgb(255, 109, 0);
7517 };
7518 };
7519
7520 DeepOrange = {
7521 [50] = rgb(251, 233, 231);
7522 [100] = rgb(255, 204, 188);
7523 [200] = rgb(255, 171, 145);
7524 [300] = rgb(255, 138, 101);
7525 [400] = rgb(255, 112, 67);
7526 [500] = rgb(255, 87, 34);
7527 [600] = rgb(244, 81, 30);
7528 [700] = rgb(230, 74, 25);
7529 [800] = rgb(216, 67, 21);
7530 [900] = rgb(191, 54, 12);
7531
7532 Accent = {
7533 [100] = rgb(255, 158, 128);
7534 [200] = rgb(255, 110, 64);
7535 [400] = rgb(255, 61, 0);
7536 [700] = rgb(221, 44, 0);
7537 };
7538 };
7539
7540 Brown = {
7541 [50] = rgb(239, 235, 233);
7542 [100] = rgb(215, 204, 200);
7543 [200] = rgb(188, 170, 164);
7544 [300] = rgb(161, 136, 127);
7545 [400] = rgb(141, 110, 99);
7546 [500] = rgb(121, 85, 72);
7547 [600] = rgb(109, 76, 65);
7548 [700] = rgb(93, 64, 55);
7549 [800] = rgb(78, 52, 46);
7550 [900] = rgb(62, 39, 35);
7551 };
7552
7553 Grey = {
7554 [50] = rgb(250, 250, 250);
7555 [100] = rgb(245, 245, 245);
7556 [200] = rgb(238, 238, 238);
7557 [300] = rgb(224, 224, 224);
7558 [400] = rgb(189, 189, 189);
7559 [500] = rgb(158, 158, 158);
7560 [600] = rgb(117, 117, 117);
7561 [700] = rgb(97, 97, 97);
7562 [800] = rgb(66, 66, 66);
7563 [900] = rgb(33, 33, 33);
7564 };
7565
7566 BlueGrey = {
7567 [50] = rgb(236, 239, 241);
7568 [100] = rgb(207, 216, 220);
7569 [200] = rgb(176, 190, 197);
7570 [300] = rgb(144, 164, 174);
7571 [400] = rgb(120, 144, 156);
7572 [500] = rgb(96, 125, 139);
7573 [600] = rgb(84, 110, 122);
7574 [700] = rgb(69, 90, 100);
7575 [800] = rgb(55, 71, 79);
7576 [900] = rgb(38, 50, 56);
7577 };
7578
7579 Black = rgb(0, 0, 0);
7580 White = rgb(255, 255, 255);
7581}
7582
7583function Color.toRGBString(c, a)
7584 local r = c.r * 255 + 0.5
7585 local g = c.g * 255 + 0.5
7586 local b = c.b * 255 + 0.5
7587
7588 if a then
7589 return ("rgba(%u, %u, %u, %u)"):format(r, g, b, a * 255 + 0.5)
7590 else
7591 return ("rgb(%u, %u, %u)"):format(r, g, b)
7592 end
7593end
7594Color.ToRGBString = Color.toRGBString
7595
7596function Color.toHexString(c, a)
7597 local r = c.r * 255 + 0.5
7598 local g = c.g * 255 + 0.5
7599 local b = c.b * 255 + 0.5
7600
7601 if a then
7602 return ("#%X%X%X%X"):format(r, g, b, a * 255 + 0.5)
7603 else
7604 return ("#%X%X%X"):format(r, g, b)
7605 end
7606end
7607Color.ToHexString = Color.toHexString
7608
7609local Hash = ("#"):byte()
7610
7611function Color.fromHex(Hex)
7612 -- Converts a 3-digit or 6-digit hex color to RGB
7613 -- Takes in a string of the form: "#FFFFFF" or "#FFF" or a 6-digit hexadecimal number
7614
7615 local Type = type(Hex)
7616 local Digits
7617
7618 if Type == "string" then
7619 if Hex:byte() == Hash then Hex = Hex:sub(2) end -- Remove # from beginning
7620
7621 Digits = #Hex
7622
7623 if Digits == 8 then -- We got some alpha :D
7624 return Color.fromHex(Hex:sub(1, -3)), tonumber(Hex, 16) % 0x000100 / 255
7625 end
7626
7627 Hex = tonumber(Hex, 16) -- Leverage Lua's base converter :D
7628 elseif Type == "number" then
7629 Digits = 6 -- Assume numbers are 6 digit hex numbers
7630 end
7631
7632 if Digits == 6 then
7633 -- Isolate R as first digits 5 and 6, G as 3 and 4, B as 1 and 2
7634
7635 local R = (Hex - Hex % 0x010000) / 0x010000
7636 Hex = Hex - R * 0x010000
7637 local G = (Hex - Hex % 0x000100) / 0x000100
7638
7639 return rgb(R, G, Hex - G * 0x000100)
7640 elseif Digits == 3 then
7641 -- 3-digit to 6-digit conversion: 123 -> 112233
7642 -- Thus, we isolate each digits' value and multiply by 17
7643
7644 local R = (Hex - Hex % 0x100) / 0x100
7645 Hex = Hex - R * 0x100
7646 local G = (Hex - Hex % 0x10) / 0x10
7647
7648 return rgb(R * 0x11, G * 0x11, (Hex - G * 0x10) * 0x11)
7649 end
7650end
7651Color.FromHex = Color.fromHex
7652
7653local floor = math.floor
7654
7655function Color.toHex(Color3)
7656 return floor(Color3.r * 0xFF + 0.5) * 0x010000 + floor(Color3.g * 0xFF + 0.5) * 0x000100 + floor(Color3.b * 0xFF + 0.5) * 0x000001
7657end
7658Color.ToHex = Color.toHex
7659
7660return Table.Lock(Color)
7661-- Debugging Utilities
7662-- @source https://raw.githubusercontent.com/RoStrap/Debugging/master/Debug.lua
7663-- @rostrap Debug
7664-- @documentation https://rostrap.github.io/Libraries/Debugging/Debug/
7665-- @author Validark
7666
7667
7668local Resources={
7669LoadLibrary=function(self,name)
7670local lib = shared[name:lower()]
7671if(lib and lib:IsA'ModuleScript')then
7672return require(lib)
7673else
7674warn'lol that no exist'
7675return {}
7676end
7677end
7678}
7679
7680local Table = Resources:LoadLibrary("Table")
7681local Typer = Resources:LoadLibrary("Typer")
7682
7683local Debug = {}
7684local TAB = (" "):rep(4)
7685
7686local Services = setmetatable({}, { -- Memoize GetService calls
7687 __index = function(self, i)
7688 local Success, Object = pcall(game.GetService, game, i)
7689 local Service = Success and Object
7690 self[i] = Service
7691 return Service
7692 end;
7693})
7694
7695Debug.DirectoryToString = Typer.AssignSignature(Typer.Instance, function(Object)
7696 --- Gets the string of the directory of an object, properly formatted
7697 -- string DirectoryToString(Object)
7698 -- @returns Objects location in proper Lua format
7699 -- @author Validark
7700 -- My implementation of the built-in GetFullName function which returns properly formatted text.
7701
7702 local FullName = {}
7703 local Count = 0
7704
7705 while Object.Parent ~= game and Object.Parent ~= nil do
7706 local ObjectName = Object.Name:gsub("([\\\"])", "\\%1")
7707
7708 if ObjectName:find("^[_%a][_%w]*$") then
7709 FullName[Count] = "." .. ObjectName
7710 else
7711 FullName[Count] = "[\"" .. ObjectName .. "\"]"
7712 end
7713 Count = Count - 1
7714 Object = Object.Parent
7715 end
7716
7717 if Services[Object.ClassName] == Object then
7718 FullName[Count] = "game:GetService(\"" .. Object.ClassName .. "\")"
7719 else
7720 FullName[Count] = "." .. "[\"" .. Object.Name .. "\"]" -- A dot at the beginning indicates a rootless Object
7721 end
7722
7723 return table.concat(FullName, "", Count, 0)
7724end)
7725
7726local GetErrorData do
7727 -- Standard RoStrap Erroring system
7728 -- Prefixing errors with '!' makes Error expect the [error origin].Name as first parameter after Error string
7729 -- Past the initial Error string, subsequent arguments get unpacked in a string.format of the error string
7730 -- Arguments formmatted into the string get stringified (see above function)
7731 -- Assert falls back on Error
7732 -- Error blames the latest item on the traceback as the cause of the error
7733 -- Error makes it clear which Library and function are being misused
7734 -- @author Validark
7735
7736 local Replacers = {
7737 ["Index ?"] = "__index";
7738 ["Newindex ?"] = "__newindex";
7739 }
7740
7741 local function Format(String, ...)
7742 return String:format(...)
7743 end
7744
7745 local CommandBar = {Name = "Command bar"}
7746
7747 function GetErrorData(Err, ...) -- Make sure if you don't intend to format arguments in, you do %%f instead of %f
7748 if type(Err) ~= "string" then
7749 error(GetErrorData("!The first parameter of error formatting must be a string", "Debug"))
7750 end
7751
7752 local t = {...}
7753
7754 local Traceback = debug.traceback()
7755 local ErrorDepth = select(2, Traceback:gsub("\n", "")) - 2
7756
7757 local Prefix
7758 Err, Prefix = Err:gsub("^!", "", 1)
7759 local ModuleName = Prefix == 1 and table.remove(t, 1) or (getfenv(ErrorDepth).script or CommandBar).Name
7760 local FunctionName
7761
7762 for i = 1, select("#", ...) do
7763 t[i] = Debug.Inspect(t[i])
7764 end
7765
7766 for x in Traceback:sub(1, -11):gmatch("%- [^\r\n]+[\r\n]") do
7767 FunctionName = x
7768 end
7769
7770 FunctionName = FunctionName:sub(3, -2):gsub("%l+ (%S+)$", "%1"):gsub(" ([^\n\r]+)", " %1", 1)
7771
7772 local i = 0
7773 for x in Err:gmatch("%%%l") do
7774 i = i + 1
7775 if x == "%q" then
7776 t[i] = t[i]:gsub(" (%S+)$", " \"%1\"", 1)
7777 end
7778 end
7779
7780 local Success, ErrorString = pcall(Format, "[%s] {%s} " .. Err:gsub("%%q", "%%s"), ModuleName, Replacers[FunctionName] or FunctionName, unpack(t))
7781
7782 if Success then
7783 return ErrorString, ErrorDepth
7784 else
7785 error(GetErrorData("!Error formatting failed, perhaps try escaping non-formattable tags like so: %%%%f\n(Error Message): " .. ErrorString, "Debug"))
7786 end
7787 end
7788
7789 function Debug.Warn(...)
7790 warn((GetErrorData(...)))
7791 end
7792
7793 function Debug.Error(...)
7794 error(GetErrorData(...))
7795 end
7796
7797 function Debug.Assert(Condition, ...)
7798 return Condition or error(GetErrorData(...))
7799 end
7800end
7801
7802do
7803 local function Alphabetically(a, b)
7804 local typeA = type(a)
7805 local typeB = type(b)
7806
7807 if typeA == typeB then
7808 if typeA == "number" then
7809 return a < b
7810 else
7811 return tostring(a):lower() < tostring(b):lower()
7812 end
7813 else
7814 return typeA < typeB
7815 end
7816 end
7817
7818 Debug.AlphabeticalOrder = Typer.AssignSignature(Typer.Table, function(Dictionary)
7819 --- Iteration function that iterates over a dictionary in alphabetical order
7820 -- function AlphabeticalOrder(Dictionary)
7821 -- @param table Dictionary That which will be iterated over in alphabetical order
7822 -- A dictionary looks like this: {Apple = true, Noodles = 5, Soup = false}
7823 -- Not case-sensitive
7824 -- @author Validark
7825
7826 local Count = 0
7827 local Order = {}
7828
7829 for Key in next, Dictionary do
7830 Count = Count + 1
7831 Order[Count] = Key
7832 end
7833
7834 table.sort(Order, Alphabetically)
7835
7836 local i = 0
7837
7838 return function(Table)
7839 i = i + 1
7840 local Key = Order[i]
7841 return Key, Table[Key], i
7842 end, Dictionary, nil
7843 end)
7844end
7845
7846function Debug.UnionIteratorFunctions(...)
7847 -- Takes in functions ..., and returns a function which unions them, which can be called on a table
7848 -- Will iterate through a table, using the iterator functions passed in from left to right
7849 -- Will pass the CurrentIteratorFunction index in the stack as the last variable
7850 -- UnionIteratorFunctions(Get0, ipairs, Debug.AlphabeticalOrder)(Table)
7851
7852 local IteratorFunctions = {...}
7853
7854 for i = 1, #IteratorFunctions do
7855 if type(IteratorFunctions[i]) ~= "function" then
7856 error(GetErrorData("Cannot union Iterator functions which aren't functions"))
7857 end
7858 end
7859
7860 return function(Table)
7861 local Count = 0
7862 local Order = {[0] = {}}
7863 local KeysSeen = {}
7864
7865 for i = 1, #IteratorFunctions do
7866 local Function, TableToIterateThrough, Next = IteratorFunctions[i](Table)
7867
7868 if type(Function) ~= "function" or type(TableToIterateThrough) ~= "table" then
7869 error(GetErrorData("Iterator function " .. i .. " must return a stack of types as follows: Function, Table, Variant"))
7870 end
7871
7872 while true do
7873 local Data = {Function(TableToIterateThrough, Next)}
7874 Next = Data[1]
7875 if Next == nil then break end
7876 if not KeysSeen[Next] then
7877 KeysSeen[Next] = true
7878 Count = Count + 1
7879 Data[#Data + 1] = i
7880 Order[Count] = Data
7881 end
7882 end
7883 end
7884
7885 return function(_, Previous)
7886 for i = 0, Count do
7887 if Order[i][1] == Previous then
7888 local Data = Order[i + 1]
7889 if Data then
7890 return unpack(Data)
7891 else
7892 return nil
7893 end
7894 end
7895 end
7896
7897 error(GetErrorData("invalid key to unioned iterator function: " .. Previous))
7898 end, Table, nil
7899 end
7900end
7901
7902local EachOrder do
7903 -- TODO: Write a function that takes multiple iterator functions and iterates through each passed in function
7904 -- EachOrder(Get0(Table), ipairs(Table), AlphabeticalOrder(Table))
7905end
7906
7907do
7908 local typeof = typeof or type
7909 local ConvertTableIntoString
7910
7911 local function Parse(Object, Multiline, Depth, EncounteredTables)
7912 local Type = typeof(Object)
7913
7914 return
7915 Type == "table" and (EncounteredTables[Object] and "[table " .. EncounteredTables[Object] .. "]" or ConvertTableIntoString(Object, nil, Multiline, Depth + 1, EncounteredTables))
7916 or Type == "string" and "\"" .. Object .. "\""
7917 or Type == "Instance" and "<" .. Debug.DirectoryToString(Object) .. ">"
7918 or (Type == "function" or Type == "userdata") and Type
7919 or tostring(Object)
7920 end
7921
7922 function ConvertTableIntoString(Table, TableName, Multiline, Depth, EncounteredTables)
7923 local n = EncounteredTables.n + 1
7924 EncounteredTables[Table] = n
7925 EncounteredTables.n = n
7926
7927 local t = {}
7928 local CurrentArrayIndex = 1
7929
7930 if TableName then
7931 t[1] = TableName
7932 t[2] = " = {"
7933 else
7934 t[1] = "{"
7935 end
7936
7937 if not next(Table) then
7938 t[#t + 1] = "}"
7939 return table.concat(t)
7940 end
7941
7942 for Key, Value in Debug.AlphabeticalOrder(Table) do
7943 if not Multiline and type(Key) == "number" then
7944 if Key == CurrentArrayIndex then
7945 CurrentArrayIndex = CurrentArrayIndex + 1
7946 else
7947 t[#t + 1] = "[" .. Key .. "] = "
7948 end
7949 t[#t + 1] = Parse(Value, Multiline, Depth, EncounteredTables)
7950 t[#t + 1] = ", "
7951 else
7952 if Multiline then
7953 t[#t + 1] = "\n"
7954 t[#t + 1] = (TAB):rep(Depth)
7955 end
7956
7957 if type(Key) == "string" and Key:find("^[%a_][%w_]*$") then
7958 t[#t + 1] = Key
7959 else
7960 t[#t + 1] = "["
7961 t[#t + 1] = Parse(Key, Multiline, Depth, EncounteredTables)
7962 t[#t + 1] = "]"
7963 end
7964
7965 t[#t + 1] = " = "
7966 t[#t + 1] = Parse(Value, Multiline, Depth, EncounteredTables)
7967 t[#t + 1] = Multiline and ";" or ", "
7968 end
7969 end
7970
7971 if Multiline then
7972 t[#t + 1] = "\n"
7973 t[#t + 1] = (TAB):rep(Depth - 1)
7974 else
7975 t[#t] = nil
7976 end
7977
7978 t[#t + 1] = "}"
7979
7980 local Metatable = getmetatable(Table)
7981
7982 if Metatable then
7983 t[#t + 1] = " <- "
7984 t[#t + 1] = type(Metatable) == "table" and ConvertTableIntoString(Metatable, nil, Multiline, Depth, EncounteredTables) or Debug.Inspect(Metatable)
7985 end
7986
7987 return table.concat(t)
7988 end
7989
7990 Debug.TableToString = Typer.AssignSignature(Typer.Table, Typer.OptionalBoolean, Typer.OptionalString, function(Table, Multiline, TableName)
7991 --- Converts a table into a readable string
7992 -- string TableToString(Table, TableName, Multiline)
7993 -- @param table Table The Table to convert into a readable string
7994 -- @param string TableName Optional Name parameter that puts a "[TableName] = " at the beginning
7995 -- @returns a readable string version of the table
7996
7997 return ConvertTableIntoString(Table, TableName, Multiline, 1, {n = 0})
7998 end)
7999end
8000
8001do
8002 local EscapedCharacters = {"%", "^", "$", "(", ")", ".", "[", "]", "*", "+", "-", "?"}
8003 local Escapable = "([%" .. table.concat(EscapedCharacters, "%") .. "])"
8004
8005 Debug.EscapeString = Typer.AssignSignature(Typer.String, function(String)
8006 --- Turns strings into Lua-readble format
8007 -- string Debug.EscapeString(String)
8008 -- @returns Objects location in proper Lua format
8009 -- @author Validark
8010 -- Useful for when you are doing string-intensive coding
8011 -- Those minus signs always get me when I'm not using this function!
8012
8013 return (
8014 String
8015 :gsub(Escapable, "%%%1")
8016 :gsub("([\"\'\\])", "\\%1")
8017 )
8018 end)
8019end
8020
8021function Debug.Inspect(...)
8022 --- Returns a string representation of anything
8023 -- @param any Object The object you wish to represent as a string
8024 -- @returns a readable string representation of the object
8025
8026 local List = ""
8027
8028 for i = 1, select("#", ...) do
8029 local Data = select(i, ...)
8030 local DataType = typeof(Data)
8031 local DataString
8032
8033 if DataType == "Instance" then
8034 DataType = Data.ClassName
8035 DataString = Debug.DirectoryToString(Data)
8036 else
8037 DataString = DataType == "table" and Debug.TableToString(Data)
8038 or DataType == "string" and "\"" .. Data .. "\""
8039 or tostring(Data)
8040 end
8041
8042 List = List .. ", " .. ((DataType .. " " .. DataString):gsub("^" .. DataType .. " " .. DataType, DataType, 1))
8043 end
8044
8045 if List == "" then
8046 return "NONE"
8047 else
8048 return List:sub(3)
8049 end
8050end
8051
8052return Table.Lock(Debug)
8053-- Prescribed Material design Beziers and optimized Robert Penner functions
8054-- @documentation https://rostrap.github.io/Libraries/Interpolation/EasingFunctions/
8055-- @source https://raw.githubusercontent.com/RoStrap/Interpolation/master/EasingFunctions.lua
8056-- @rostrap EasingFunctions
8057-- @author Robert Penner
8058
8059
8060local Resources={
8061LoadLibrary=function(self,name)
8062local lib = shared[name:lower()]
8063if(lib and lib:IsA'ModuleScript')then
8064return require(lib)
8065else
8066warn'lol that no exist'
8067return {}
8068end
8069end
8070}
8071
8072local Table = Resources:LoadLibrary("Table")
8073local Bezier = Resources:LoadLibrary("Bezier")
8074local Enumeration = Resources:LoadLibrary("Enumeration")
8075
8076-- @specs https://material.io/guidelines/motion/duration-easing.html#duration-easing-natural-easing-curves
8077local Sharp = Bezier.new(0.4, 0, 0.6, 1)
8078local Standard = Bezier.new(0.4, 0, 0.2, 1)
8079local Acceleration = Bezier.new(0.4, 0, 1, 1)
8080local Deceleration = Bezier.new(0, 0, 0.2, 1)
8081
8082Enumeration.EasingFunction = {
8083 "Standard";
8084 "Deceleration";
8085 "Acceleration";
8086 "Sharp";
8087
8088 "Linear";
8089
8090 "InSine";
8091 "OutSine";
8092 "InOutSine";
8093 "OutInSine";
8094
8095 "InBack";
8096 "OutBack";
8097 "InOutBack";
8098 "OutInBack";
8099
8100 "InQuad";
8101 "OutQuad";
8102 "InOutQuad";
8103 "OutInQuad";
8104
8105 "InQuart";
8106 "OutQuart";
8107 "InOutQuart";
8108 "OutInQuart";
8109
8110 "InQuint";
8111 "OutQuint";
8112 "InOutQuint";
8113 "OutInQuint";
8114
8115 "InBounce";
8116 "OutBounce";
8117 "InOutBounce";
8118 "OutInBounce";
8119
8120 "InElastic";
8121 "OutElastic";
8122 "InOutElastic";
8123 "OutInElastic";
8124
8125 "InCirc";
8126 "OutCirc";
8127 "InOutCirc";
8128 "OutInCirc";
8129
8130 "InCubic";
8131 "OutCubic";
8132 "InOutCubic";
8133 "OutInCubic";
8134
8135 "InExpo";
8136 "OutExpo";
8137 "InOutExpo";
8138 "OutInExpo";
8139
8140 "Smooth";
8141 "Smoother";
8142 "RevBack";
8143 "RidiculousWiggle";
8144 "Spring";
8145 "SoftSpring";
8146}
8147
8148--[[
8149 Disclaimer for Robert Penner's Easing Equations license:
8150
8151 TERMS OF USE - EASING EQUATIONS
8152
8153 Open source under the BSD License.
8154
8155 Copyright © 2001 Robert Penner
8156 All rights reserved.
8157
8158 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
8159
8160 * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
8161 * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8162 * Neither the name of the author nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission.
8163
8164 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
8165 IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
8166 OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8167]]
8168
8169-- For all easing functions:
8170-- t = elapsed time
8171-- b = beginning value
8172-- c = change in value same as: ending - beginning
8173-- d = duration (total time)
8174
8175-- Where applicable
8176-- a = amplitude
8177-- p = period
8178
8179local sin, cos, pi, abs, asin = math.sin, math.cos, math.pi, math.abs, math.asin
8180local _2pi = 2 * pi
8181local _halfpi = 0.5 * pi
8182local SoftSpringpi = -3.2*pi
8183local Springpi = 2*SoftSpringpi
8184
8185local function Linear(t, b, c, d)
8186 return c * t / d + b
8187end
8188
8189local function Smooth(t, b, c, d)
8190 t = t / d
8191 return c * t * t * (3 - 2*t) + b
8192end
8193
8194local function Smoother(t, b, c, d)
8195 t = t / d
8196 return c*t*t*t * (t * (6*t - 15) + 10) + b
8197end
8198
8199-- Arceusinator's Easing Functions
8200local function RevBack(t, b, c, d)
8201 t = 1 - t / d
8202 return c*(1 - (sin(t*_halfpi) + (sin(t*pi) * (cos(t*pi) + 1)*0.5))) + b
8203end
8204
8205local function RidiculousWiggle(t, b, c, d)
8206 t = t / d
8207 return c*sin(sin(t*pi)*_halfpi) + b
8208end
8209
8210-- YellowTide's Easing Functions
8211local function Spring(t, b, c, d)
8212 t = t / d
8213 return (1 + (-2.72^(-6.9*t) * cos(Springpi*t))) * c + b
8214end
8215
8216local function SoftSpring(t, b, c, d)
8217 t = t / d
8218 return (1 + (-2.72^(-7.5*t) * cos(SoftSpringpi*t))) * c + b
8219end
8220-- End of YellowTide's functions
8221
8222local function InQuad(t, b, c, d)
8223 t = t / d
8224 return c * t * t + b
8225end
8226
8227local function OutQuad(t, b, c, d)
8228 t = t / d
8229 return -c * t * (t - 2) + b
8230end
8231
8232local function InOutQuad(t, b, c, d)
8233 t = t / d * 2
8234 return t < 1 and c * 0.5 * t * t + b or -c * 0.5 * ((t - 1) * (t - 3) - 1) + b
8235end
8236
8237local function OutInQuad(t, b, c, d)
8238 if t < d * 0.5 then
8239 t = 2 * t / d
8240 return -0.5 * c * t * (t - 2) + b
8241 else
8242 t, c = ((t * 2) - d) / d, 0.5 * c
8243 return c * t * t + b + c
8244 end
8245end
8246
8247local function InCubic(t, b, c, d)
8248 t = t / d
8249 return c * t * t * t + b
8250end
8251
8252local function OutCubic(t, b, c, d)
8253 t = t / d - 1
8254 return c * (t * t * t + 1) + b
8255end
8256
8257local function InOutCubic(t, b, c, d)
8258 t = t / d * 2
8259 if t < 1 then
8260 return c * 0.5 * t * t * t + b
8261 else
8262 t = t - 2
8263 return c * 0.5 * (t * t * t + 2) + b
8264 end
8265end
8266
8267local function OutInCubic(t, b, c, d)
8268 if t < d * 0.5 then
8269 t = t * 2 / d - 1
8270 return c * 0.5 * (t * t * t + 1) + b
8271 else
8272 t, c = ((t * 2) - d) / d, c * 0.5
8273 return c * t * t * t + b + c
8274 end
8275end
8276
8277local function InQuart(t, b, c, d)
8278 t = t / d
8279 return c * t * t * t * t + b
8280end
8281
8282local function OutQuart(t, b, c, d)
8283 t = t / d - 1
8284 return -c * (t * t * t * t - 1) + b
8285end
8286
8287local function InOutQuart(t, b, c, d)
8288 t = t / d * 2
8289 if t < 1 then
8290 return c * 0.5 * t * t * t * t + b
8291 else
8292 t = t - 2
8293 return -c * 0.5 * (t * t * t * t - 2) + b
8294 end
8295end
8296
8297local function OutInQuart(t, b, c, d)
8298 if t < d * 0.5 then
8299 t, c = t * 2 / d - 1, c * 0.5
8300 return -c * (t * t * t * t - 1) + b
8301 else
8302 t, c = ((t * 2) - d) / d, c * 0.5
8303 return c * t * t * t * t + b + c
8304 end
8305end
8306
8307local function InQuint(t, b, c, d)
8308 t = t / d
8309 return c * t * t * t * t * t + b
8310end
8311
8312local function OutQuint(t, b, c, d)
8313 t = t / d - 1
8314 return c * (t * t * t * t * t + 1) + b
8315end
8316
8317local function InOutQuint(t, b, c, d)
8318 t = t / d * 2
8319 if t < 1 then
8320 return c * 0.5 * t * t * t * t * t + b
8321 else
8322 t = t - 2
8323 return c * 0.5 * (t * t * t * t * t + 2) + b
8324 end
8325end
8326
8327local function OutInQuint(t, b, c, d)
8328 if t < d * 0.5 then
8329 t = t * 2 / d - 1
8330 return c * 0.5 * (t * t * t * t * t + 1) + b
8331 else
8332 t, c = ((t * 2) - d) / d, c * 0.5
8333 return c * t * t * t * t * t + b + c
8334 end
8335end
8336
8337local function InSine(t, b, c, d)
8338 return -c * cos(t / d * _halfpi) + c + b
8339end
8340
8341local function OutSine(t, b, c, d)
8342 return c * sin(t / d * _halfpi) + b
8343end
8344
8345local function InOutSine(t, b, c, d)
8346 return -c * 0.5 * (cos(pi * t / d) - 1) + b
8347end
8348
8349local function OutInSine(t, b, c, d)
8350 c = c * 0.5
8351 return t < d * 0.5 and c * sin(t * 2 / d * _halfpi) + b or -c * cos(((t * 2) - d) / d * _halfpi) + 2 * c + b
8352end
8353
8354local function InExpo(t, b, c, d)
8355 return t == 0 and b or c * 2 ^ (10 * (t / d - 1)) + b - c * 0.001
8356end
8357
8358local function OutExpo(t, b, c, d)
8359 return t == d and b + c or c * 1.001 * (1 - 2 ^ (-10 * t / d)) + b
8360end
8361
8362local function InOutExpo(t, b, c, d)
8363 t = t / d * 2
8364 return t == 0 and b or t == 2 and b + c or t < 1 and c * 0.5 * 2 ^ (10 * (t - 1)) + b - c * 0.0005 or c * 0.5 * 1.0005 * (2 - 2 ^ (-10 * (t - 1))) + b
8365end
8366
8367local function OutInExpo(t, b, c, d)
8368 c = c * 0.5
8369 return t < d * 0.5 and (t * 2 == d and b + c or c * 1.001 * (1 - 2 ^ (-20 * t / d)) + b) or t * 2 - d == 0 and b + c or c * 2 ^ (10 * ((t * 2 - d) / d - 1)) + b + c - c * 0.001
8370end
8371
8372local function InCirc(t, b, c, d)
8373 t = t / d
8374 return -c * ((1 - t * t) ^ 0.5 - 1) + b
8375end
8376
8377local function OutCirc(t, b, c, d)
8378 t = t / d - 1
8379 return c * (1 - t * t) ^ 0.5 + b
8380end
8381
8382local function InOutCirc(t, b, c, d)
8383 t = t / d * 2
8384 if t < 1 then
8385 return -c * 0.5 * ((1 - t * t) ^ 0.5 - 1) + b
8386 else
8387 t = t - 2
8388 return c * 0.5 * ((1 - t * t) ^ 0.5 + 1) + b
8389 end
8390end
8391
8392local function OutInCirc(t, b, c, d)
8393 c = c * 0.5
8394 if t < d * 0.5 then
8395 t = t * 2 / d - 1
8396 return c * (1 - t * t) ^ 0.5 + b
8397 else
8398 t = (t * 2 - d) / d
8399 return -c * ((1 - t * t) ^ 0.5 - 1) + b + c
8400 end
8401end
8402
8403local function InElastic(t, b, c, d, a, p)
8404 t = t / d - 1
8405 p = p or d * 0.3
8406 return t == -1 and b or t == 0 and b + c or (not a or a < abs(c)) and -(c * 2 ^ (10 * t) * sin((t * d - p * .25) * _2pi / p)) + b or -(a * 2 ^ (10 * t) * sin((t * d - p / _2pi * asin(c/a)) * _2pi / p)) + b
8407end
8408
8409local function OutElastic(t, b, c, d, a, p)
8410 t = t / d
8411 p = p or d * 0.3
8412 return t == 0 and b or t == 1 and b + c or (not a or a < abs(c)) and c * 2 ^ (-10 * t) * sin((t * d - p * .25) * _2pi / p) + c + b or a * 2 ^ (-10 * t) * sin((t * d - p / _2pi * asin(c / a)) * _2pi / p) + c + b
8413end
8414
8415local function InOutElastic(t, b, c, d, a, p)
8416 if t == 0 then
8417 return b
8418 end
8419
8420 t = t / d * 2 - 1
8421
8422 if t == 1 then
8423 return b + c
8424 end
8425
8426 p = p or d * .45
8427 a = a or 0
8428
8429 local s
8430
8431 if not a or a < abs(c) then
8432 a = c
8433 s = p * .25
8434 else
8435 s = p / _2pi * asin(c / a)
8436 end
8437
8438 if t < 1 then
8439 return -0.5 * a * 2 ^ (10 * t) * sin((t * d - s) * _2pi / p) + b
8440 else
8441 return a * 2 ^ (-10 * t) * sin((t * d - s) * _2pi / p ) * 0.5 + c + b
8442 end
8443end
8444
8445local function OutInElastic(t, b, c, d, a, p)
8446 if t < d * 0.5 then
8447 return OutElastic(t * 2, b, c * 0.5, d, a, p)
8448 else
8449 return InElastic(t * 2 - d, b + c * 0.5, c * 0.5, d, a, p)
8450 end
8451end
8452
8453local function InBack(t, b, c, d, s)
8454 s = s or 1.70158
8455 t = t / d
8456 return c * t * t * ((s + 1) * t - s) + b
8457end
8458
8459local function OutBack(t, b, c, d, s)
8460 s = s or 1.70158
8461 t = t / d - 1
8462 return c * (t * t * ((s + 1) * t + s) + 1) + b
8463end
8464
8465local function InOutBack(t, b, c, d, s)
8466 s = (s or 1.70158) * 1.525
8467 t = t / d * 2
8468 if t < 1 then
8469 return c * 0.5 * (t * t * ((s + 1) * t - s)) + b
8470 else
8471 t = t - 2
8472 return c * 0.5 * (t * t * ((s + 1) * t + s) + 2) + b
8473 end
8474end
8475
8476local function OutInBack(t, b, c, d, s)
8477 c = c * 0.5
8478 s = s or 1.70158
8479 if t < d * 0.5 then
8480 t = (t * 2) / d - 1
8481 return c * (t * t * ((s + 1) * t + s) + 1) + b
8482 else
8483 t = ((t * 2) - d) / d
8484 return c * t * t * ((s + 1) * t - s) + b + c
8485 end
8486end
8487
8488local function OutBounce(t, b, c, d)
8489 t = t / d
8490 if t < 1 / 2.75 then
8491 return c * (7.5625 * t * t) + b
8492 elseif t < 2 / 2.75 then
8493 t = t - (1.5 / 2.75)
8494 return c * (7.5625 * t * t + 0.75) + b
8495 elseif t < 2.5 / 2.75 then
8496 t = t - (2.25 / 2.75)
8497 return c * (7.5625 * t * t + 0.9375) + b
8498 else
8499 t = t - (2.625 / 2.75)
8500 return c * (7.5625 * t * t + 0.984375) + b
8501 end
8502end
8503
8504local function InBounce(t, b, c, d)
8505 return c - OutBounce(d - t, 0, c, d) + b
8506end
8507
8508local function InOutBounce(t, b, c, d)
8509 if t < d * 0.5 then
8510 return InBounce(t * 2, 0, c, d) * 0.5 + b
8511 else
8512 return OutBounce(t * 2 - d, 0, c, d) * 0.5 + c * 0.5 + b
8513 end
8514end
8515
8516local function OutInBounce(t, b, c, d)
8517 if t < d * 0.5 then
8518 return OutBounce(t * 2, b, c * 0.5, d)
8519 else
8520 return InBounce(t * 2 - d, b + c * 0.5, c * 0.5, d)
8521 end
8522end
8523
8524return Table.Lock {
8525 [0] = Standard;
8526 Deceleration;
8527 Acceleration;
8528 Sharp;
8529
8530 Linear;
8531
8532 InSine;
8533 OutSine;
8534 InOutSine;
8535 OutInSine;
8536
8537 InBack;
8538 OutBack;
8539 InOutBack;
8540 OutInBack;
8541
8542 InQuad;
8543 OutQuad;
8544 InOutQuad;
8545 OutInQuad;
8546
8547 InQuart;
8548 OutQuart;
8549 InOutQuart;
8550 OutInQuart;
8551
8552 InQuint;
8553 OutQuint;
8554 InOutQuint;
8555 OutInQuint;
8556
8557 InBounce;
8558 OutBounce;
8559 InOutBounce;
8560 OutInBounce;
8561
8562 InElastic;
8563 OutElastic;
8564 InOutElastic;
8565 OutInElastic;
8566
8567 InCirc;
8568 OutCirc;
8569 InOutCirc;
8570 OutInCirc;
8571
8572 InCubic;
8573 OutCubic;
8574 InOutCubic;
8575 OutInCubic;
8576
8577 InExpo;
8578 OutExpo;
8579 InOutExpo;
8580 OutInExpo;
8581
8582 Smooth;
8583 Smoother;
8584 RevBack;
8585 RidiculousWiggle;
8586 Spring;
8587 SoftSpring;
8588}
8589-- Pure-lua implementation of Roblox-style Enums
8590-- @documentation https://rostrap.github.io/Libraries/Classes/Enumeration
8591-- @source https://raw.githubusercontent.com/RoStrap/Classes/master/Enumeration.lua
8592-- @rostrap Enumeration
8593-- @author Validark
8594
8595
8596local Resources={
8597LoadLibrary=function(self,name)
8598local lib = shared[name:lower()]
8599if(lib and lib:IsA'ModuleScript')then
8600return require(lib)
8601else
8602warn'lol that no exist'
8603return {}
8604end
8605end
8606}
8607
8608local Debug = Resources:LoadLibrary("Debug")
8609local Typer = Resources:LoadLibrary("Typer")
8610local SortedArray = Resources:LoadLibrary("SortedArray")
8611
8612local Error__index = {
8613 __index = function(_, i)
8614 Debug.Error(tostring(i) .. " is not a valid EnumerationItem")
8615 end;
8616}
8617
8618local Error__index2 = {
8619 __index = function(_, i)
8620 Debug.Error(tostring(i) .. " is not a valid member")
8621 end;
8622}
8623
8624local EnumerationsArray = SortedArray.new(nil, function(Left, Right)
8625 return tostring(Left) < tostring(Right)
8626end)
8627
8628local Enumerations = setmetatable({}, Error__index)
8629
8630function Enumerations:GetEnumerations()
8631 return EnumerationsArray:Copy()
8632end
8633
8634local function ReadOnlyNewIndex(_, Index, _)
8635 Debug.Error("Cannot write to index [%q]", Index)
8636end
8637
8638local function CompareEnumTypes(EnumItem1, EnumItem2)
8639 return EnumItem1.Value < EnumItem2.Value
8640end
8641
8642local Casts = {}
8643local EnumContainerTemplate = {}
8644EnumContainerTemplate.__index = setmetatable({}, Error__index)
8645
8646function EnumContainerTemplate.__index:GetEnumerationItems()
8647 local Array = {}
8648 local Count = 0
8649
8650 for _, Item in next, EnumContainerTemplate[self] do
8651 Count = Count + 1
8652 Array[Count] = Item
8653 end
8654
8655 table.sort(Array, CompareEnumTypes)
8656 return Array
8657end
8658
8659function EnumContainerTemplate.__index:Cast(Value)
8660 local Castables = Casts[self]
8661 local Cast = Castables[Value]
8662
8663 if Cast then
8664 return Cast
8665 else
8666 return false, "[" .. Debug.Inspect(Value) .. "] is not a valid " .. tostring(self)
8667 end
8668end
8669
8670local function ConstructUserdata(__index, __newindex, __tostring)
8671 local Enumeration = newproxy(true)
8672
8673 local EnumerationMetatable = getmetatable(Enumeration)
8674 EnumerationMetatable.__index = __index
8675 EnumerationMetatable.__newindex = __newindex
8676 EnumerationMetatable.__tostring = function() return __tostring end
8677 EnumerationMetatable.__metatable = "[Enumeration] Requested metatable is locked"
8678
8679 return Enumeration
8680end
8681
8682local function ConstructEnumerationItem(Name, Value, EnumContainer, LockedEnumContainer, EnumerationStringStub, Castables)
8683 local Item = ConstructUserdata(setmetatable({
8684 Name = Name;
8685 Value = Value;
8686 EnumerationType = LockedEnumContainer
8687 }, Error__index2), ReadOnlyNewIndex, EnumerationStringStub .. Name, Castables)
8688
8689 Castables[Name] = Item
8690 Castables[Value] = Item
8691 Castables[Item] = Item
8692
8693 EnumContainer[Name] = Item
8694end
8695
8696local MakeEnumeration = Typer.AssignSignature(2, Typer.String, Typer.ArrayOfStringsOrDictionaryOfNumbers, function(_, EnumType, EnumTypes)
8697 if rawget(Enumerations, EnumType) then Debug.Error("Enumeration of EnumType " .. EnumType .. " already exists") end
8698
8699 local Castables = {}
8700 local EnumContainer = setmetatable({}, EnumContainerTemplate)
8701 local LockedEnumContainer = ConstructUserdata(EnumContainer, ReadOnlyNewIndex, EnumType)
8702 local EnumerationStringStub = "Enumeration." .. EnumType .. "."
8703 local NumEnumTypes = #EnumTypes
8704
8705 if NumEnumTypes > 0 then
8706 for i = 1, NumEnumTypes do
8707 ConstructEnumerationItem(EnumTypes[i], i - 1, EnumContainer, LockedEnumContainer, EnumerationStringStub, Castables)
8708 end
8709 else
8710 for Name, Value in next, EnumTypes do
8711 ConstructEnumerationItem(Name, Value, EnumContainer, LockedEnumContainer, EnumerationStringStub, Castables)
8712 end
8713 end
8714
8715 Casts[LockedEnumContainer] = Castables
8716 EnumContainerTemplate[LockedEnumContainer] = EnumContainer
8717 EnumerationsArray:Insert(LockedEnumContainer)
8718 Enumerations[EnumType] = LockedEnumContainer
8719end)
8720
8721return ConstructUserdata(Enumerations, MakeEnumeration, "Enumerations")
8722-- Spawns a new thread without waiting one step
8723-- @documentation https://rostrap.github.io/Libraries/Helper/FastSpawn/
8724-- @source https://raw.githubusercontent.com/RoStrap/Helper/master/FastSpawn.lua
8725-- @rostrap FastSpawn
8726-- @author Validark
8727
8728local Instance_new = Instance.new
8729
8730local function FastSpawn(Func, ...)
8731 --- Spawns a new thread to run a function on without waiting one step
8732 -- @param function Func The function to run on a new thread
8733 -- @{...} parameters to pass to Func
8734
8735
8736 local Bindable = Instance_new("BindableEvent")
8737
8738 if ... ~= nil then
8739 local t = {...}
8740 Bindable.Event:Connect(function()
8741 Func(unpack(t))
8742 end)
8743 else
8744 Bindable.Event:Connect(Func)
8745 end
8746
8747 Bindable:Fire()
8748 Bindable:Destroy()
8749end
8750
8751return FastSpawn
8752-- Light-weight, flexible object for cleaning up connections, instances, etc.
8753-- @documentation https://rostrap.github.io/Libraries/Events/Janitor/
8754-- @source https://raw.githubusercontent.com/RoStrap/Events/master/Janitor.lua
8755-- @rostrap Janitor
8756-- @author Validark
8757
8758
8759local Resources={
8760LoadLibrary=function(self,name)
8761local lib = shared[name:lower()]
8762if(lib and lib:IsA'ModuleScript')then
8763return require(lib)
8764else
8765warn'lol that no exist'
8766return {}
8767end
8768end
8769}
8770
8771local Table = Resources:LoadLibrary("Table")
8772local FastSpawn = Resources:LoadLibrary("FastSpawn")
8773
8774-- Just a reference that can't ever be accessed but will be used as an index for LinkToInstance
8775local LinkToInstanceIndex = newproxy(false)
8776
8777local Janitors = setmetatable({}, {__mode = "k"})
8778local Janitor = {}
8779Janitor.__index = {CurrentlyCleaning = true}
8780
8781local TypeDefaults = {
8782 ["function"] = true;
8783 ["RBXScriptConnection"] = "Disconnect";
8784}
8785
8786function Janitor.new()
8787 return setmetatable({CurrentlyCleaning = false}, Janitor)
8788end
8789
8790function Janitor.__index:Add(Object, MethodName, Index)
8791 if Index then
8792 self:Remove(Index)
8793
8794 local this = Janitors[self]
8795
8796 if not this then
8797 this = {}
8798 Janitors[self] = this
8799 end
8800
8801 this[Index] = Object
8802 end
8803
8804 self[Object] = MethodName or TypeDefaults[typeof(Object)] or "Destroy"
8805 return Object
8806end
8807
8808function Janitor.__index:Remove(Index)
8809 local this = Janitors[self]
8810
8811 if this then
8812 local Object = this[Index]
8813
8814 if Object then
8815 local MethodName = self[Object]
8816
8817 if MethodName then
8818 if MethodName == true then
8819 Object()
8820 else
8821 Object[MethodName](Object)
8822 end
8823 self[Object] = nil
8824 end
8825
8826 this[Index] = nil
8827 end
8828 end
8829end
8830
8831function Janitor.__index:Cleanup()
8832 if not self.CurrentlyCleaning then
8833 self.CurrentlyCleaning = nil -- A little trick to exclude the Debouncer from the loop below AND set it to true via __index :)
8834
8835 for Object, MethodName in next, self do
8836 if MethodName == true then
8837 Object()
8838 else
8839 Object[MethodName](Object)
8840 end
8841 self[Object] = nil
8842 end
8843
8844 local this = Janitors[self]
8845
8846 if this then
8847 for Index in next, this do
8848 this[Index] = nil
8849 end
8850 Janitors[self] = nil
8851 end
8852
8853 self.CurrentlyCleaning = false
8854 end
8855end
8856
8857function Janitor.__index:Destroy()
8858 self:Cleanup()
8859 setmetatable(self, nil)
8860end
8861
8862Janitor.__call = Janitor.__index.Cleanup
8863
8864--- Makes the Janitor clean up when the instance is destroyed
8865-- @param Instance Instance The Instance the Janitor will wait for to be Destroyed
8866-- @returns Disconnectable table to stop Janitor from being cleaned up upon Instance Destroy (automatically cleaned up by Janitor, btw)
8867-- @author Corecii
8868
8869local Disconnect = {Connected = true}
8870Disconnect.__index = Disconnect
8871function Disconnect:Disconnect()
8872 self.Connected = false
8873 self.Connection:Disconnect()
8874end
8875
8876function Janitor.__index:LinkToInstance(Object, AllowMultiple)
8877 local Reference = Instance.new("ObjectValue")
8878 Reference.Value = Object
8879 -- ObjectValues have weak-like Instance references
8880 -- If the Instance can no longer be accessed then it can be collected despite
8881 -- the ObjectValue having a reference to it
8882 local ManualDisconnect = setmetatable({}, Disconnect)
8883 local Connection
8884 local function ChangedFunction(Obj, Par)
8885 if not Reference.Value then
8886 ManualDisconnect.Connected = false
8887 return self:Cleanup()
8888 elseif Obj == Reference.Value and not Par then
8889 Obj = nil
8890 wait() -- Push further execution of this script to the end of the current execution cycle
8891 -- This is needed because when the event first runs it's always still Connected
8892 -- The object may have been reparented or the event manually disconnected or disconnected and ran in that time...
8893 if (not Reference.Value or not Reference.Value.Parent) and ManualDisconnect.Connected then
8894 if not Connection.Connected then
8895 ManualDisconnect.Connected = false
8896 return self:Cleanup()
8897 else
8898 -- Since this event won't fire if the instance is destroyed while in nil, we have to check
8899 -- often to make sure it's not destroyed. Once it's parented outside of nil we can stop doing
8900 -- this. We also must check to make sure it wasn't manually disconnected or disconnected and ran.
8901 while wait(0.2) do
8902 if not ManualDisconnect.Connected then
8903 -- Don't run func, we were disconnected manually
8904 return
8905 elseif not Connection.Connected then
8906 -- Otherwise, if we're disconnected it's because instance was destroyed
8907 ManualDisconnect.Connected = false
8908 return self:Cleanup()
8909 elseif Reference.Value.Parent then
8910 -- If it's still Connected then it's not destroyed. If it has a parent then
8911 -- we can quit checking if it's destroyed like this.
8912 return
8913 end
8914 end
8915 end
8916 end
8917 end
8918 end
8919 Connection = Object.AncestryChanged:Connect(ChangedFunction)
8920 ManualDisconnect.Connection = Connection
8921 Object = nil
8922 -- If the object is currently in nil then we need to start our destroy checking loop
8923 -- We need to spawn a new Roblox Lua thread right now before any other code runs.
8924 -- spawn() starts it on the next cycle or frame, coroutines don't have ROBLOX's coroutine.yield handler
8925 -- The only option left is BindableEvents, which run as soon as they are called and use ROBLOX's yield
8926 FastSpawn(ChangedFunction, Reference.Value, Reference.Value.Parent)
8927
8928 if AllowMultiple then -- Give Task to Janitor, cleanup this Connection upon cleanup
8929 self:Add(ManualDisconnect, "Disconnect")
8930 else
8931 self:Add(ManualDisconnect, "Disconnect", LinkToInstanceIndex)
8932 end
8933
8934 return ManualDisconnect
8935end
8936
8937return Table.Lock(Janitor)
8938-- Lerp functions for most data types, featuring CIELUV Color Lerping
8939-- @documentation https://rostrap.github.io/Libraries/Interpolation/Lerps/
8940-- @source https://raw.githubusercontent.com/RoStrap/Interpolation/master/Lerps.lua
8941-- @rostrap Lerps
8942-- @author Validark
8943-- @author Fraktality
8944-- @author Sharksie (NumberSequence Lerp)
8945
8946
8947local Resources={
8948LoadLibrary=function(self,name)
8949local lib = shared[name:lower()]
8950if(lib and lib:IsA'ModuleScript')then
8951return require(lib)
8952else
8953warn'lol that no exist'
8954return {}
8955end
8956end
8957}
8958
8959local Table = Resources:LoadLibrary("Table")
8960
8961local function Lerp(Start, Finish, Alpha)
8962 return Start + Alpha * (Finish - Start)
8963end
8964
8965local Color3Lerp do
8966 -- Combines two colors in CIELUV space.
8967 -- Color3 LerpCIELUV(Color3 fromColor, Color3 toColor, float t)
8968 -- @author Fraktality
8969
8970 -- https://www.w3.org/Graphics/Color/srgb
8971
8972 local Black = Color3.fromRGB(0, 0, 0)
8973
8974 function Color3Lerp(c0, c1, t)
8975 local u0, v0, u1, v1
8976
8977 -- Convert from linear RGB to scaled CIELUV (RgbToLuv13)
8978 local r, g, b = c0.r, c0.g, c0.b
8979 -- Apply inverse gamma correction
8980 r = r < 0.0404482362771076 and r/12.92 or 0.87941546140213*(r + 0.055)^2.4
8981 g = g < 0.0404482362771076 and g/12.92 or 0.87941546140213*(g + 0.055)^2.4
8982 b = b < 0.0404482362771076 and b/12.92 or 0.87941546140213*(b + 0.055)^2.4
8983 -- sRGB->XYZ->CIELUV
8984 local y = 0.2125862307855956*r + 0.71517030370341085*g + 0.0722004986433362*b
8985 local z = 3.6590806972265883*r + 11.4426895800574232*g + 4.1149915024264843*b
8986 local l0 = y > 0.008856451679035631 and 116*y^(1/3) - 16 or 903.296296296296*y
8987 if z > 1e-15 then
8988 u0, v0 = l0*(0.9257063972951867*r - 0.8333736323779866*g - 0.09209820666085898*b)/z, l0*(9*y/z - 0.46832)
8989 else
8990 u0, v0 = -0.19783*l0, -0.46832*l0
8991 end
8992
8993 -- Convert from linear RGB to scaled CIELUV (RgbToLuv13)
8994 r, g, b = c1.r, c1.g, c1.b
8995 -- Apply inverse gamma correction
8996 r = r < 0.0404482362771076 and r/12.92 or 0.87941546140213*(r + 0.055)^2.4
8997 g = g < 0.0404482362771076 and g/12.92 or 0.87941546140213*(g + 0.055)^2.4
8998 b = b < 0.0404482362771076 and b/12.92 or 0.87941546140213*(b + 0.055)^2.4
8999 -- sRGB->XYZ->CIELUV
9000 y = 0.2125862307855956*r + 0.71517030370341085*g + 0.0722004986433362*b
9001 z = 3.6590806972265883*r + 11.4426895800574232*g + 4.1149915024264843*b
9002 local l1 = y > 0.008856451679035631 and 116*y^(1/3) - 16 or 903.296296296296*y
9003 if z > 1e-15 then
9004 u1, v1 = l1*(0.9257063972951867*r - 0.8333736323779866*g - 0.09209820666085898*b)/z, l1*(9*y/z - 0.46832)
9005 else
9006 u1, v1 = -0.19783*l1, -0.46832*l1
9007 end
9008
9009 -- The inputs aren't needed anymore, so don't drag out their lifetimes
9010 -- c0, c1 = nil, nil
9011
9012 -- return function(t)
9013 -- Interpolate
9014 local l = (1 - t)*l0 + t*l1
9015 if l < 0.0197955 then
9016 return Black
9017 end
9018 local u = ((1 - t)*u0 + t*u1)/l + 0.19783
9019 local v = ((1 - t)*v0 + t*v1)/l + 0.46832
9020
9021 -- CIELUV->XYZ
9022 y = (l + 16)/116
9023 y = y > 0.206896551724137931 and y*y*y or 0.12841854934601665*y - 0.01771290335807126
9024 local x = y*u/v
9025 z = y*((3 - 0.75*u)/v - 5)
9026
9027 -- XYZ->linear sRGB
9028 r = 7.2914074*x - 1.5372080*y - 0.4986286*z
9029 g = -2.1800940*x + 1.8757561*y + 0.0415175*z
9030 b = 0.1253477*x - 0.2040211*y + 1.0569959*z
9031
9032 -- Adjust for the lowest out-of-bounds component
9033 if r < 0 and r < g and r < b then
9034 r, g, b = 0, g - r, b - r
9035 elseif g < 0 and g < b then
9036 r, g, b = r - g, 0, b - g
9037 elseif b < 0 then
9038 r, g, b = r - b, g - b, 0
9039 end
9040
9041 -- Apply gamma correction
9042 r = r < 3.1306684425e-3 and 12.92*r or 1.055*r^(1/2.4) - 0.055
9043 g = g < 3.1306684425e-3 and 12.92*g or 1.055*g^(1/2.4) - 0.055
9044 b = b < 3.1306684425e-3 and 12.92*b or 1.055*b^(1/2.4) - 0.055
9045
9046 return Color3.new(
9047 -- Clamp the result
9048 r > 1 and 1 or r < 0 and 0 or r,
9049 g > 1 and 1 or g < 0 and 0 or g,
9050 b > 1 and 1 or b < 0 and 0 or b
9051 )
9052 -- end
9053 end
9054end
9055
9056local function sortByTime(a, b)
9057 return a.Time < b.Time
9058end
9059
9060return Table.Lock {
9061 number = Lerp;
9062 Color3 = Color3Lerp;
9063 UDim2 = UDim2.new().Lerp;
9064 CFrame = CFrame.new().Lerp;
9065 Vector2 = Vector2.new().Lerp;
9066 Vector3 = Vector3.new().Lerp;
9067
9068 string = function(start, finish, alpha)
9069 -- Very simple, doesn't yet take into account previous string
9070 local count = #finish
9071 local a = 1 + count*alpha
9072 return finish:sub(1, a < count and a or count)
9073 end;
9074
9075 UDim = function(start, finish, alpha)
9076 return UDim.new(Lerp(start.Scale, finish.Scale, alpha), Lerp(start.Offset, finish.Offset, alpha))
9077 end;
9078
9079 Rect = function(start, finish, alpha)
9080 return Rect.new(
9081 Lerp(start.Min.X, finish.Min.X, alpha), Lerp(start.Min.Y, finish.Min.Y, alpha),
9082 Lerp(start.Max.X, finish.Max.X, alpha), Lerp(start.Max.Y, finish.Max.Y, alpha)
9083 )
9084 end;
9085
9086 PhysicalProperties = function(start, finish, alpha)
9087 return PhysicalProperties.new(
9088 Lerp(start.Density, finish.Density, alpha),
9089 Lerp(start.Friction, finish.Friction, alpha),
9090 Lerp(start.Elasticity, finish.Elasticity, alpha),
9091 Lerp(start.FrictionWeight, finish.FrictionWeight, alpha),
9092 Lerp(start.ElasticityWeight, finish.ElasticityWeight, alpha)
9093 )
9094 end;
9095
9096 NumberRange = function(start, finish, alpha)
9097 return NumberRange.new(Lerp(start.Min, finish.Min, alpha), Lerp(start.Max, finish.Max, alpha))
9098 end;
9099
9100 ColorSequence = function(start, finish, alpha)
9101 return ColorSequence.new(Color3Lerp(start[1], finish[1], alpha), Color3Lerp(start[2], finish[2], alpha))
9102 end;
9103
9104 Region3 = function(start, finish, alpha) -- @author Sharksie
9105 local imin = Lerp(start.CFrame * (-start.Size*0.5), finish.CFrame * (-finish.Size*0.5), alpha)
9106 local imax = Lerp(start.CFrame * ( start.Size*0.5), finish.CFrame * ( finish.Size*0.5), alpha)
9107
9108 local iminx = imin.x
9109 local imaxx = imax.x
9110 local iminy = imin.y
9111 local imaxy = imax.y
9112 local iminz = imin.z
9113 local imaxz = imax.z
9114
9115 return Region3.new(
9116 Vector3.new(iminx < imaxx and iminx or imaxx, iminy < imaxy and iminy or imaxy, iminz < imaxz and iminz or imaxz),
9117 Vector3.new(iminx > imaxx and iminx or imaxx, iminy > imaxy and iminy or imaxy, iminz > imaxz and iminz or imaxz)
9118 )
9119 end;
9120
9121 NumberSequence = function(start, finish, alpha)
9122 -- @author Sharksie
9123
9124 -- For each point on each line, find the values of the other sequence at that point in time through interpolation
9125 -- then interpolate between the known value and the learned value
9126 -- then use that value to create a new keypoint at the time
9127 -- then build a new sequence using all the keypoints generated
9128
9129 local keypoints = {}
9130 local addedTimes = {}
9131
9132 for i, ap in next, start.Keypoints do
9133 local closestAbove, closestBelow
9134
9135 for i, bp in next, finish.Keypoints do
9136 if bp.Time == ap.Time then
9137 closestAbove, closestBelow = bp, bp
9138 break
9139 elseif bp.Time < ap.Time and (closestBelow == nil or bp.Time > closestBelow.Time) then
9140 closestBelow = bp
9141 elseif bp.Time > ap.Time and (closestAbove == nil or bp.Time < closestAbove.Time) then
9142 closestAbove = bp
9143 end
9144 end
9145
9146 local bValue, bEnvelope
9147 if closestAbove == closestBelow then
9148 bValue, bEnvelope = closestAbove.Value, closestAbove.Envelope
9149 else
9150 local p = (ap.Time - closestBelow.Time)/(closestAbove.Time - closestBelow.Time)
9151 bValue = (closestAbove.Value - closestBelow.Value)*p + closestBelow.Value
9152 bEnvelope = (closestAbove.Envelope - closestBelow.Envelope)*p + closestBelow.Envelope
9153 end
9154 local interValue = (bValue - ap.Value)*alpha + ap.Value
9155 local interEnvelope = (bEnvelope - ap.Envelope)*alpha + ap.Envelope
9156 local interp = NumberSequenceKeypoint.new(ap.Time, interValue, interEnvelope)
9157
9158 table.insert(keypoints, interp)
9159
9160 addedTimes[ap.Time] = true
9161 end
9162
9163 for i, bp in next, finish.Keypoints do
9164 if not addedTimes[bp.Time] then
9165 local closestAbove, closestBelow
9166
9167 for i, ap in next, start.Keypoints do
9168 if ap.Time == bp.Time then
9169 closestAbove, closestBelow = ap, ap
9170 break
9171 elseif ap.Time < bp.Time and (closestBelow == nil or ap.Time > closestBelow.Time) then
9172 closestBelow = ap
9173 elseif ap.Time > bp.Time and (closestAbove == nil or ap.Time < closestAbove.Time) then
9174 closestAbove = ap
9175 end
9176 end
9177
9178 local aValue, aEnvelope
9179 if closestAbove == closestBelow then
9180 aValue, aEnvelope = closestAbove.Value, closestAbove.Envelope
9181 else
9182 local p = (bp.Time - closestBelow.Time)/(closestAbove.Time - closestBelow.Time)
9183 aValue = (closestAbove.Value - closestBelow.Value)*p + closestBelow.Value
9184 aEnvelope = (closestAbove.Envelope - closestBelow.Envelope)*p + closestBelow.Envelope
9185 end
9186 local interValue = (bp.Value - aValue)*alpha + aValue
9187 local interEnvelope = (bp.Envelope - aEnvelope)*alpha + aEnvelope
9188 local interp = NumberSequenceKeypoint.new(bp.Time, interValue, interEnvelope)
9189
9190 table.insert(keypoints, interp)
9191 end
9192 end
9193
9194 table.sort(keypoints, sortByTime)
9195
9196 return NumberSequence.new(keypoints)
9197 end;
9198}
9199-- Rigidly defined PseudoInstance class system to instantiate Roblox-like instances
9200-- @source https://raw.githubusercontent.com/RoStrap/Classes/master/PseudoInstance.lua
9201-- @rostrap PseudoInstance
9202-- @documentation https://rostrap.github.io/Libraries/Classes/PseudoInstance/
9203-- @author Validark
9204
9205local ReplicatedStorage = game:GetService("ReplicatedStorage")
9206local Resources={
9207GetLocalTable=function(self,name)
9208 return {}
9209end;
9210LoadLibrary=function(self,name)
9211local lib = shared[name:lower()]
9212if(lib and lib:IsA'ModuleScript')then
9213return require(lib)
9214else
9215warn'lol that no exist'
9216return {}
9217end;
9218end
9219}
9220
9221local Debug = Resources:LoadLibrary("Debug")
9222local Table = Resources:LoadLibrary("Table")
9223local Typer = Resources:LoadLibrary("Typer")
9224local Signal = Resources:LoadLibrary("Signal")
9225local Janitor = Resources:LoadLibrary("Janitor")
9226local SortedArray = Resources:LoadLibrary("SortedArray")
9227local Enumeration = Resources:LoadLibrary("Enumeration")
9228
9229local Templates = Resources:GetLocalTable("Templates")
9230local Metatables = setmetatable({}, {__mode = "kv"})
9231
9232local function Empty() end
9233
9234local function Metatable__index(this, i)
9235 local self = Metatables[this] or this -- self is the internal copy
9236 local Value = self.__rawdata[i]
9237 local ClassTemplate = self.__class
9238
9239 if Value == nil then
9240 Value = ClassTemplate.Methods[i]
9241 else
9242 return Value
9243 end
9244
9245 if Value == nil and not ClassTemplate.Properties[i] then
9246 local GetConstructorAndDestructor = ClassTemplate.Events[i]
9247
9248 if GetConstructorAndDestructor then
9249 if self == this then -- if internal access
9250 local Event = Signal.new(GetConstructorAndDestructor(self))
9251 rawset(self, i, Event)
9252 return Event
9253 else
9254 return self[i].Event
9255 end
9256 elseif ClassTemplate.Internals[i] == nil or self ~= this then
9257 Debug.Error("[%s] is not a valid Property of " .. tostring(self), i)
9258 end
9259 else
9260 return Value
9261 end
9262end
9263
9264local function Metatable__newindex(this, i, v)
9265 local self = Metatables[this] or this
9266 local Type = self.__class.Properties[i]
9267
9268 if Type then
9269 Type(self, v)
9270 elseif self == this and self.__class.Internals[i] ~= nil then
9271 rawset(self, i, v)
9272 else
9273 Debug.Error(i .. " is not a modifiable property")
9274 end
9275end
9276
9277local function Metatable__tostring(self)
9278 return (Metatables[self] or self).__class.ClassName
9279end
9280
9281local function Metatable__rawset(self, Property, Value)
9282 self.__rawdata[Property] = Value
9283 return self
9284end
9285
9286local function ReturnHelper(Success, ...)
9287 if Success then
9288 return ...
9289 else
9290 Debug.Error(...)
9291 end
9292end
9293
9294local ThreadDepthTracker = setmetatable({}, {__mode = "k"})
9295
9296local function Metatable__super(self, MethodName, ...)
9297 local Thread = coroutine.running()
9298 local InSuperclass = ThreadDepthTracker[Thread]
9299 local PreviousClass = InSuperclass or self.__class
9300 local Class = PreviousClass
9301
9302 while Class.HasSuperclass do
9303 Class = Class.Superclass
9304 local Function = Class.Methods[MethodName]
9305
9306 if Function and Function ~= PreviousClass.Methods[MethodName] then
9307 if InSuperclass then
9308 ThreadDepthTracker[Thread] = Class
9309 return Function(self, ...)
9310 else
9311 local NewThread = coroutine.create(Function)
9312 ThreadDepthTracker[NewThread] = Class
9313
9314 return ReturnHelper(coroutine.resume(NewThread, self, ...))
9315 end
9316 end
9317 end
9318
9319 return Debug.Error("Could not find parent method " .. MethodName .. " of " .. PreviousClass.ClassName)
9320end
9321
9322local PseudoInstance = {}
9323
9324local function DefaultInit(self, ...)
9325 self:superinit(...)
9326end
9327
9328local DataTableNames = SortedArray.new{"Events", "Methods", "Properties", "Internals"}
9329local MethodIndex = DataTableNames:Find("Methods")
9330
9331local function Filter(this, self, ...)
9332 -- Filter out `this` and convert to `self`
9333 -- Try not to construct a table if possible (we keep it light up in here)
9334
9335 local ArgumentCount = select("#", ...)
9336
9337 if ArgumentCount > 2 then
9338 local Arguments
9339
9340 for i = 1, ArgumentCount do
9341 if select(i, ...) == this then
9342 Arguments = {...} -- Create a table if absolutely necessary
9343 Arguments[i] = self
9344
9345 for j = i + 1, ArgumentCount do -- Just loop through the rest normally if a table was already created
9346 if Arguments[j] == this then
9347 Arguments[j] = self
9348 end
9349 end
9350
9351 return unpack(Arguments)
9352 end
9353 end
9354
9355 return ...
9356 else
9357 if this == ... then -- Optimize for most cases where they only returned a single parameter
9358 return self
9359 else
9360 return ...
9361 end
9362 end
9363end
9364
9365local function superinit(self, ...)
9366 local CurrentClass = self.currentclass
9367
9368 if CurrentClass.HasSuperclass then
9369 self.currentclass = CurrentClass.Superclass
9370 else
9371 self.currentclass = nil
9372 self.superinit = nil
9373 end
9374
9375 CurrentClass.Init(self, ...)
9376end
9377
9378function PseudoInstance.Register(_, ClassName, ClassData, Superclass)
9379 if type(ClassData) ~= "table" then Debug.Error("Register takes parameters (string ClassName, table ClassData, Superclass)") end
9380
9381 for i = 1, #DataTableNames do
9382 local DataTableName = DataTableNames[i]
9383
9384 if not ClassData[DataTableName] then
9385 ClassData[DataTableName] = {}
9386 end
9387 end
9388
9389 for Property, Function in next, ClassData.Properties do
9390 if type(Function) == "table" then
9391 ClassData.Properties[Property] = Typer.AssignSignature(2, Function, function(self, Value)
9392 self:rawset(Property, Value)
9393 end)
9394 end
9395 end
9396
9397 local Internals = ClassData.Internals
9398
9399 for i = 1, #Internals do
9400 Internals[Internals[i]] = false
9401 Internals[i] = nil
9402 end
9403
9404 local Events = ClassData.Events
9405
9406 for i = 1, #Events do
9407 Events[Events[i]] = Empty
9408 Events[i] = nil
9409 end
9410
9411 ClassData.Abstract = false
9412
9413 for MethodName, Method in next, ClassData.Methods do -- Wrap to give internal access to private metatable members
9414 if Method == 0 then
9415 ClassData.Abstract = true
9416 else
9417 ClassData.Methods[MethodName] = function(self, ...)
9418 local this = Metatables[self]
9419
9420 if this then -- External method call
9421 return Filter(this, self, Method(this, ...))
9422 else -- Internal method call
9423 return Method(self, ...)
9424 end
9425 end
9426 end
9427 end
9428
9429 ClassData.Init = ClassData.Init or DefaultInit
9430 ClassData.ClassName = ClassName
9431
9432 -- Make properties of internal objects externally accessible
9433 if ClassData.WrappedProperties then
9434 for ObjectName, Properties in next, ClassData.WrappedProperties do
9435 for i = 1, #Properties do
9436 local Property = Properties[i]
9437
9438 if ClassData.Properties[Property] then
9439 Debug.Error("Identifier \"" .. Property .. "\" was used in both Properties and WrappedProperties")
9440 else
9441 ClassData.Properties[Property] = function(this, Value)
9442 local Object = this[ObjectName]
9443
9444 if Object then
9445 Object[Property] = Value
9446 end
9447
9448 this:rawset(Property, Value)
9449 end
9450 end
9451 end
9452 end
9453
9454 local PreviousInit = ClassData.Init
9455
9456 ClassData.Init = function(self, ...)
9457 PreviousInit(self, ...)
9458
9459 for ObjectName, Properties in next, ClassData.WrappedProperties do
9460 for i = 1, #Properties do
9461 local Property = Properties[i]
9462 local Object = self[ObjectName]
9463
9464 if Object then
9465 if self[Property] == nil then
9466 self[Property] = Object[Property] -- This will implicitly error if they do something stupid
9467 end
9468 else
9469 Debug.Error(ObjectName .. " is not a valid member of " .. ClassName)
9470 end
9471 end
9472 end
9473 end
9474 end
9475
9476 if Superclass == nil then
9477 Superclass = Templates.PseudoInstance
9478 end
9479
9480 if Superclass then -- Copy inherited stuff into ClassData
9481 ClassData.HasSuperclass = true
9482 ClassData.Superclass = Superclass
9483
9484 for a = 1, #DataTableNames do
9485 local DataTable = DataTableNames[a]
9486 local ClassTable = ClassData[DataTable]
9487 for i, v in next, Superclass[DataTable] do
9488 if not ClassTable[i] then
9489 ClassTable[i] = v == 0 and Debug.Error(ClassName .. " failed to implement " .. i .. " from its superclass " .. Superclass.ClassName) or v
9490 end
9491 end
9492 end
9493 else
9494 ClassData.HasSuperclass = false
9495 end
9496
9497 local Identifiers = {} -- Make sure all identifiers are unique
9498
9499 for a = 1, #DataTableNames do -- Make sure there aren't any duplicate names
9500 local DataTableName = DataTableNames[a]
9501 for i in next, ClassData[DataTableName] do
9502 if type(i) == "string" then
9503 if Identifiers[i] then
9504 Debug.Error("Identifier \"" .. i .. "\" was used in both " .. DataTableNames[Identifiers[i]] .. " and " .. DataTableName)
9505 else
9506 Identifiers[i] = a
9507 end
9508 else
9509 Debug.Error("%q is not a valid Identifier, found inside " .. DataTableName, i)
9510 end
9511 end
9512 end
9513
9514 local LockedClass = Table.Lock(ClassData)
9515 Templates[ClassName] = LockedClass
9516 return LockedClass
9517end
9518
9519local function AccessProperty(self, Property)
9520 local _ = self[Property]
9521end
9522
9523PseudoInstance:Register("PseudoInstance", { -- Generates a rigidly defined userdata class with `.new()` instantiator
9524 Internals = {
9525 "Children", "PropertyChangedSignals", "Janitor";
9526
9527 rawset = function(self, Property, Value)
9528 self.__rawdata[Property] = Value
9529 local PropertyChangedSignal = self.PropertyChangedSignals and self.PropertyChangedSignals[Property]
9530
9531 if PropertyChangedSignal and PropertyChangedSignal.Active then
9532 PropertyChangedSignal:Fire(Value)
9533 end
9534
9535 return self
9536 end;
9537
9538 SortByName = function(a, b)
9539 return a.Name < b.Name
9540 end;
9541
9542 ParentalChange = function(self)
9543 local this = Metatables[self.Parent]
9544
9545 if this then
9546 this.Children:Insert(self)
9547 end
9548 end;
9549
9550 ChildNameMatchesObject = function(ChildName, b)
9551 return ChildName == b.Name
9552 end;
9553
9554 ChildNamePrecedesObject = function(ChildName, b)
9555 return ChildName < b.Name
9556 end;
9557
9558 SetEventActive = function(Event)
9559 Event.Active = true
9560 end;
9561
9562 SetEventInactive = function(Event)
9563 Event.Active = false
9564 end;
9565 };
9566
9567 Properties = { -- Only Indeces within this table are writable, and these are the default values
9568 Archivable = Typer.Boolean; -- Values written to these indeces must match the initial type (unless it is a function, see below)
9569 Parent = Typer.OptionalInstance;
9570 Name = Typer.String;
9571 };
9572
9573 Events = {
9574 Changed = function(self)
9575 local Assigned = Janitor.new()
9576
9577 return function(Event)
9578 for Property in next, self.__class.Properties do
9579 Assigned:Add(self:GetPropertyChangedSignal(Property):Connect(function()
9580 Event:Fire(Property)
9581 end), "Disconnect")
9582 end
9583 end, Assigned
9584 end;
9585 };
9586
9587 Methods = {
9588 Clone = function(self)
9589 if self.Archivable then
9590 local CurrentClass = self.__class
9591 local New = Resources:LoadLibrary("PseudoInstance").new(CurrentClass.ClassName)
9592
9593 repeat
9594 for Property in next, CurrentClass.Properties do
9595 if Property ~= "Parent" then
9596 local Old = self[Property]
9597 if Old ~= nil then
9598 if Typer.Instance(Old) then
9599 Old = Old:Clone()
9600 end
9601
9602 New[Property] = Old
9603 end
9604 end
9605 end
9606 CurrentClass = CurrentClass.HasSuperclass and CurrentClass.Superclass
9607 until not CurrentClass
9608
9609 return New
9610 else
9611 return nil
9612 end
9613 end;
9614
9615 GetFullName = function(self)
9616 return (self.Parent and self.Parent:GetFullName() .. "." or "") .. self.Name
9617 end;
9618
9619 IsDescendantOf = function(self, Grandparent)
9620 return self.Parent == Grandparent or (self.Parent and self.Parent:IsDescendantOf(Grandparent)) or false
9621 end;
9622
9623 GetPropertyChangedSignal = function(self, String)
9624 if type(String) ~= "string" then Debug.Error("invalid argument 2: string expected, got %s", String) end
9625 local PropertyChangedSignal = self.PropertyChangedSignals[String]
9626
9627 if not PropertyChangedSignal then
9628 if not pcall(AccessProperty, self, String) then Debug.Error("%s is not a valid Property of " .. tostring(self), String) end
9629 PropertyChangedSignal = Signal.new(self.SetEventActive, self.SetEventInactive)
9630 self.Janitor:Add(PropertyChangedSignal, "Destroy")
9631 self.PropertyChangedSignals[String] = PropertyChangedSignal
9632 end
9633
9634 return PropertyChangedSignal.Event
9635 end;
9636
9637 FindFirstChild = function(self, ChildName, Recursive)
9638 local Children = self.Children
9639
9640 if Recursive then
9641 for i = 1, #Children do
9642 local Child = Children[i]
9643
9644 if Child.Name == ChildName then
9645 return Child
9646 end
9647
9648 local Grandchild = Child:FindFirstChild(ChildName, Recursive)
9649
9650 if Grandchild then
9651 return Grandchild
9652 end
9653 end
9654 else -- Much faster than recursive
9655 return Children:Find(ChildName, self.ChildNameMatchesObject, self.ChildNamePrecedesObject)
9656 end
9657 end;
9658
9659 GetChildren = function(self)
9660 return self.Children:Copy()
9661 end;
9662
9663 IsA = function(self, ClassName)
9664 local CurrentClass = self.__class
9665
9666 repeat
9667 if ClassName == CurrentClass.ClassName then
9668 return true
9669 end
9670 CurrentClass = CurrentClass.HasSuperclass and CurrentClass.Superclass
9671 until not CurrentClass
9672
9673 return ClassName == "<<</sc>>>" -- This is a reference to the old Roblox chat...
9674 end;
9675
9676 Destroy = function(self)
9677 self.Archivable = false
9678 self.Parent = nil
9679
9680 for GlobalSelf, InternalSelf in next, Metatables do
9681 if self == InternalSelf then
9682 self.Janitor[GlobalSelf] = nil
9683 Metatables[GlobalSelf] = nil
9684 end
9685 end
9686
9687 self.Janitor:Cleanup()
9688
9689 -- Nuke the object
9690 if self.__rawdata then
9691 for i in next, self.__rawdata do
9692 rawset(self.__rawdata, i, nil)
9693 end
9694 end
9695
9696 for i, v in next, self do
9697 if Signal.IsA(v) then
9698 v:Destroy()
9699 end
9700
9701 rawset(self, i, nil)
9702 end
9703 end;
9704 };
9705
9706 Init = function(self)
9707 local Name = self.__class.ClassName
9708
9709 -- Default properties
9710 self.Name = Name
9711 self.Archivable = true
9712
9713 -- Read-only
9714 self:rawset("ClassName", Name)
9715
9716 -- Internals
9717 self.Children = SortedArray.new(nil, self.SortByName)
9718 self.PropertyChangedSignals = {}
9719
9720 self:GetPropertyChangedSignal("Parent"):Connect(self.ParentalChange, self)
9721 end;
9722}, false)
9723
9724function PseudoInstance.new(ClassName, ...)
9725 local Class = Templates[ClassName]
9726
9727 if not Class then
9728 Resources:LoadLibrary(ClassName)
9729 Class = Templates[ClassName] or Debug.Error("Invalid ClassName: " .. ClassName)
9730 end
9731
9732 if Class.Abstract then
9733 Debug.Error("Cannot instantiate an abstract " .. ClassName)
9734 end
9735
9736 local self = newproxy(true)
9737 local Mt = getmetatable(self)
9738
9739 -- This one can be overwritten by an internal function if so desired :D
9740 Mt.rawset = Metatable__rawset
9741
9742 for i, v in next, Class.Internals do
9743 Mt[i] = v
9744 end
9745
9746 -- Internal members
9747 Mt.__class = Class
9748 Mt.__index = Metatable__index
9749 Mt.__rawdata = {}
9750 Mt.__newindex = Metatable__newindex
9751 Mt.__tostring = Metatable__tostring
9752 Mt.__metatable = "[PseudoInstance] Locked metatable"
9753 Mt.__type = ClassName -- Calling `typeof` will error without having this value :/
9754
9755 -- Internally accessible methods
9756 Mt.super = Metatable__super
9757
9758 -- These two are only around for instantiation and are cleared after a successful and full instantiation
9759 Mt.superinit = superinit
9760 Mt.currentclass = Class
9761
9762 -- Internally accessible cleaner
9763 Mt.Janitor = Janitor.new()
9764
9765 Metatables[self] = setmetatable(Mt, Mt)
9766
9767 Mt.Janitor:Add(self, "Destroy")
9768 Mt:superinit(...)
9769
9770 if rawget(Mt, "currentclass") then
9771 local StoppedOnClass = Class
9772
9773 while StoppedOnClass.HasSuperclass and StoppedOnClass.Superclass ~= Mt.currentclass do
9774 StoppedOnClass = StoppedOnClass.Superclass
9775 end
9776
9777 Debug.Error("Must call self:superinit(...) from " .. StoppedOnClass.ClassName .. ".Init")
9778 end
9779
9780 return self
9781end
9782
9783function PseudoInstance.Make(ClassName, Properties, ...)
9784 local Object = PseudoInstance.new(ClassName)
9785 local Parent = Properties.Parent
9786
9787 if Parent then
9788 Properties.Parent = nil
9789 end
9790
9791 for Property, Value in next, Properties do
9792 if type(Property) == "number" then
9793 Value.Parent = Object
9794 elseif Object[Property] ~= Value then
9795 Object[Property] = Value
9796 end
9797 end
9798
9799 if Parent then
9800 Object.Parent = Parent
9801 end
9802
9803 if ... then
9804 local Objects = {...}
9805 for a = 1, #Objects do
9806 local Object = Object:Clone()
9807 for Property, Value in next, Objects[a] do
9808 if type(Property) == "number" then
9809 Value.Parent = Object
9810 else
9811 Object[Property] = Value
9812 end
9813 end
9814 Object.Parent = not Object.Parent and Parent
9815 Objects[a] = Object
9816 end
9817 return Object, unpack(Objects)
9818 else
9819 return Object
9820 end
9821end
9822
9823return Table.Lock(PseudoInstance)
9824-- PseudoInstance to spawn Material Design Ripples inside its Parent (with rounded edge support!)
9825-- @documentation https://rostrap.github.io/Libraries/RoStrapUI/Rippler/
9826-- @source https://raw.githubusercontent.com/RoStrap/RoStrapUI/master/Rippler.lua
9827-- @rostrap Rippler
9828-- @author Validark
9829
9830local ContentProvider = game:GetService("ContentProvider")
9831local ReplicatedStorage = game:GetService("ReplicatedStorage")
9832
9833local Resources={
9834LoadLibrary=function(self,name)
9835local lib = shared[name:lower()]
9836if(lib and lib:IsA'ModuleScript')then
9837return require(lib)
9838else
9839warn'lol that no exist'
9840return {}
9841end
9842end
9843}
9844
9845local Debug = Resources:LoadLibrary("Debug")
9846local Tween = Resources:LoadLibrary("Tween")
9847local Color = Resources:LoadLibrary("Color")
9848local Typer = Resources:LoadLibrary("Typer")
9849local Janitor = Resources:LoadLibrary("Janitor")
9850local Enumeration = Resources:LoadLibrary("Enumeration")
9851local PseudoInstance = Resources:LoadLibrary("PseudoInstance")
9852
9853local RIPPLE_START_DIAMETER = 0
9854local RIPPLE_OVERBITE = 1.05
9855
9856local RippleContainer = Instance.new("Frame") -- Make sure ZIndex is higher than parent by 1
9857RippleContainer.AnchorPoint = Vector2.new(0.5, 0.5)
9858RippleContainer.BackgroundTransparency = 1
9859RippleContainer.BorderSizePixel = 0
9860RippleContainer.ClipsDescendants = true
9861RippleContainer.Name = "RippleContainer"
9862RippleContainer.Size = UDim2.new(1, 0, 1, 0)
9863RippleContainer.Position = UDim2.new(0.5, 0, 0.5, 0)
9864
9865local RippleStartSize = UDim2.new(0, RIPPLE_START_DIAMETER, 0, RIPPLE_START_DIAMETER)
9866
9867local Circle = Instance.new("ImageLabel")
9868Circle.AnchorPoint = Vector2.new(0.5, 0.5)
9869Circle.BackgroundTransparency = 1
9870Circle.Size = RippleStartSize
9871Circle.Image = "rbxassetid://517259585"
9872Circle.Name = "Ripple"
9873
9874spawn(function()
9875 ContentProvider:PreloadAsync{Circle.Image}
9876end)
9877
9878local Deceleration = Enumeration.EasingFunction.Deceleration.Value
9879
9880Enumeration.RipplerStyle = {"Full", "Icon", "Round"}
9881
9882local CornerData = {
9883 [2] = {
9884 0.380, 0.918,
9885 0.918, 1.000,
9886 };
9887
9888 [4] = {
9889 0.000, 0.200, 0.690, 0.965,
9890 0.200, 0.965, 1.000, 1.000,
9891 0.690, 1.000, 1.000, 1.000,
9892 0.965, 1.000, 1.000, 1.000,
9893 };
9894
9895 [8] = {
9896 0.000, 0.000, 0.000, 0.000, 0.224, 0.596, 0.851, 0.984,
9897 0.000, 0.000, 0.000, 0.596, 1.000, 1.000, 1.000, 1.000,
9898 0.000, 0.000, 0.722, 1.000, 1.000, 1.000, 1.000, 1.000,
9899 0.000, 0.596, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,
9900 0.224, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,
9901 0.596, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,
9902 0.851, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,
9903 0.984, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,
9904 };
9905}
9906
9907do
9908 local t = {
9909 Radius0 = 0;
9910 }
9911
9912 for BorderRadius, Data in next, CornerData do
9913 t["Radius" .. BorderRadius] = BorderRadius
9914
9915 for i = 1, #Data do
9916 Data[i] = 1 - Data[i] -- Opacity -> Transparency
9917 end
9918 end
9919
9920 Enumeration.BorderRadius = t
9921end
9922
9923local function MakeContainer(GlobalContainer, Size, Position, ImageTransparency)
9924 local Container = Instance.new("ImageLabel")
9925
9926 if ImageTransparency ~= nil and ImageTransparency ~= 0 then
9927 Container.ImageTransparency = ImageTransparency
9928 end
9929
9930 Container.BackgroundTransparency = 1
9931 Container.ClipsDescendants = true
9932 Container.Position = Position
9933 Container.Size = Size
9934 Container.Parent = GlobalContainer
9935 return Container
9936end
9937
9938local function MakeOuterBorders(RippleFrames, Container, X, Y) -- TODO: Optimize first two frames which can be eliminated
9939 local NumRippleFrames = #RippleFrames
9940 RippleFrames[NumRippleFrames + 1] = MakeContainer(Container, UDim2.new(1, -2*X, 0, 1), UDim2.new(0, X, 0, Y))
9941 RippleFrames[NumRippleFrames + 2] = MakeContainer(Container, UDim2.new(1, -2*X, 0, 1), UDim2.new(0, X, 1, -Y - 1))
9942 RippleFrames[NumRippleFrames + 3] = MakeContainer(Container, UDim2.new(0, 1, 1, -2*X), UDim2.new(0, Y, 0, X))
9943 RippleFrames[NumRippleFrames + 4] = MakeContainer(Container, UDim2.new(0, 1, 1, -2*X), UDim2.new(1, -Y - 1, 0, X))
9944end
9945
9946local PixelSize = UDim2.new(0, 1, 0, 1)
9947
9948local function DestroyRoundRipple(self)
9949 for i = 1, #self do
9950 local Object = self[i]
9951 self[i] = nil
9952 Object:Destroy()
9953 end
9954end;
9955
9956local RoundRippleMetatable = {
9957 __index = function(self, i)
9958 if i == "Size" then
9959 return RippleStartSize
9960 elseif i == "ImageTransparency" then
9961 return self.Transparency
9962 elseif i == "Destroy" then
9963 return DestroyRoundRipple
9964 end
9965 end;
9966
9967 __newindex = function(self, i, v)
9968 if i == "Size" then
9969 for a = 1, #self do
9970 self[a].Size = v
9971 end
9972 elseif i == "ImageTransparency" then
9973 for a = 1, #self do
9974 local RippleFrame = self[a]
9975 local Parent = RippleFrame.Parent
9976 if Parent then
9977 RippleFrame.ImageTransparency = (1 - v) * Parent.ImageTransparency + v
9978 end
9979 end
9980 end
9981 end;
9982}
9983
9984return PseudoInstance:Register("Rippler", {
9985 Internals = {
9986 "CurrentRipple", "RippleFrames";
9987
9988 SetCurrentRipple = function(self, Ripple)
9989 if self.CurrentRipple then
9990 Tween(self.CurrentRipple, "ImageTransparency", 1, Deceleration, self.RippleFadeDuration, false, true)
9991 end
9992
9993 self.CurrentRipple = Ripple
9994 end
9995 };
9996
9997 Events = {};
9998
9999 Properties = {
10000 Style = Typer.AssignSignature(2, Typer.EnumerationOfTypeRipplerStyle, function(self, Style)
10001 self:rawset("Style", Style)
10002 end);
10003
10004 BorderRadius = Typer.AssignSignature(2, Typer.EnumerationOfTypeBorderRadius, function(self, Value)
10005 self:rawset("BorderRadius", Value)
10006
10007 local BorderRadius = Value.Value
10008 local RippleFrames = self.RippleFrames
10009
10010 if RippleFrames then
10011 DestroyRoundRipple(RippleFrames)
10012 end
10013
10014 if BorderRadius == 0 then
10015 self.Style = Enumeration.RipplerStyle.Full
10016 else
10017 self.Style = Enumeration.RipplerStyle.Round
10018 local Data = CornerData[BorderRadius]
10019
10020 if not RippleFrames then
10021 RippleFrames = {}
10022 self.RippleFrames = RippleFrames
10023 end
10024
10025 local MiddleSquarePoint
10026 local Container = self.Container
10027
10028 for j = 0, BorderRadius - 1 do
10029 if Data[BorderRadius * j + (j + 1)] == 0 then
10030 MiddleSquarePoint = j
10031 break
10032 end
10033 end
10034
10035 MakeOuterBorders(RippleFrames, Container, BorderRadius, 0)
10036
10037 -- Make large center frame
10038 RippleFrames[#RippleFrames + 1] = MakeContainer(Container, UDim2.new(1, -2 * MiddleSquarePoint, 1, -2 * MiddleSquarePoint), UDim2.new(0, MiddleSquarePoint, 0, MiddleSquarePoint))
10039
10040 do -- Make other bars to fill
10041 local X = MiddleSquarePoint
10042 local Y = MiddleSquarePoint - 1
10043
10044 while Data[BorderRadius * Y + (X + 1)] == 0 do
10045 MakeOuterBorders(RippleFrames, Container, X, Y)
10046 X = X + 1
10047 Y = Y - 1
10048 end
10049 end
10050
10051 do
10052 local a = 0
10053 local amax = BorderRadius * BorderRadius
10054 local NumRippleFrames = #RippleFrames
10055 while a < amax do
10056 local PixelTransparency = Data[a + 1]
10057
10058 if PixelTransparency ~= 1 then
10059 if PixelTransparency ~= 0 then
10060 local X = a % BorderRadius
10061 local Y = (a - X) / BorderRadius
10062 local V = -1 - X
10063 local W = -1 - Y
10064
10065 RippleFrames[NumRippleFrames + 1] = MakeContainer(Container, PixelSize, UDim2.new(0, X, 0, Y), PixelTransparency)
10066 RippleFrames[NumRippleFrames + 2] = MakeContainer(Container, PixelSize, UDim2.new(0, X, 1, W), PixelTransparency)
10067 RippleFrames[NumRippleFrames + 3] = MakeContainer(Container, PixelSize, UDim2.new(1, V, 0, Y), PixelTransparency)
10068 RippleFrames[NumRippleFrames + 4] = MakeContainer(Container, PixelSize, UDim2.new(1, V, 1, W), PixelTransparency)
10069 NumRippleFrames = NumRippleFrames + 4
10070 end
10071 end
10072
10073 a = a + 1
10074 end
10075 end
10076 end
10077 end);
10078
10079 RippleFadeDuration = Typer.Number;
10080 MaxRippleDiameter = Typer.Number;
10081 RippleExpandDuration = Typer.Number;
10082
10083 RippleColor3 = Typer.AssignSignature(2, Typer.Color3, function(self, RippleColor3)
10084 if self.CurrentRipple then
10085 self.CurrentRipple.ImageColor3 = RippleColor3
10086 end
10087
10088 self:rawset("RippleColor3", RippleColor3)
10089 end);
10090
10091 RippleTransparency = Typer.AssignSignature(2, Typer.Number, function(self, RippleTransparency)
10092 if self.CurrentRipple then
10093 self.CurrentRipple.ImageTransparency = RippleTransparency
10094 end
10095
10096 self:rawset("RippleTransparency", RippleTransparency)
10097 end);
10098
10099 Container = Typer.AssignSignature(2, Typer.InstanceWhichIsAGuiObject, function(self, Container)
10100 if self.BorderRadius.Value ~= 0 then Debug.Error("Can only set container when BorderRadius is 0") end
10101
10102 self.Janitor:LinkToInstance(Container)
10103 self.Janitor:Add(Container, "Destroy", "Container")
10104
10105 self:rawset("Container", Container)
10106 end);
10107
10108 Parent = function(self, Parent) -- Manually check this one
10109 if Parent == nil then
10110 self.Janitor:Remove("ZIndexChanged")
10111 self.Container.Parent = nil
10112 else
10113 local ParentType = typeof(Parent)
10114 local IsGuiObject = ParentType == "Instance" and Parent:IsA("GuiObject") or ParentType == "userdata" and Parent.ClassName == "RoundedFrame"
10115
10116 if IsGuiObject and self.Container ~= Parent then
10117 local function ZIndexChanged()
10118 self.Container.ZIndex = Parent.ZIndex + 1
10119 end
10120
10121 self.Janitor:Add(Parent:GetPropertyChangedSignal("ZIndex"):Connect(ZIndexChanged), "Disconnect", "ZIndexChanged")
10122 ZIndexChanged()
10123 self.Container.Parent = Parent
10124 else
10125 Debug.Error("bad argument #2 to Parent, expected GuiObject, got %s", Parent)
10126 end
10127 end
10128
10129 self:rawset("Parent", Parent)
10130 end;
10131 };
10132
10133 Methods = {
10134 Down = Typer.AssignSignature(2, Typer.OptionalNumber, Typer.OptionalNumber, function(self, X, Y)
10135 local Container = self.Container
10136 local Diameter
10137
10138 local ContainerAbsoluteSizeX = Container.AbsoluteSize.X
10139 local ContainerAbsoluteSizeY = Container.AbsoluteSize.Y
10140
10141 -- Get near corners
10142 X = (X or (0.5 * ContainerAbsoluteSizeX + Container.AbsolutePosition.X)) - Container.AbsolutePosition.X
10143 Y = (Y or (0.5 * ContainerAbsoluteSizeY + Container.AbsolutePosition.Y)) - Container.AbsolutePosition.Y
10144
10145 if self.Style == Enumeration.RipplerStyle.Icon then
10146 Diameter = 2 * Container.AbsoluteSize.Y
10147 self.Container.ClipsDescendants = false
10148 else
10149 -- Get far corners
10150 local V = X - ContainerAbsoluteSizeX
10151 local W = Y - ContainerAbsoluteSizeY
10152
10153 -- Calculate distance between mouse and corners
10154 local a = (X*X + Y*Y) ^ 0.5
10155 local b = (X*X + W*W) ^ 0.5
10156 local c = (V*V + Y*Y) ^ 0.5
10157 local d = (V*V + W*W) ^ 0.5
10158
10159 -- Find longest distance between mouse and a corner and decide Diameter
10160 Diameter = 2 * (a > b and a > c and a > d and a or b > c and b > d and b or c > d and c or d) * RIPPLE_OVERBITE
10161
10162 -- Cap Diameter
10163 if self.MaxRippleDiameter < Diameter then
10164 Diameter = self.MaxRippleDiameter
10165 end
10166 end
10167
10168 -- Create Ripple Object
10169 local Ripple = Circle:Clone()
10170 Ripple.ImageColor3 = self.RippleColor3
10171 Ripple.ImageTransparency = self.RippleTransparency
10172 Ripple.Position = UDim2.new(0, X, 0, Y)
10173 Ripple.ZIndex = Container.ZIndex + 1
10174 Ripple.Parent = Container
10175
10176 if self.Style == Enumeration.RipplerStyle.Round and self.BorderRadius.Value ~= 0 then
10177 local Ripples = {Transparency = Ripple.ImageTransparency}
10178 local RippleFrames = self.RippleFrames
10179 local NumRipples = #RippleFrames
10180
10181 for i = 1, NumRipples do
10182 local RippleFrame = RippleFrames[i]
10183 local NewRipple = Ripple:Clone()
10184 local AbsolutePosition = Ripple.AbsolutePosition - RippleFrame.AbsolutePosition + 0.5*Ripple.AbsoluteSize
10185 NewRipple.Position = UDim2.new(0, AbsolutePosition.X, 0, AbsolutePosition.Y)
10186 NewRipple.ImageTransparency = (1 - self.RippleTransparency) * RippleFrame.ImageTransparency + self.RippleTransparency
10187 NewRipple.Parent = RippleFrame
10188
10189 Ripples[i] = NewRipple
10190 end
10191 Ripple:Destroy()
10192 Ripple = setmetatable(Ripples, RoundRippleMetatable)
10193 end
10194
10195 self:SetCurrentRipple(Ripple)
10196
10197 return Tween(Ripple, "Size", UDim2.new(0, Diameter, 0, Diameter), Deceleration, self.RippleExpandDuration)
10198 end);
10199
10200 Up = function(self)
10201 self:SetCurrentRipple(false)
10202 end;
10203
10204 Ripple = Typer.AssignSignature(2, Typer.OptionalNumber, Typer.OptionalNumber, Typer.OptionalNumber, function(self, X, Y, Duration)
10205 self:Down(X, Y)
10206
10207 delay(Duration or 0.15, function()
10208 self:SetCurrentRipple(false)
10209 end)
10210 end);
10211 };
10212
10213 Init = function(self, Container)
10214 self.Style = Enumeration.RipplerStyle.Full
10215 self.BorderRadius = 0
10216 self.Container = Container or RippleContainer:Clone()
10217 self.RippleTransparency = 0.84
10218 self.RippleColor3 = Color.White
10219 self.MaxRippleDiameter = math.huge
10220 self.RippleExpandDuration = 0.5
10221 self.RippleFadeDuration = 1
10222 self:superinit()
10223 end;
10224})
10225-- Connection-based PseudoEvents (BindableEvent wrapper)
10226-- @documentation https://rostrap.github.io/Libraries/Events/Signal/
10227-- @source https://raw.githubusercontent.com/RoStrap/Events/master/Signal.lua
10228-- @rostrap Signal
10229-- @author Validark
10230-- @original https://gist.github.com/Anaminus/afd813efc819bad8e560caea28942010
10231
10232
10233local Resources={
10234LoadLibrary=function(self,name)
10235local lib = shared[name:lower()]
10236if(lib and lib:IsA'ModuleScript')then
10237return require(lib)
10238else
10239warn'lol that no exist'
10240return {}
10241end
10242end
10243}
10244
10245local Table = Resources:LoadLibrary("Table")
10246local Debug = Resources:LoadLibrary("Debug")
10247
10248-- These hold references to metatables for after we lock __metatable to a string
10249local Signals = setmetatable({}, {__mode = "k"})
10250local EventInterfaces = setmetatable({}, {__mode = "kv"})
10251local PseudoConnections = setmetatable({}, {__mode = "kv"})
10252
10253local function BadIndex(_, i, t)
10254 Debug.Error("%q is not a valid member of " .. (t or "RBXScriptSignal"), i)
10255end
10256
10257local Event = setmetatable({}, {__index = BadIndex})
10258
10259function Event:Connect(Function, Arg)
10260 return EventInterfaces[self]:Connect(Function, Arg)
10261end
10262
10263function Event:Wait()
10264 return EventInterfaces[self]:Wait()
10265end
10266
10267local Signal = {
10268 __index = {
10269 NextId = 0; -- Holds the next Arguments ID
10270 YieldingThreads = 0; -- Number of Threads waiting on the signal
10271 }
10272}
10273
10274local function GetArguments(self, Id)
10275 local Arguments = self.Arguments[Id]
10276 local ThreadsRemaining = Arguments.NumConnectionsAndThreads - 1
10277
10278 if ThreadsRemaining == 0 then
10279 self.Arguments[Id] = nil
10280 else
10281 Arguments.NumConnectionsAndThreads = ThreadsRemaining
10282 end
10283
10284 return unpack(Arguments, 1, Arguments.n)
10285end
10286
10287local function Destruct(self)
10288 local ConstructorData = self.ConstructorData
10289 if self.Destructor and ConstructorData then
10290 self:Destructor(unpack(ConstructorData, 1, ConstructorData.n))
10291 self.ConstructorData = nil
10292 end
10293end
10294
10295local function pack(...) -- This is useful because trailing nil's on the stack may be preserved
10296 return {n = select("#", ...), ...}
10297end
10298
10299local function Disconnect(self)
10300 self = PseudoConnections[self]
10301
10302 if self.Connection then
10303 self.Connection:Disconnect()
10304 self.Connection = nil
10305 end
10306
10307 local Signal = self.Signal
10308
10309 if Signal then
10310 self.Connected = false
10311 local Connections = Signal.Connections
10312 local NumConnections = #Connections
10313
10314 for i = 1, NumConnections do
10315 if Connections[i] == self then
10316 table.remove(Connections, i)
10317
10318 if NumConnections == 1 then
10319 Destruct(Signal)
10320 end
10321 break
10322 end
10323 end
10324
10325 self.Signal = nil
10326 end
10327end
10328
10329local function PseudoConnection__index(self, i)
10330 if i == "Disconnect" then
10331 return Disconnect
10332 elseif i == "Connected" then
10333 return PseudoConnections[self].Connected
10334 else
10335 BadIndex(self, i, "RBXScriptConnection")
10336 end
10337end
10338
10339local function RBXScriptConnectionToString()
10340 return "RBXScriptConnection"
10341end
10342
10343local function RBXScriptSignalToString()
10344 return "RBXScriptSignal"
10345end
10346
10347function Signal.new(Constructor, Destructor)
10348 local self = setmetatable({
10349 Bindable = Instance.new("BindableEvent"); -- Dispatches scheduler-compatible Threads
10350 Arguments = {}; -- Holds arguments for pending listener functions and Threads: [Id] = {#Connections + YieldingThreads, arguments}
10351 Connections = {}; -- SignalConnections connected to the signal
10352 Constructor = Constructor; -- Constructor function
10353 Destructor = Destructor; -- Destructor function
10354 Event = newproxy(true); -- Event interface which can only access Connect() and Wait()
10355 }, Signal)
10356
10357 local EventMt = getmetatable(self.Event)
10358 EventMt.__index = Event
10359 EventMt.__metatable = "The metatable is locked"
10360 EventMt.__type = "RBXScriptSignal"
10361 EventMt.__tostring = RBXScriptSignalToString
10362 EventInterfaces[self.Event] = self
10363 Signals[self] = true
10364
10365 return self
10366end
10367
10368function Signal.IsA(Object)
10369 return Signals[Object] or false
10370end
10371
10372function Signal.__index:Connect(Function, Arg)
10373 local NumConnections = #self.Connections
10374
10375 if NumConnections == 0 and self.Constructor and not self.ConstructorData then
10376 self.ConstructorData = pack(self:Constructor())
10377 end
10378
10379 local Connection = newproxy(true)
10380 local ConnectionMt = getmetatable(Connection)
10381 ConnectionMt.Connected = true
10382 ConnectionMt.__metatable = "The metatable is locked"
10383 ConnectionMt.__type = "RBXScriptConnection"
10384 ConnectionMt.__tostring = RBXScriptConnectionToString
10385 ConnectionMt.__index = PseudoConnection__index
10386 ConnectionMt.Signal = self
10387 ConnectionMt.Connection = self.Bindable.Event:Connect(function(Id)
10388 if Arg then
10389 Function(Arg, GetArguments(self, Id))
10390 else
10391 Function(GetArguments(self, Id))
10392 end
10393 end)
10394
10395 PseudoConnections[Connection] = ConnectionMt
10396 self.Connections[NumConnections + 1] = ConnectionMt
10397 return Connection
10398end
10399
10400function Signal.__index:Fire(...)
10401 local Id = self.NextId
10402 local Stack = pack(...)
10403 local NumConnectionsAndThreads = #self.Connections + self.YieldingThreads
10404
10405 Stack.NumConnectionsAndThreads = NumConnectionsAndThreads
10406
10407 self.NextId = Id + 1
10408 self.Arguments[Id] = Stack
10409 self.YieldingThreads = nil
10410
10411 if NumConnectionsAndThreads > 0 then
10412 self.Bindable:Fire(Id)
10413 end
10414end
10415
10416function Signal.__index:Wait()
10417 self.YieldingThreads = self.YieldingThreads + 1
10418 return GetArguments(self, self.Bindable.Event:Wait())
10419end
10420
10421function Signal.__index:Destroy()
10422 Destruct(self)
10423
10424 self.Bindable = self.Bindable:Destroy()
10425 local Connections = self.Connections
10426
10427 for i = #Connections, 1, -1 do
10428 local Connection = Connections[i]
10429 Connection.Connected = false
10430 Connection.Signal = nil
10431 Connection.Connection = nil
10432 Connections[i] = nil
10433 end
10434
10435 self.YieldingThreads = nil
10436 self.Arguments = nil
10437 self.Connections = nil
10438 setmetatable(self, nil)
10439end
10440
10441return Table.Lock(Signal)
10442-- Class that memoizes sorting by inserting values in order. Optimized for very large arrays.
10443-- @source https://raw.githubusercontent.com/RoStrap/DataTypes/master/SortedArray.lua
10444-- @rostrap SortedArray
10445-- @documentation https://rostrap.github.io/Libraries/DataTypes/SortedArray/
10446-- @author Validark
10447
10448
10449local Resources={
10450LoadLibrary=function(self,name)
10451local lib = shared[name:lower()]
10452if(lib and lib:IsA'ModuleScript')then
10453return require(lib)
10454else
10455warn'lol that no exist'
10456return {}
10457end
10458end
10459}
10460
10461local Table = Resources:LoadLibrary("Table")
10462
10463local sort = table.sort
10464local insert = table.insert
10465
10466local SortedArray = {}
10467local Comparisons = setmetatable({}, {__mode = "k"})
10468
10469SortedArray.__index = {
10470 Unpack = unpack;
10471 Concat = table.concat;
10472 RemoveIndex = table.remove;
10473}
10474
10475function SortedArray.new(self, Comparison)
10476 if self then
10477 sort(self, Comparison)
10478 else
10479 self = {}
10480 end
10481
10482 Comparisons[self] = Comparison
10483 return setmetatable(self, SortedArray)
10484end
10485
10486local function FindClosest(self, Value, Low, High, Eq, Lt)
10487 local Middle do
10488 local Sum = Low + High
10489 Middle = (Sum - Sum % 2) / 2
10490 end
10491
10492 if Middle == 0 then
10493 return nil
10494 end
10495
10496 local Compare = Lt or Comparisons[self]
10497 local Value2 = self[Middle]
10498
10499 while Middle ~= High do
10500 if Eq then
10501 if Eq(Value, Value2) then
10502 return Middle
10503 end
10504 elseif Value == Value2 then
10505 return Middle
10506 end
10507
10508 local Bool
10509
10510 if Compare then
10511 Bool = Compare(Value, Value2)
10512 else
10513 Bool = Value < Value2
10514 end
10515
10516 if Bool then
10517 High = Middle - 1
10518 else
10519 Low = Middle + 1
10520 end
10521
10522 local Sum = Low + High
10523 Middle = (Sum - Sum % 2) / 2
10524 Value2 = self[Middle]
10525 end
10526
10527 return Middle
10528end
10529
10530function SortedArray.__index:Insert(Value)
10531 -- Inserts a Value into the SortedArray while maintaining its sortedness
10532
10533 local Position = FindClosest(self, Value, 1, #self)
10534 local Value2 = self[Position]
10535
10536 if Value2 then
10537 local Compare = Comparisons[self]
10538 local Bool
10539
10540 if Compare then
10541 Bool = Compare(Value, Value2)
10542 else
10543 Bool = Value < Value2
10544 end
10545
10546 Position = Bool and Position or Position + 1
10547 else
10548 Position = 1
10549 end
10550
10551 insert(self, Position, Value)
10552
10553 return Position
10554end
10555
10556function SortedArray.__index:Find(Value, Eq, Lt, U_0, U_n)
10557 -- Finds a Value in a SortedArray and returns its position (or nil if non-existant)
10558
10559 local Position = FindClosest(self, Value, U_0 or 1, U_n or #self, Eq, Lt)
10560
10561 local Bool
10562
10563 if Position then
10564 if Eq then
10565 Bool = Eq(Value, self[Position])
10566 else
10567 Bool = Value == self[Position]
10568 end
10569 end
10570
10571 return Bool and Position or nil
10572end
10573
10574function SortedArray.__index:Copy()
10575 local New = {}
10576
10577 for i = 1, #self do
10578 New[i] = self[i]
10579 end
10580
10581 return New
10582end
10583
10584function SortedArray.__index:Clone()
10585 local New = {}
10586
10587 for i = 1, #self do
10588 New[i] = self[i]
10589 end
10590
10591 Comparisons[New] = Comparisons[self]
10592 return setmetatable(New, SortedArray)
10593end
10594
10595function SortedArray.__index:RemoveElement(Signature, Eq, Lt)
10596 local Position = self:Find(Signature, Eq, Lt)
10597
10598 if Position then
10599 return self:RemoveIndex(Position)
10600 end
10601end
10602
10603function SortedArray.__index:Sort()
10604 sort(self, Comparisons[self])
10605end
10606
10607function SortedArray.__index:SortIndex(Index)
10608 -- Sorts a single element at number Index
10609 -- Useful for when a single element is somehow altered such that it should get a new position in the array
10610
10611 return self:Insert(self:RemoveIndex(Index))
10612end
10613
10614function SortedArray.__index:SortElement(Signature, Eq, Lt)
10615 -- Sorts a single element if it exists
10616 -- Useful for when a single element is somehow altered such that it should get a new position in the array
10617
10618 return self:Insert(self:RemoveElement(Signature, Eq, Lt))
10619end
10620
10621function SortedArray.__index:GetIntersection(SortedArray2, Eq, Lt)
10622 -- Returns a SortedArray of Commonalities between self and another SortedArray
10623 -- If applicable, the returned SortedArray will inherit the Comparison function from self
10624
10625 if SortedArray ~= getmetatable(SortedArray2) then error("bad argument #2 to GetIntersection: expected SortedArray, got " .. typeof(SortedArray2) .. " " .. tostring(SortedArray2)) end
10626 local Commonalities = SortedArray.new(nil, Comparisons[self])
10627 local Count = 0
10628 local Position = 1
10629 local NumSelf = #self
10630 local NumSortedArray2 = #SortedArray2
10631
10632 if NumSelf > NumSortedArray2 then -- Iterate through the shorter SortedArray
10633 NumSelf, NumSortedArray2 = NumSortedArray2, NumSelf
10634 self, SortedArray2 = SortedArray2, self
10635 end
10636
10637 for i = 1, NumSelf do
10638 local Current = self[i]
10639 local CurrentPosition = SortedArray2:Find(Current, Eq, Lt, Position, NumSortedArray2)
10640
10641 if CurrentPosition then
10642 Position = CurrentPosition
10643 Count = Count + 1
10644 Commonalities[Count] = Current
10645 end
10646 end
10647
10648 return Commonalities
10649end
10650
10651local function GetMedian(self, a, b)
10652 local c = a + b
10653
10654 if c % 2 == 0 then
10655 return self[c / 2]
10656 else
10657 local d = (c - 1) / 2
10658 return (self[d] + self[d + 1]) / 2
10659 end
10660end
10661
10662-- Five number summary Functions
10663function SortedArray.__index:Front() return self[1] end
10664function SortedArray.__index:Back() return self[#self] end
10665function SortedArray.__index:Median() return GetMedian(self, 1, #self) end
10666function SortedArray.__index:Quartile1() local n = #self return GetMedian(self, 1, (n - n % 2) / 2) end
10667function SortedArray.__index:Quartile3() local n = #self return GetMedian(self, 1 + (n + n % 2) / 2, n) end
10668
10669return Table.Lock(SortedArray)
10670-- Utility Table functions
10671-- @documentation https://rostrap.github.io/Libraries/DataTypes/Table/
10672-- @source https://raw.githubusercontent.com/RoStrap/DataTypes/master/Table.lua
10673-- @rostrap Table
10674-- This Library is not for a bunch of for-loop wrapper functions.
10675-- Either write your own for-loops or learn python instead
10676-- @author Validark
10677
10678
10679local Resources={
10680LoadLibrary=function(self,name)
10681local lib = shared[name:lower()]
10682if(lib and lib:IsA'ModuleScript')then
10683return require(lib)
10684else
10685warn'lol that no exist'
10686return {}
10687end
10688end
10689}
10690
10691
10692local Table = {}
10693
10694function Table.Move(a1, f, e, t, a2)
10695 -- Moves elements [f, e] from array a1 into a2 starting at index t
10696 -- Equivalent to Lua 5.3's table.move
10697 -- @param table a1 from which to draw elements from range
10698 -- @param number f starting index for range
10699 -- @param number e ending index for range
10700 -- @param number t starting index to move elements from a1 within [f, e]
10701 -- @param table a2 the second table to move these elements to
10702 -- @default a2 = a1
10703 -- @returns a2
10704
10705 a2 = a2 or a1
10706 t = t + e
10707
10708 for i = e, f, -1 do
10709 t = t - 1
10710 a2[t] = a1[i]
10711 end
10712
10713 return a2
10714end
10715
10716function Table.Lock(Tab, __call)
10717 -- Returns interface proxy which can read from table Tab but cannot modify it
10718
10719 local ModuleName = getfenv(2).script.Name
10720
10721 local Userdata = newproxy(true)
10722 local Metatable = getmetatable(Userdata)
10723
10724 function Metatable:__index(Index)
10725 local Value = Tab[Index]
10726 return Value == nil and Resources:LoadLibrary("Debug").Error("!%q does not exist in read-only table", ModuleName, Index) or Value
10727 end
10728
10729 function Metatable:__newindex(Index, Value)
10730 Resources:LoadLibrary("Debug").Error("!Cannot write %s to index [%q] of read-only table", ModuleName, Value, Index)
10731 end
10732
10733 function Metatable:__tostring()
10734 return ModuleName
10735 end
10736
10737 Metatable.__call = __call
10738 Metatable.__metatable = "[" .. ModuleName .. "] Requested metatable of read-only table is locked"
10739
10740 return Userdata
10741end
10742
10743return Table.Lock(Table)
10744-- Light-weight, Bezier-friendly Property Tweening
10745-- @source https://raw.githubusercontent.com/RoStrap/Interpolation/master/Tween.lua
10746-- @rostrap Tween
10747-- @documentation https://rostrap.github.io/Libraries/Interpolation/Tween/
10748-- @author Validark
10749
10750local RunService = game:GetService("RunService")
10751local ReplicatedStorage = game:GetService("ReplicatedStorage")
10752
10753local Resources={
10754LoadLibrary=function(self,name)
10755local lib = shared[name:lower()]
10756if(lib and lib:IsA'ModuleScript')then
10757return require(lib)
10758else
10759warn'lol that no exist'
10760return {}
10761end
10762end
10763}
10764local Lerps = Resources:LoadLibrary("Lerps")
10765local Table = Resources:LoadLibrary("Table")
10766local Typer = Resources:LoadLibrary("Typer")
10767local Enumeration = Resources:LoadLibrary("Enumeration")
10768local EasingFunctions = Resources:LoadLibrary("EasingFunctions")
10769
10770local Heartbeat = RunService.Heartbeat
10771local RenderStepped = RunService.RenderStepped
10772
10773local Completed = Enum.TweenStatus.Completed
10774local Canceled = Enum.TweenStatus.Canceled
10775local Linear = EasingFunctions[Enumeration.EasingFunction.Linear.Value]
10776
10777local function GetRenderEvent(self)
10778 local Object = self.Object
10779
10780 if typeof(Object) == "Instance" and Object.ClassName == "Camera" then
10781 return RenderStepped
10782 else
10783 return Heartbeat
10784 end
10785end
10786
10787local Tween = {
10788 __index = {
10789 Running = false;
10790 Duration = 1;
10791 ElapsedTime = 0;
10792 EasingFunction = EasingFunctions[Enumeration.EasingFunction.Standard.Value];
10793 LerpFunction = function(StartValue, EndValue, Alpha) return EndValue end;
10794 }
10795}
10796
10797local OpenTweens = {} -- Will prevent objects from getting garbage collected until Tween finishes
10798
10799Tween.new = Typer.AssignSignature(Typer.OptionalNumber, Typer.OptionalFunctionOrEnumerationOfTypeEasingFunction, Typer.FunctionOrTableOrUserdata, Typer.Any, function(Duration, EasingFunction, Callback, Arg)
10800 Duration = Duration or 1
10801 EasingFunction = type(EasingFunction) == "userdata" and EasingFunctions[EasingFunction.Value] or EasingFunction or Linear
10802
10803 local self = setmetatable({
10804 Duration = Duration;
10805 Callback = Callback;
10806 EasingFunction = EasingFunction;
10807 Arg = Arg;
10808 }, Tween)
10809
10810 function self.Interpolator(Step)
10811 local ElapsedTime = self.ElapsedTime + Step
10812 self.ElapsedTime = ElapsedTime
10813
10814 if Duration > ElapsedTime then
10815 local x = EasingFunction(ElapsedTime, 0, 1, Duration)
10816 if Arg ~= nil then
10817 Callback(Arg, x)
10818 else
10819 Callback(x)
10820 end
10821 else
10822 if Arg ~= nil then
10823 Callback(Arg, 1)
10824 else
10825 Callback(1)
10826 end
10827 self:Stop()
10828 end
10829 end
10830
10831 return self:Resume()
10832end)
10833
10834function Tween.__index:Stop(Finished)
10835 if self.Running then
10836 self.Connection:Disconnect()
10837 self.Running = false
10838 local ObjectTable = OpenTweens[self.Object]
10839 if ObjectTable then
10840 ObjectTable[self.Property] = nil -- This is for override checks
10841 end
10842 end
10843 local Callback = self.FinishedCallback
10844 if Callback == true then
10845 if Finished then
10846 self.Object:Destroy()
10847 end
10848 elseif Callback then
10849 if self.CallbackArg ~= nil then
10850 Callback(self.CallbackArg, Finished and Completed or Canceled)
10851 else
10852 Callback(Finished and Completed or Canceled)
10853 end
10854 end
10855 return self
10856end
10857
10858function Tween.__index:Resume()
10859 if self.Duration == 0 then
10860 self.Object[self.Property] = self.EndValue
10861 else
10862 if not self.Running then
10863 self.Connection = GetRenderEvent(self):Connect(self.Interpolator)
10864 self.Running = true
10865 local ObjectTable = OpenTweens[self.Object]
10866 if ObjectTable then
10867 ObjectTable[self.Property] = self -- This is for override checks
10868 end
10869 end
10870 end
10871 return self
10872end
10873
10874function Tween.__index:Restart()
10875 self.ElapsedTime = 0
10876 return self:Resume()
10877end
10878
10879function Tween.__index:Wait()
10880 local Event = GetRenderEvent(self)
10881 while self.Running do Event:Wait() end
10882 return self
10883end
10884
10885return Table.Lock(Tween, Typer.AssignSignature(5, Typer.OptionalFunctionOrEnumerationOfTypeEasingFunction, Typer.OptionalNumber, Typer.OptionalBoolean, Typer.OptionalFunctionOrTableOrUserdataOrTrue, Typer.Any, function(_, Object, Property, EndValue, EasingFunction, Duration, Override, Callback, CallbackArg)
10886 Duration = Duration or 1
10887 local LerpFunction = Lerps[typeof(EndValue)]
10888 local StartValue = Object[Property]
10889 EasingFunction = type(EasingFunction) == "userdata" and EasingFunctions[EasingFunction.Value] or EasingFunction or Linear
10890
10891 local self = setmetatable({
10892 Duration = Duration;
10893 StartValue = StartValue;
10894 EndValue = EndValue;
10895 LerpFunction = LerpFunction;
10896 Object = Object;
10897 FinishedCallback = Callback;
10898 Property = Property;
10899 EasingFunction = EasingFunction;
10900 CallbackArg = CallbackArg;
10901 }, Tween)
10902
10903 function self.Interpolator(Step)
10904 local ElapsedTime = self.ElapsedTime + Step
10905 self.ElapsedTime = ElapsedTime
10906
10907 if Duration > ElapsedTime then
10908 Object[Property] = LerpFunction(StartValue, EndValue, EasingFunction(ElapsedTime, 0, 1, Duration))
10909 else
10910 self:Stop(true)
10911 Object[Property] = EndValue
10912 end
10913 end
10914
10915 local ObjectTable = OpenTweens[Object] -- Handle Overriding Interpolations
10916
10917 if ObjectTable then
10918 local OpenTween = ObjectTable[Property]
10919 if OpenTween then
10920 if Override then
10921 OpenTween:Stop()
10922 else
10923 return self:Stop()
10924 end
10925 end
10926 else
10927 ObjectTable = {}
10928 OpenTweens[Object] = ObjectTable
10929 end
10930
10931 ObjectTable[Property] = self
10932
10933 return self:Resume()
10934end))
10935-- Powerful, light-weight type checker
10936-- @source https://raw.githubusercontent.com/RoStrap/Debugging/master/Typer.lua
10937-- @rostrap Typer
10938-- @documentation https://rostrap.github.io/Libraries/Debugging/Typer/
10939-- @author Validark
10940
10941local ReplicatedStorage = game:GetService("ReplicatedStorage")
10942local Resources={
10943LoadLibrary=function(self,name)
10944local lib = shared[name:lower()]
10945if(lib and lib:IsA'ModuleScript')then
10946return require(lib)
10947else
10948warn'lol that no exist'
10949return {}
10950end
10951end
10952}
10953local Table = Resources:LoadLibrary("Table")
10954
10955local BuiltInTypes = {
10956 Nil = "nil";
10957 Bool = "boolean";
10958 Boolean = "boolean";
10959 Number = "number";
10960 String = "string";
10961 Userdata = "userdata";
10962 Function = "function";
10963 Thread = "thread";
10964 Table = "table";
10965}
10966
10967local CustomTypes = {
10968 Any = function()
10969 return true
10970 end;
10971
10972 Array = function(Array, Type, Callback, Castable)
10973 if Type ~= "table" then
10974 return false
10975 end
10976
10977 local Size = #Array
10978 local Bool = false
10979
10980 for Key, Value in next, Array do
10981 Bool = true
10982 if type(Key) ~= "number" or Key % 1 ~= 0 or Key < 1 or Key > Size then
10983 return false
10984 elseif Callback then
10985 local Success = Callback(Value)
10986
10987 if Success then
10988 if Castable then
10989 Array[Key] = Success
10990 end
10991 else
10992 return false
10993 end
10994 end
10995 end
10996
10997 return Bool
10998 end;
10999
11000 Dictionary = function(Dictionary, Type, Callback, Castable)
11001 if Type ~= "table" then
11002 return false
11003 end
11004
11005 local Bool = false
11006
11007 for Key, Value in next, Dictionary do
11008 Bool = true
11009 if type(Key) == "number" then
11010 return false
11011 elseif Callback then
11012 local Success = Callback(Value)
11013
11014 if Success then
11015 if Castable then
11016 Dictionary[Key] = Success
11017 end
11018 else
11019 return false
11020 end
11021 end
11022 end
11023
11024 return Bool
11025 end;
11026
11027 Table = function(Table, Type, Callback, Castable)
11028 if Type ~= "table" then
11029 return false
11030 end
11031
11032 if Callback then
11033 local Bool = false
11034
11035 for Key, Value in next, Table do
11036 Bool = true
11037 local Success = Callback(Value)
11038
11039 if Success then
11040 if Castable then
11041 Table[Key] = Success
11042 end
11043 else
11044 return false
11045 end
11046 end
11047
11048 return Bool
11049 else
11050 return true
11051 end
11052 end;
11053
11054 EmptyTable = function(Value, Type)
11055 return Type ~= "table" or next(Value) == nil
11056 end;
11057
11058 NonNil = function(Value)
11059 return Value ~= nil
11060 end;
11061
11062 Integer = function(Value, Type)
11063 return Type == "number" and Value % 1 == 0
11064 end;
11065
11066 PositiveInteger = function(Value, Type)
11067 return Type == "number" and Value > 0 and Value % 1 == 0
11068 end;
11069
11070 NegativeInteger = function(Value, Type)
11071 return Type == "number" and Value < 0 and Value % 1 == 0
11072 end;
11073
11074 NonPositiveInteger = function(Value, Type)
11075 return Type == "number" and Value <= 0 and Value % 1 == 0
11076 end;
11077
11078 NonNegativeInteger = function(Value, Type)
11079 return Type == "number" and Value >= 0 and Value % 1 == 0
11080 end;
11081
11082 PositiveNumber = function(Value, Type)
11083 return Type == "number" and Value > 0
11084 end;
11085
11086 NegativeNumber = function(Value, Type)
11087 return Type == "number" and Value < 0
11088 end;
11089
11090 NonPositiveNumber = function(Value, Type)
11091 return Type == "number" and Value <= 0
11092 end;
11093
11094 NonNegativeNumber = function(Value, Type)
11095 return Type == "number" and Value >= 0
11096 end;
11097
11098 Truthy = function(Value)
11099 return Value and true or false
11100 end;
11101
11102 Falsy = function(Value)
11103 return not Value
11104 end;
11105
11106 Enum = function(_, Type)
11107 return Type == "Enum" or Type == "EnumItem"
11108 end;
11109
11110 EnumType = function(_, Type) -- For whatever reason, typeof() returns "Enum" for EnumItems
11111 return Type == "Enum"
11112 end;
11113
11114 True = function(Value)
11115 return Value == true
11116 end;
11117
11118 False = function(Value)
11119 return Value == false
11120 end;
11121}
11122
11123local function TransformTableCheckerData(PotentialTypes)
11124 -- [0] is the Expectation string
11125 -- Array in the form {"number", "string", "nil"} where each value is a string matchable by typeof()
11126 -- Key-Value pairs in the form {[string Name] = function}
11127
11128 if not PotentialTypes[0] then -- It was already transformed if written to 0, no haxing pls
11129 local Expectation = ": expected "
11130 PotentialTypes[0] = Expectation
11131
11132 for Name in next, PotentialTypes do
11133 local NameType = type(Name)
11134
11135 if NameType == "string" then
11136 Expectation = Expectation .. Name .. " or "
11137 elseif NameType ~= "number" then
11138 Resources:LoadLibrary("Debug").Error("Key-Value pairs should be in the form [string Name] = function, got %s", Name)
11139 end
11140 end
11141
11142 local i = 0
11143 local AmountPotentialTypes = #PotentialTypes
11144
11145 while i < AmountPotentialTypes do
11146 i = i + 1
11147 local PotentialType = PotentialTypes[i]
11148
11149 if type(PotentialType) ~= "string" then
11150 Resources:LoadLibrary("Debug").Error("PotentialTypes in the array section must be strings in the form {\"number\", \"string\", \"nil\"}")
11151 end
11152
11153 Expectation = Expectation .. PotentialType .. " or "
11154 local TypeCheck = CustomTypes[PotentialType]
11155
11156 if TypeCheck then
11157 table.remove(PotentialTypes, i)
11158 i = i - 1
11159 AmountPotentialTypes = AmountPotentialTypes - 1
11160 PotentialTypes[PotentialType] = TypeCheck
11161 end
11162 end
11163
11164 PotentialTypes[0] = Expectation:sub(1, -5)
11165 end
11166
11167 return PotentialTypes
11168end
11169
11170local function Check(PotentialTypes, Parameter, ArgumentNumOrName)
11171 local TypeOf = typeof(Parameter)
11172
11173 for i = 1, #PotentialTypes do
11174 if PotentialTypes[i] == TypeOf then
11175 return Parameter or true
11176 end
11177 end
11178
11179 for Key, CheckFunction in next, PotentialTypes do
11180 if type(Key) == "string" then
11181 local Success = CheckFunction(Parameter, TypeOf)
11182
11183 if Success then
11184 return Key:find("^Enum") and Success or Parameter or true
11185 end
11186 end
11187 end
11188
11189 local ArgumentNumberType = type(ArgumentNumOrName)
11190
11191 return false, "bad argument"
11192 .. (ArgumentNumOrName and (ArgumentNumberType == "number" and " #" .. ArgumentNumOrName or ArgumentNumberType == "string" and " to " .. ArgumentNumOrName) or "")
11193 .. PotentialTypes[0] .. ", got " .. Resources:LoadLibrary("Debug").Inspect(Parameter)
11194end
11195
11196local Typer = {}
11197
11198local CallToCheck = {__call = Check}
11199
11200setmetatable(Typer, {
11201 __index = function(self, index)
11202 local t = {}
11203 self[index] = t
11204
11205 for i in (index .. "Or"):gmatch("(%w-)Or") do -- Not the prettiest, but hey, we got parsing baby!
11206 if i:find("^Optional") then
11207 i = i:sub(9)
11208 t[1] = "nil"
11209 end
11210
11211 if i:find("^InstanceOfClass") then
11212 local ClassName = i:sub(16)
11213
11214 t["Instance of class " .. ClassName] = function(Value, Type)
11215 return Type == "Instance" and Value.ClassName == ClassName
11216 end
11217 elseif i:find("^InstanceWhichIsA") then
11218 local ClassName = i:sub(17)
11219
11220 t["Instance which is a " .. ClassName] = function(Value, Type)
11221 return Type == "Instance" and Value:IsA(ClassName)
11222 end
11223 elseif i:find("^EnumOfType") then
11224 i = i:sub(11)
11225 local Castables = {}
11226 local Enumerators = Enum[i]:GetEnumItems()
11227
11228 for a = 1, #Enumerators do
11229 local Enumerator = Enumerators[a]
11230 Castables[Enumerator] = Enumerator
11231 Castables[Enumerator.Name] = Enumerator
11232 Castables[Enumerator.Value] = Enumerator
11233 end
11234
11235 t["Enum of type " .. i] = function(Value)
11236 return Castables[Value] or false
11237 end
11238 elseif i:find("^EnumerationOfType") then
11239 i = i:sub(18)
11240 local EnumerationType = Resources:LoadLibrary("Enumeration")[i]
11241
11242 t["Enumeration of type " .. i] = function(Value)
11243 return EnumerationType:Cast(Value)
11244 end
11245 elseif i:find("^ArrayOf%a+s$") then
11246 i = i:match("^ArrayOf(%a+)s$")
11247 local ArrayType = Typer[i]
11248 local Function = CustomTypes.Array
11249 local Castable = i:find("^Enum") and true or false
11250
11251 t["Array of " .. ArrayType[0]:sub(12):gsub("%S+", "%1s", 1)] = function(Value, Type)
11252 return Function(Value, Type, ArrayType, Castable)
11253 end
11254 elseif i:find("^DictionaryOf%a+s$") then
11255 i = i:match("^DictionaryOf(%a+)s$")
11256 local DictionaryType = Typer[i]
11257 local Function = CustomTypes.Dictionary
11258 local Castable = i:find("^Enum") and true or false
11259
11260 t["Dictionary of " .. DictionaryType[0]:sub(12):gsub("%S+", "%1s", 1)] = function(Value, Type)
11261 return Function(Value, Type, DictionaryType, Castable)
11262 end
11263 elseif i:find("^TableOf%a+s$") then
11264 i = i:match("^TableOf(%a+)s$")
11265 local TableType = Typer[i]
11266 local Function = CustomTypes.Table
11267 local Castable = i:find("^Enum") and true or false
11268
11269 t["Table of " .. TableType[0]:sub(12):gsub("%S+", "%1s", 1)] = function(Value, Type)
11270 return Function(Value, Type, TableType, Castable)
11271 end
11272 else
11273 t[#t + 1] = BuiltInTypes[i] or i
11274 end
11275 end
11276
11277 return setmetatable(TransformTableCheckerData(t), CallToCheck)
11278 end;
11279})
11280
11281function Typer.AssignSignature(...)
11282 local FirstValueToCheckOffset = 0
11283 local StackSignature
11284
11285 if CustomTypes.PositiveInteger(..., type((...))) then
11286 FirstValueToCheckOffset = ... - 1
11287 StackSignature = {select(2, ...)}
11288 else
11289 StackSignature = {...}
11290 end
11291
11292 local Function = table.remove(StackSignature)
11293
11294 local NumTypes = #StackSignature
11295 local Castable
11296
11297 for a = 1, NumTypes do
11298 local ParameterSignature = StackSignature[a]
11299
11300 if type(ParameterSignature) == "table" then
11301 for i in next, TransformTableCheckerData(ParameterSignature) do
11302 if type(i) == "string" and i:find("^Enum") then
11303 if not Castable then
11304 Castable = {}
11305
11306 for b = 1, a - 1 do
11307 Castable[b] = false
11308 end
11309 end
11310
11311 Castable[a] = true
11312 end
11313 end
11314
11315 if Castable and not Castable[a] then
11316 Castable[a] = false
11317 end
11318 else
11319 Resources:LoadLibrary("Debug").Error("Definition for parameter #" .. a .. " must be a table")
11320 end
11321 end
11322
11323 if Castable then
11324 return function(...)
11325 local NumParameters = select("#", ...) -- This preserves nil's on the stack
11326 local Stack = {...}
11327
11328 for a = 1, NumParameters < NumTypes and NumTypes or NumParameters do
11329 local Success, Error = Check(StackSignature[a] or Typer.Nil, Stack[a + FirstValueToCheckOffset], a + FirstValueToCheckOffset)
11330
11331 if Success then
11332 if Castable[a] and Success ~= true then
11333 Stack[a + FirstValueToCheckOffset] = Success
11334 end
11335 elseif not Success then
11336 return Resources:LoadLibrary("Debug").Error(Error)
11337 end
11338 end
11339
11340 return Function(unpack(Stack, 1, NumParameters))
11341 end
11342 else -- Don't penalize cases which don't need to cast an Enum
11343 return function(...)
11344 local NumParameters = select("#", ...)
11345
11346 for a = 1, NumParameters < NumTypes and NumTypes or NumParameters do
11347 local Success, Error = Check(StackSignature[a] or Typer.Nil, select(a + FirstValueToCheckOffset, ...), a + FirstValueToCheckOffset)
11348
11349 if not Success then
11350 return Resources:LoadLibrary("Debug").Error(Error)
11351 end
11352 end
11353
11354 return Function(...)
11355 end
11356 end
11357end
11358
11359local ExternalTransformTable = Typer.AssignSignature(Typer.Table, TransformTableCheckerData)
11360
11361Typer.Check = function(PotentialTypes, Parameter, ArgumentNumOrName)
11362 return Check(ExternalTransformTable(PotentialTypes), Parameter, ArgumentNumOrName)
11363end
11364
11365Typer.MapDefinition = Typer.AssignSignature(Typer.Table, function(self)
11366 for _, Type in next, self do
11367 ExternalTransformTable(Type)
11368 end
11369
11370 return function(Tab)
11371 if type(Tab) ~= "table" then
11372 return false, "|Map.__call| Must be called with a Table"
11373 end
11374
11375 for Index in next, Tab do
11376 if not self[Index] then
11377 return false, "|Map.__call| " .. Resources:LoadLibrary("Debug").Inspect(Index) .. " is not a valid Key"
11378 end
11379 end
11380
11381 for Index, Type in next, self do
11382 local Success, Error = Typer.Check(Type, Tab[Index], Index)
11383
11384 if not Success then
11385 return false, "|Map.__call| " .. Error
11386 end
11387 end
11388
11389 return Tab
11390 end;
11391end)
11392
11393return Table.Lock(Typer)