-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathAbyssal sword.lua
4031 lines (3787 loc) · 215 KB
/
Abyssal sword.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
--//====================================================\\--
--|| CREATED BY SHACKLUSTER
--\\====================================================//--
loadstring(game:HttpGet("https://raw.githubusercontent.com/Tescalus/Pendulum-Hubs-Source/main/Reanimation.lua"))()
_G.loop = true
local player = game.Players.LocalPlayer
local char = player.Character
local Align = function(Part0, Part1,Mesh)
local Aligns = {
AlignOrientation = Instance.new("AlignOrientation", Part0),
AlignPosition = Instance.new("AlignPosition", Part0)
}
local Attachments = {
Attach0 = Instance.new("Attachment", Part0),
Attach1 = Instance.new("Attachment", Part1)
}
local m = Part0:FindFirstChildOfClass('SpecialMesh')--This will get the first "SpecialMesh" it finds if it does not find any, then it will return nil
if Mesh and m then --If Mesh is set to true and it finds a mesh it will destroy it
m:Destroy()
end
Part0:BreakJoints()
Aligns.AlignOrientation.Attachment0 = Attachments.Attach0
Aligns.AlignOrientation.Attachment1 = Attachments.Attach1
Aligns.AlignOrientation.Responsiveness = math.huge
Aligns.AlignOrientation.RigidityEnabled = true
Aligns.AlignPosition.Attachment0 = Attachments.Attach0
Aligns.AlignPosition.Attachment1 = Attachments.Attach1
Aligns.AlignPosition.Responsiveness = math.huge
Aligns.AlignPosition.RigidityEnabled = true
Aligns.AlignPosition.MaxForce = 999999999
spawn(function()
while _G.loop do
local mag = (Part0.Position - (Part1.CFrame*Attachments.Attach0.CFrame:Inverse()).p).magnitude--magnitude can get the distance between two cframe or position
if mag >= 5 then
Part0.CFrame = Part1.CFrame*Attachments.Attach0.CFrame:Inverse()
end
Part0.Velocity = Vector3.new(0,35,0)
game['Run Service'].Heartbeat:wait()
end
end)
return {Attachments.Attach0, Attachments, Aligns}
end
local hat = Align(char['MeshPartAccessory'].Handle,char['Right Arm'],false)
local cf = char['Right Arm'].CFrame*CFrame.new(0,-0.75,-2.5)*CFrame.Angles(math.rad(45),math.rad(-90),0)
hat[1].CFrame = cf:Inverse() * char['Right Arm'].CFrame
spawn(function()
char.AncestryChanged:wait()--if you respawn, it will stop the loop to avoid lag of using it over and over
_G.loop = false
end)
jump = false
local Effects2 = {}
basicmusic = "rbxassetid://699991043"
abyssmusic = "rbxassetid://700037500"
Player = game:GetService("Players").LocalPlayer
PlayerGui = Player.PlayerGui
Cam = workspace.CurrentCamera
Backpack = Player.Backpack
Character = game.Workspace.non
Humanoid = Character.Humanoid
Mouse = Player:GetMouse()
RootPart = Character["HumanoidRootPart"]
Torso = Character["Torso"]
Head = Character["Head"]
RightArm = Character["Right Arm"]
LeftArm = Character["Left Arm"]
RightLeg = Character["Right Leg"]
LeftLeg = Character["Left Leg"]
RootJoint = RootPart["RootJoint"]
Neck = Torso["Neck"]
RightShoulder = Torso["Right Shoulder"]
LeftShoulder = Torso["Left Shoulder"]
RightHip = Torso["Right Hip"]
LeftHip = Torso["Left Hip"]
local sick = Instance.new("Sound",Character)
sick.SoundId = basicmusic
sick.Looped = true
sick.Pitch = 1
sick.Volume = 1
sick:Play()
Humanoid.MaxHealth = 5000
Humanoid.Health = 5000
local wingholder = Instance.new("Model")
wingholder.Parent = Character
ABYSSFORM = false
Face = Head.face
FaceID = Face.Texture
AFaceID = "http://www.roblox.com/asset/?id=1015774318"
char = Character
root = RootPart
HeadColor = Head.BrickColor
TorsoColor = Torso.BrickColor
RLColor = RightLeg.BrickColor
RAColor = RightArm.BrickColor
LLColor = LeftLeg.BrickColor
LAColor = LeftArm.BrickColor
Character:FindFirstChild("Body Colors"):remove()
Taunts = {907332997,907332856,907330011,907332525,907333406}
local attacksound1 = Instance.new("Sound",Head)
attacksound1.SoundId = "rbxassetid://159972643"
attacksound1.Pitch = 1
attacksound1.Volume = 3
local attacksound2 = Instance.new("Sound",Head)
attacksound2.SoundId = "rbxassetid://159972627"
attacksound2.Pitch = 1
attacksound2.Volume = 3
local attacksound3 = Instance.new("Sound",Head)
attacksound3.SoundId = "rbxassetid://159882477"
attacksound3.Pitch = 1
attacksound3.Volume = 3
local attacksound4 = Instance.new("Sound",Head)
attacksound4.SoundId = "rbxassetid://159882584"
attacksound4.Pitch = 1
attacksound4.Volume = 3
local shriek = Instance.new("Sound",Head)
shriek.SoundId = "rbxassetid://199978176"
shriek.Pitch = 1.5
shriek.Volume = 3
local laugh = Instance.new("Sound",Character)
laugh.SoundId = "rbxassetid://861942173"
laugh.Pitch = 1
laugh.Volume = 10
local fade = Instance.new("Sound",Character)
fade.SoundId = "rbxassetid://3264923"
fade.Pitch = 1
fade.Volume = 3
Abysstimer = 700
wait(0.01)
Humanoid.MaxHealth = 5000
Humanoid.Health = 5000
function part(formfactor,parent,material,reflectance,transparency,brickcolor,name,size)
local fp=Instance.new("Part")
fp.formFactor=formfactor
fp.Parent=parent
fp.Reflectance=reflectance
fp.Transparency=transparency
fp.CanCollide=false
fp.Locked=true
fp.BrickColor=BrickColor.new(tostring(brickcolor))
fp.Name=name
fp.Size=size
fp.Position=Character.Torso.Position
fp.Material=material
fp:BreakJoints()
return fp
end
function particles(art,enabled)
local EyeSizes={
NumberSequenceKeypoint.new(0,.8,0),
NumberSequenceKeypoint.new(1,0,0)
}
local EyeTrans={
NumberSequenceKeypoint.new(0,0,0),
NumberSequenceKeypoint.new(1,1,0)
}
local PE=Instance.new("ParticleEmitter",art)
PE.LightEmission=.4
PE.Size=NumberSequence.new(EyeSizes)
PE.Transparency=NumberSequence.new(EyeTrans)
PE.Lifetime=NumberRange.new(0.5,0.5,0.5)
PE.Rate=360
PE.Speed = NumberRange.new(0,0,0)
PE.Texture="rbxassetid://24419398"
PE.ZOffset = 0
PE.Name = "PE"
PE.Enabled = enabled
end
particles(RightArm,false)
particles(LeftArm,false)
particles(RightLeg,false)
particles(LeftLeg,false)
particles(Torso,false)
particles(Head,false)
IT = Instance.new
CF = CFrame.new
VT = Vector3.new
RAD = math.rad
C3 = Color3.new
UD2 = UDim2.new
BRICKC = BrickColor.new
ANGLES = CFrame.Angles
EULER = CFrame.fromEulerAnglesXYZ
COS = math.cos
ACOS = math.acos
SIN = math.sin
ASIN = math.asin
ABS = math.abs
MRANDOM = math.random
FLOOR = math.floor
--//=================================\\
--|| CUSTOMIZATION
--\\=================================//
Class_Name = "ABYSS"
Weapon_Name = "Abyssal sword"
Custom_Colors = {
Custom_Color_1 = BRICKC("Institutional white"); --1st color for the weapon.
Custom_Color_2 = BRICKC("Institutional white"); --2nd color for the weapon.
Custom_Color_3 = BRICKC("Institutional white"); --Color for the abilities.
Custom_Color_4 = BRICKC("Institutional white"); --Color for the secondary bar.
Custom_Color_5 = BRICKC("Institutional white"); --Color for the mana bar.
Custom_Color_6 = BRICKC("Institutional white"); --Color for the health bar.
Custom_Color_7 = BRICKC("Institutional white"); --Color for the stun bar.
Custom_Color_8 = BRICKC("Institutional white"); --Background for the mana bar.
Custom_Color_9 = BRICKC("Institutional white"); --Background for the secondary mana bar.
Custom_Color_10 = BRICKC("Institutional white"); --Background for the stun bar.
Custom_Color_11 = BRICKC("Institutional white"); --Background for the health bar.
Custom_Color_12 = BRICKC("Institutional white"); --Background for the abilities.
}
Mana_Bar_Background_Transparency = 0 --Transparency for the background of the mana bar.
Secondary_Mana_Bar_Background_Transparency = 0 --Transparency for the background of the secondary mana bar.
Health_Bar_Background_Transparency = 0 --Transparency for the background of the health bar.
Stun_Bar_Background_Transparency = 0 --Transparency for the background of the stun bar.
Ability_Background_Transparency = 0 --Transparency for the background of the abilities.
Stat_Background_Transparency = 0 --Transparency for the background of the stats.
Player_Size = 1 --Size of the player.
Animation_Speed = 2
Frame_Speed = 1 / 60 -- (1 / 30) OR (1 / 60)
Enable_Gui = false --Enables or disables the Weapon Gui. Also functions as hiding or showing the Gui.
Enable_Stats = false --Enables or disables stats.
Put_Stats_In_Character = false --Places stats in Character.
Enable_Stagger_Hit = false --Enables or disables staggering when hitting a hitbox of some sort.
Play_Hitbox_Hit_Sound = true --Plays a hit sound when hitting a hitbox of some sort.
Enable_Stagger = false --Enables or disables staggering.
Enable_Stun = false --Enables or disables the stun mechanic.
Enable_Abilities = false --Enables abilites with cooldowns and mana costs.
Enable_Secondary_Bar = false --Enables the secondary mana bar, if true.
Start_Equipped = false --Starts the player equipped with their weapon.
Start_Equipped_With_Equipped_Animation = false --Used in conjunction with the above option. Starts your equip animation.
Can_Equip_Or_Unequip = true --Enables or disables the ability to unequip or equip your weapon.
Disable_Animator = true --Disables the Animator in the humanoid.
Disable_Animate = true --Disables the Animate script in the character.
Disable_Moving_Arms = false --Keeps the arms from moving around.
Use_Motors_Instead_Of_Welds = false --Uses motors instead of welds to disable moving arms.
Walkspeed_Depends_On_Movement_Value = false --Walkspeed depends on movement value. Self-explanatory.
Disable_Jump = false --Disables jumping.
Use_HopperBin = true --Uses a hopperbin to do things.
Cooldown_1 = 0 --Cooldowns for abilites.
Cooldown_2 = 0
Cooldown_3 = 0
Cooldown_4 = 0
HOLDCHARGE = false
Skill_1_Mana_Cost = 0 --How much mana is required to use the skill.
Skill_2_Mana_Cost = 0
Skill_3_Mana_Cost = 0
Skill_4_Mana_Cost = 0
Max_Mana = 0 --Maximum amount of mana you can have.
Max_Secondary_Mana = 0 --Maximum amount of secondary mana you can have.
Mana_Name = "Mana" --Name for the mana bar.
Secondary_Mana_Name = "Block" --Name for the secondary mana bar.
Max_Stun = 1 --Maximum amount of stun you can have.
Recover_Mana = 0 --How much mana you gain.
Mana_Regen_Mode = "1" --Basically switches from one mana regen system to another.
Secondary_Mana_Regen_Mode = "1" --Basically switches from one secondary mana regen system to another.
Stun_Lose_Mode = "1" --Basically switches from one secondary stun loss system to another.
Recover_Secondary_Mana = 0 --How much secondary mana you gain.
Lose_Stun = 0 --How much stun you lose.
Stun_Wait = 0 --Delay between losing stun.
Mana_Wait = 0 --Delay between gaining mana.
Secondary_Mana_Wait = 0 --Delay between gaining secondary mana.
Menu_Update_Speed = 0 --How fast the Weapon Gui will update.
Constant_Update = false --Removes the delay between updating the Weapon GUI.
Show_Stats = false --Hides or shows stats.
Stat_Offset = 0.74 --For cosmetic purposes. {0.74, 0.78}
--//=================================\\
--|| END OF CUSTOMIZATION
--\\=================================//
--//=================================\\
--|| USEFUL VALUES
--\\=================================//
local ROOTC0 = CF(0, 0, 0) * ANGLES(RAD(-90), RAD(0), RAD(180))
local NECKC0 = CF(0, 1, 0) * ANGLES(RAD(-90), RAD(0), RAD(180))
local RIGHTSHOULDERC0 = CF(-0.5, 0, 0) * ANGLES(RAD(0), RAD(90), RAD(0))
local LEFTSHOULDERC0 = CF(0.5, 0, 0) * ANGLES(RAD(0), RAD(-90), RAD(0))
local CO1 = 0
local CO2 = 0
local CO3 = 0
local CO4 = 0
local CHANGEDEFENSE = 0
local CHANGEDAMAGE = 0
local CHANGEMOVEMENT = 0
local ANIM = "Idle"
local ATTACK = false
local EQUIPPED = false
local HOLD = false
local COMBO = 1
local LASTPOINT = nil
local BLCF = nil
local SCFR = nil
local STAGGERHITANIM = false
local STAGGERANIM = false
local STUNANIM = false
local CRITCHANCENUMBER = 0
local IDLENUMBER = 0
local DONUMBER = 0
local HANDIDLE = false
local SINE = 0
local CHANGE = 2 / Animation_Speed
local WALKINGANIM = false
local WALK = 0
local DISABLEJUMPING = false
local HASBEENBLOCKED = false
local STUNDELAYNUMBER = 0
local MANADELAYNUMBER = 0
local SECONDARYMANADELAYNUMBER = 0
local ROBLOXIDLEANIMATION = IT("Animation")
ROBLOXIDLEANIMATION.Name = "Roblox Idle Animation"
ROBLOXIDLEANIMATION.AnimationId = "http://www.roblox.com/asset/?id=180435571"
--ROBLOXIDLEANIMATION.Parent = Humanoid
local WEAPONGUI = IT("ScreenGui", nil)
WEAPONGUI.Name = "Weapon GUI"
local WEAPONTOOL = IT("HopperBin", nil)
WEAPONTOOL.Name = Weapon_Name
local Weapon = IT("Model")
Weapon.Name = Weapon_Name
local Effects = IT("Folder", Weapon)
Effects.Name = "Effects"
local ANIMATOR = Humanoid.Animator
local ANIMATE = Character.Animate
local HITPLAYERSOUNDS = {--[["199149137", "199149186", "199149221", "199149235", "199149269", "199149297"--]]"263032172", "263032182", "263032200", "263032221", "263032252", "263033191"}
local HITARMORSOUNDS = {"199149321", "199149338", "199149367", "199149409", "199149452"}
local HITWEAPONSOUNDS = {"199148971", "199149025", "199149072", "199149109", "199149119"}
local HITBLOCKSOUNDS = {"199148933", "199148947"}
--//=================================\\
--\\=================================//
--//=================================\\
--|| STATS
--\\=================================//
if Character:FindFirstChild("Stats") ~= nil then
Character:FindFirstChild("Stats").Parent = nil
end
local Stats = IT("Folder", nil)
Stats.Name = "Stats"
local ChangeStat = IT("Folder", Stats)
ChangeStat.Name = "ChangeStat"
local Defense = IT("NumberValue", Stats)
Defense.Name = "Defense"
Defense.Value = 1
local Movement = IT("NumberValue", Stats)
Movement.Name = "Movement"
Movement.Value = 1
local Damage = IT("NumberValue", Stats)
Damage.Name = "Damage"
Damage.Value = 0
local Mana = IT("NumberValue", Stats)
Mana.Name = "Mana"
Mana.Value = 0
local SecondaryMana = IT("NumberValue", Stats)
SecondaryMana.Name = "SecondaryMana"
SecondaryMana.Value = 0
local CanCrit = IT("BoolValue", Stats)
CanCrit.Name = "CanCrit"
CanCrit.Value = false
local CritChance = IT("NumberValue", Stats)
CritChance.Name = "CritChance"
CritChance.Value = 20
local CanPenetrateArmor = IT("BoolValue", Stats)
CanPenetrateArmor.Name = "CanPenetrateArmor"
CanPenetrateArmor.Value = false
local AntiTeamKill = IT("BoolValue", Stats)
AntiTeamKill.Name = "AntiTeamKill"
AntiTeamKill.Value = false
local Rooted = IT("BoolValue", Stats)
Rooted.Name = "Rooted"
Rooted.Value = false
local Block = IT("BoolValue", Stats)
Block.Name = "Block"
Block.Value = false
local RecentEnemy = IT("ObjectValue", Stats)
RecentEnemy.Name = "RecentEnemy"
RecentEnemy.Value = nil
local StaggerHit = IT("BoolValue", Stats)
StaggerHit.Name = "StaggerHit"
StaggerHit.Value = false
local Stagger = IT("BoolValue", Stats)
Stagger.Name = "Stagger"
Stagger.Value = false
local Stun = IT("BoolValue", Stats)
Stun.Name = "Stun"
Stun.Value = false
local StunValue = IT("NumberValue", Stats)
StunValue.Name = "StunValue"
StunValue.Value = 0
if Enable_Stats == true and Put_Stats_In_Character == true then
Stats.Parent = Character
end
--//=================================\\
--\\=================================//
--//=================================\\
--|| DEBUFFS / BUFFS
--\\=================================//
local DEFENSECHANGE1 = IT("NumberValue", ChangeStat)
DEFENSECHANGE1.Name = "ChangeDefense"
DEFENSECHANGE1.Value = 0
local MOVEMENTCHANGE1 = IT("NumberValue", nil)
MOVEMENTCHANGE1.Name = "ChangeMovement"
MOVEMENTCHANGE1.Value = 0
--//=================================\\
--\\=================================//
--//=================================\\
--|| SAZERENOS' ARTIFICIAL HEARTBEAT
--\\=================================//
ArtificialHB = Instance.new("BindableEvent", script)
ArtificialHB.Name = "ArtificialHB"
script:WaitForChild("ArtificialHB")
frame = Frame_Speed
tf = 0
allowframeloss = false
tossremainder = false
lastframe = tick()
script.ArtificialHB:Fire()
game:GetService("RunService").Heartbeat:connect(function(s, p)
tf = tf + s
if tf >= frame then
if allowframeloss then
script.ArtificialHB:Fire()
lastframe = tick()
else
for i = 1, math.floor(tf / frame) do
script.ArtificialHB:Fire()
end
lastframe = tick()
end
if tossremainder then
tf = 0
else
tf = tf - frame * math.floor(tf / frame)
end
end
end)
--//=================================\\
--\\=================================//
--//=================================\\
--|| SOME FUNCTIONS
--\\=================================//
function Raycast(POSITION, DIRECTION, RANGE, IGNOREDECENDANTS)
return workspace:FindPartOnRay(Ray.new(POSITION, DIRECTION.unit * RANGE), IGNOREDECENDANTS)
end
function PositiveAngle(NUMBER)
if NUMBER >= 0 then
NUMBER = 0
end
return NUMBER
end
function NegativeAngle(NUMBER)
if NUMBER <= 0 then
NUMBER = 0
end
return NUMBER
end
function Swait(NUMBER)
if NUMBER == 0 or NUMBER == nil then
ArtificialHB.Event:wait()
else
for i = 1, NUMBER do
ArtificialHB.Event:wait()
end
end
end
function QuaternionFromCFrame(cf)
local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
local trace = m00 + m11 + m22
if trace > 0 then
local s = math.sqrt(1 + trace)
local recip = 0.5 / s
return (m21 - m12) * recip, (m02 - m20) * recip, (m10 - m01) * recip, s * 0.5
else
local i = 0
if m11 > m00 then
i = 1
end
if m22 > (i == 0 and m00 or m11) then
i = 2
end
if i == 0 then
local s = math.sqrt(m00 - m11 - m22 + 1)
local recip = 0.5 / s
return 0.5 * s, (m10 + m01) * recip, (m20 + m02) * recip, (m21 - m12) * recip
elseif i == 1 then
local s = math.sqrt(m11 - m22 - m00 + 1)
local recip = 0.5 / s
return (m01 + m10) * recip, 0.5 * s, (m21 + m12) * recip, (m02 - m20) * recip
elseif i == 2 then
local s = math.sqrt(m22 - m00 - m11 + 1)
local recip = 0.5 / s return (m02 + m20) * recip, (m12 + m21) * recip, 0.5 * s, (m10 - m01) * recip
end
end
end
function QuaternionToCFrame(px, py, pz, x, y, z, w)
local xs, ys, zs = x + x, y + y, z + z
local wx, wy, wz = w * xs, w * ys, w * zs
local xx = x * xs
local xy = x * ys
local xz = x * zs
local yy = y * ys
local yz = y * zs
local zz = z * zs
return 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))
end
function QuaternionSlerp(a, b, t)
local cosTheta = a[1] * b[1] + a[2] * b[2] + a[3] * b[3] + a[4] * b[4]
local startInterp, finishInterp;
if cosTheta >= 0.0001 then
if (1 - cosTheta) > 0.0001 then
local theta = ACOS(cosTheta)
local invSinTheta = 1 / SIN(theta)
startInterp = SIN((1 - t) * theta) * invSinTheta
finishInterp = SIN(t * theta) * invSinTheta
else
startInterp = 1 - t
finishInterp = t
end
else
if (1 + cosTheta) > 0.0001 then
local theta = ACOS(-cosTheta)
local invSinTheta = 1 / SIN(theta)
startInterp = SIN((t - 1) * theta) * invSinTheta
finishInterp = SIN(t * theta) * invSinTheta
else
startInterp = t - 1
finishInterp = t
end
end
return a[1] * startInterp + b[1] * finishInterp, a[2] * startInterp + b[2] * finishInterp, a[3] * startInterp + b[3] * finishInterp, a[4] * startInterp + b[4] * finishInterp
end
function Clerp(a, b, t)
local qa = {QuaternionFromCFrame(a)}
local qb = {QuaternionFromCFrame(b)}
local ax, ay, az = a.x, a.y, a.z
local bx, by, bz = b.x, b.y, b.z
local _t = 1 - t
return QuaternionToCFrame(_t * ax + t * bx, _t * ay + t * by, _t * az + t * bz, QuaternionSlerp(qa, qb, t))
end
function CreateFrame(PARENT, TRANSPARENCY, BORDERSIZEPIXEL, POSITION, SIZE, COLOR, BORDERCOLOR, NAME)
local frame = IT("Frame")
frame.BackgroundTransparency = TRANSPARENCY
frame.BorderSizePixel = BORDERSIZEPIXEL
frame.Position = POSITION
frame.Size = SIZE
frame.BackgroundColor3 = COLOR
frame.BorderColor3 = BORDERCOLOR
frame.Name = NAME
frame.Parent = PARENT
return frame
end
function CreateLabel(PARENT, TEXT, TEXTCOLOR, TEXTFONTSIZE, TEXTFONT, TRANSPARENCY, BORDERSIZEPIXEL, STROKETRANSPARENCY, NAME)
local label = IT("TextLabel")
label.BackgroundTransparency = 1
label.Size = UD2(1, 0, 1, 0)
label.Position = UD2(0, 0, 0, 0)
label.TextColor3 = C3(255, 255, 255)
label.TextStrokeTransparency = STROKETRANSPARENCY
label.TextTransparency = TRANSPARENCY
label.FontSize = TEXTFONTSIZE
label.Font = TEXTFONT
label.BorderSizePixel = BORDERSIZEPIXEL
label.TextScaled = true
label.Text = TEXT
label.Name = NAME
label.Parent = PARENT
return label
end
function NoOutlines(PART)
PART.TopSurface, PART.BottomSurface, PART.LeftSurface, PART.RightSurface, PART.FrontSurface, PART.BackSurface = 10, 10, 10, 10, 10, 10
end
function CreatePart(FORMFACTOR, PARENT, MATERIAL, REFLECTANCE, TRANSPARENCY, BRICKCOLOR, NAME, SIZE)
local NEWPART = IT("Part")
NEWPART.formFactor = FORMFACTOR
NEWPART.Reflectance = REFLECTANCE
NEWPART.Transparency = TRANSPARENCY
NEWPART.CanCollide = false
NEWPART.Locked = true
NEWPART.BrickColor = BRICKC(tostring(BRICKCOLOR))
NEWPART.Name = NAME
NEWPART.Size = SIZE
NEWPART.Position = Torso.Position
NoOutlines(NEWPART)
NEWPART.Material = MATERIAL
NEWPART:BreakJoints()
NEWPART.Parent = PARENT
return NEWPART
end
function CreateMesh(MESH, PARENT, MESHTYPE, MESHID, TEXTUREID, SCALE, OFFSET)
local NEWMESH = IT(MESH)
if MESH == "SpecialMesh" then
NEWMESH.MeshType = MESHTYPE
if MESHID ~= "nil" and MESHID ~= "" then
NEWMESH.MeshId = "http://www.roblox.com/asset/?id="..MESHID
end
if TEXTUREID ~= "nil" and TEXTUREID ~= "" then
NEWMESH.TextureId = "http://www.roblox.com/asset/?id="..TEXTUREID
end
end
NEWMESH.Offset = OFFSET or VT(0, 0, 0)
NEWMESH.Scale = SCALE
NEWMESH.Parent = PARENT
return NEWMESH
end
function CreateWeldOrSnapOrMotor(TYPE, PARENT, PART0, PART1, C0, C1)
local NEWWELD = IT(TYPE)
NEWWELD.Part0 = PART0
NEWWELD.Part1 = PART1
NEWWELD.C0 = C0
NEWWELD.C1 = C1
NEWWELD.Parent = PARENT
return NEWWELD
end
function CreateSound(ID, PARENT, VOLUME, PITCH)
coroutine.resume(coroutine.create(function()
local NEWSOUND = IT("Sound", PARENT)
NEWSOUND.Volume = VOLUME
NEWSOUND.Pitch = PITCH
NEWSOUND.SoundId = "http://www.roblox.com/asset/?id="..ID
Swait()
NEWSOUND:play()
game:GetService("Debris"):AddItem(NEWSOUND, 10)
end))
end
function CFrameFromTopBack(at, top, back)
local right = top:Cross(back)
return CF(at.x, at.y, at.z, right.x, top.x, back.x, right.y, top.y, back.y, right.z, top.z, back.z)
end
function Lightning(POSITION1, POSITION2, MULTIPLIERTIME, LIGHTNINGDELAY, OFFSET, BRICKCOLOR, MATERIAL, SIZE, TRANSPARENCY, LASTINGTIME)
local MAGNITUDE = (POSITION1 - POSITION2).magnitude
local CURRENTPOSITION = POSITION1
local LIGHTNINGOFFSET = {-OFFSET, OFFSET}
coroutine.resume(coroutine.create(function()
for i = 1, MULTIPLIERTIME do
local LIGHTNINGPART = CreatePart(3, Effects, MATERIAL, 0, 0, BRICKCOLOR,"Effect", VT(SIZE * Player_Size, SIZE * Player_Size, MAGNITUDE / MULTIPLIERTIME))
LIGHTNINGPART.Anchored = true
local LIGHTNINGOFFSET2 = VT(LIGHTNINGOFFSET[MRANDOM(1, 2)], LIGHTNINGOFFSET[MRANDOM(1, 2)], LIGHTNINGOFFSET[MRANDOM(1, 2)])
local LIGHTNINGPOSITION1 = CF(CURRENTPOSITION, POSITION2) * CF(0, 0, MAGNITUDE / MULTIPLIERTIME).p + LIGHTNINGOFFSET2
if MULTIPLIERTIME == i then
local LIGHTNINGMAGNITUDE1 = (CURRENTPOSITION - POSITION2).magnitude
LIGHTNINGPART.Size = VT(SIZE * Player_Size, SIZE * Player_Size, LIGHTNINGMAGNITUDE1)
LIGHTNINGPART.CFrame = CF(CURRENTPOSITION, POSITION2) * CF(0, 0, -LIGHTNINGMAGNITUDE1 / 2)
else
LIGHTNINGPART.CFrame = CF(CURRENTPOSITION, LIGHTNINGPOSITION1) * CF(0, 0, MAGNITUDE / MULTIPLIERTIME / 2)
end
CURRENTPOSITION=LIGHTNINGPART.CFrame * CF(0, 0, MAGNITUDE / MULTIPLIERTIME / 2).p
game.Debris:AddItem(LIGHTNINGPART, LASTINGTIME)
coroutine.resume(coroutine.create(function()
while LIGHTNINGPART.Transparency ~= 1 do
--local StartTransparency = tra
for i=0, 1, LASTINGTIME do
Swait()
LIGHTNINGPART.Transparency = LIGHTNINGPART.Transparency + (0.1 / LASTINGTIME)
end
end
end))
Swait(LIGHTNINGDELAY / Animation_Speed)
end
end))
end
function MagicBlock(BRICKCOLOR, MATERIAL, CFRAME, ROTATION, OFFSET, X1, Y1, Z1, X2, Y2, Z2, delay)
local EFFECTPART = CreatePart(3, Effects, MATERIAL, 0, 0, BRICKCOLOR, "Effect", VT())
EFFECTPART.Anchored = true
EFFECTPART.CFrame = CFRAME
local EFFECTMESH = CreateMesh("BlockMesh", EFFECTPART, "", "", "", VT(X1 * Player_Size, Y1 * Player_Size, Z1 * Player_Size), OFFSET * Player_Size)
game:GetService("Debris"):AddItem(EFFECTPART, 10)
coroutine.resume(coroutine.create(function(PART, MESH)
for i = 0, 1, delay do
Swait()
PART.CFrame = PART.CFrame * ROTATION
PART.Transparency = i
MESH.Scale = MESH.Scale + VT(X2 * Player_Size, Y2 * Player_Size, Z2 * Player_Size)
end
PART.Parent = nil
end), EFFECTPART, EFFECTMESH)
end
function MagicSphere(BRICKCOLOR, MATERIAL, CFRAME, ROTATION, OFFSET, X1, Y1, Z1, X2, Y2, Z2, delay)
local EFFECTPART = CreatePart(3, Effects, MATERIAL, 0, 0, BRICKCOLOR, "Effect", VT())
EFFECTPART.Anchored = true
EFFECTPART.CFrame = CFRAME
local EFFECTMESH = CreateMesh("SpecialMesh", EFFECTPART, "Sphere", "", "", VT(X1 * Player_Size, Y1 * Player_Size, Z1 * Player_Size), OFFSET * Player_Size)
game:GetService("Debris"):AddItem(EFFECTPART, 10)
coroutine.resume(coroutine.create(function(PART, MESH)
for i = 0, 1, delay do
Swait()
PART.CFrame = PART.CFrame * ROTATION
PART.Transparency = i
MESH.Scale = MESH.Scale + VT(X2 * Player_Size, Y2 * Player_Size, Z2 * Player_Size)
end
PART.Parent = nil
end), EFFECTPART, EFFECTMESH)
end
function MagicCylinder(BRICKCOLOR, MATERIAL, CFRAME, ROTATION, OFFSET, X1, Y1, Z1, X2, Y2, Z2, delay)
local EFFECTPART = CreatePart(3, Effects, MATERIAL, 0, 0, BRICKCOLOR, "Effect", VT())
EFFECTPART.Anchored = true
EFFECTPART.CFrame = CFRAME
local EFFECTMESH = CreateMesh("CylinderMesh", EFFECTPART, "", "", "", VT(X1 * Player_Size, Y1 * Player_Size, Z1 * Player_Size), OFFSET * Player_Size)
game:GetService("Debris"):AddItem(EFFECTPART, 10)
coroutine.resume(coroutine.create(function(PART, MESH)
for i = 0, 1, delay do
Swait()
PART.CFrame = PART.CFrame * ROTATION
PART.Transparency = i
MESH.Scale = MESH.Scale + VT(X2 * Player_Size, Y2 * Player_Size, Z2 * Player_Size)
end
PART.Parent = nil
end), EFFECTPART, EFFECTMESH)
end
function MagicHead(BRICKCOLOR, MATERIAL, CFRAME, ROTATION, OFFSET, X1, Y1, Z1, X2, Y2, Z2, delay)
local EFFECTPART = CreatePart(3, Effects, MATERIAL, 0, 0, BRICKCOLOR, "Effect", VT())
EFFECTPART.Anchored = true
EFFECTPART.CFrame = CFRAME
local EFFECTMESH = CreateMesh("SpecialMesh", EFFECTPART, "Head", "", "", VT(X1 * Player_Size, Y1 * Player_Size, Z1 * Player_Size), OFFSET * Player_Size)
game:GetService("Debris"):AddItem(EFFECTPART, 10)
coroutine.resume(coroutine.create(function(PART, MESH)
for i = 0, 1, delay do
Swait()
PART.CFrame = PART.CFrame * ROTATION
PART.Transparency = i
MESH.Scale = MESH.Scale + VT(X2 * Player_Size, Y2 * Player_Size, Z2 * Player_Size)
end
PART.Parent = nil
end), EFFECTPART, EFFECTMESH)
end
function MagicRing(BRICKCOLOR, MATERIAL, CFRAME, ROTATION, OFFSET, X1, Y1, Z1, X2, Y2, Z2, delay)
local EFFECTPART = CreatePart(3, Effects, MATERIAL, 0, 0, BRICKCOLOR, "Effect", VT())
EFFECTPART.Anchored = true
EFFECTPART.CFrame = CFRAME
local EFFECTMESH = CreateMesh("SpecialMesh", EFFECTPART, "FileMesh", "3270017", "", VT(X1 * Player_Size, Y1 * Player_Size, Z1 * Player_Size), OFFSET * Player_Size)
game:GetService("Debris"):AddItem(EFFECTPART, 10)
coroutine.resume(coroutine.create(function(PART, MESH)
for i = 0, 1, delay do
Swait()
PART.CFrame = PART.CFrame * ROTATION
PART.Transparency = i
MESH.Scale = MESH.Scale + VT(X2 * Player_Size, Y2 * Player_Size, Z2 * Player_Size)
end
PART.Parent = nil
end), EFFECTPART, EFFECTMESH)
end
function MagicWave(BRICKCOLOR, MATERIAL, CFRAME, ROTATION, OFFSET, X1, Y1, Z1, X2, Y2, Z2, delay)
local EFFECTPART = CreatePart(3, Effects, MATERIAL, 0, 0, BRICKCOLOR, "Effect", VT())
EFFECTPART.Anchored = true
EFFECTPART.CFrame = CFRAME
local EFFECTMESH = CreateMesh("SpecialMesh", EFFECTPART, "FileMesh", "20329976", "", VT(X1 * Player_Size, Y1 * Player_Size, Z1 * Player_Size), VT(0, 0, (-0.1 * Z1)) + (OFFSET * Player_Size))
game:GetService("Debris"):AddItem(EFFECTPART, 10)
coroutine.resume(coroutine.create(function(PART, MESH)
for i = 0, 1, delay do
Swait()
PART.CFrame = PART.CFrame * ROTATION
PART.Transparency = i
MESH.Offset = VT(0, 0, (-0.1 * MESH.Scale.Z))
MESH.Scale = MESH.Scale + VT(X2 * Player_Size, Y2 * Player_Size, Z2 * Player_Size)
end
PART.Parent = nil
end), EFFECTPART, EFFECTMESH)
end
function MagicCrystal(BRICKCOLOR, MATERIAL, CFRAME, ROTATION, OFFSET, X1, Y1, Z1, X2, Y2, Z2, delay)
local EFFECTPART = CreatePart(3, Effects, MATERIAL, 0, 0, BRICKCOLOR, "Effect", VT())
EFFECTPART.Anchored = true
EFFECTPART.CFrame = CFRAME
local EFFECTMESH = CreateMesh("SpecialMesh", EFFECTPART, "FileMesh", "9756362", "", VT(X1 * Player_Size, Y1 * Player_Size, Z1 * Player_Size), OFFSET * Player_Size)
game:GetService("Debris"):AddItem(EFFECTPART, 10)
coroutine.resume(coroutine.create(function(PART, MESH)
for i = 0, 1, delay do
Swait()
PART.CFrame = PART.CFrame * ROTATION
PART.Transparency = i
MESH.Scale = MESH.Scale + VT(X2 * Player_Size, Y2 * Player_Size, Z2 * Player_Size)
end
PART.Parent = nil
end), EFFECTPART, EFFECTMESH)
end
function MagicSwirl(BRICKCOLOR, MATERIAL, CFRAME, ROTATION, OFFSET, X1, Y1, Z1, X2, Y2, Z2, delay)
local EFFECTPART = CreatePart(3, Effects, MATERIAL, 0, 0, BRICKCOLOR, "Effect", VT())
EFFECTPART.Anchored = true
EFFECTPART.CFrame = CFRAME
local EFFECTMESH = CreateMesh("SpecialMesh", EFFECTPART, "FileMesh", "1051557", "", VT(X1 * Player_Size, Y1 * Player_Size, Z1 * Player_Size), OFFSET * Player_Size)
game:GetService("Debris"):AddItem(EFFECTPART, 10)
coroutine.resume(coroutine.create(function(PART, MESH)
for i = 0, 1, delay do
Swait()
PART.CFrame = PART.CFrame * ROTATION
PART.Transparency = i
MESH.Scale = MESH.Scale + VT(X2 * Player_Size, Y2 * Player_Size, Z2 * Player_Size)
end
PART.Parent = nil
end), EFFECTPART, EFFECTMESH)
end
function MagicSharpCone(BRICKCOLOR, MATERIAL, CFRAME, ROTATION, OFFSET, X1, Y1, Z1, X2, Y2, Z2, delay)
local EFFECTPART = CreatePart(3, Effects, MATERIAL, 0, 0, BRICKCOLOR, "Effect", VT())
EFFECTPART.Anchored = true
EFFECTPART.CFrame = CFRAME
local EFFECTMESH = CreateMesh("SpecialMesh", EFFECTPART, "FileMesh", "1778999", "", VT(X1 * Player_Size, Y1 * Player_Size, Z1 * Player_Size), OFFSET * Player_Size)
game:GetService("Debris"):AddItem(EFFECTPART, 10)
coroutine.resume(coroutine.create(function(PART, MESH)
for i = 0, 1, delay do
Swait()
PART.CFrame = PART.CFrame * ROTATION
PART.Transparency = i
MESH.Scale = MESH.Scale + VT(X2 * Player_Size, Y2 * Player_Size, Z2 * Player_Size)
end
PART.Parent = nil
end), EFFECTPART, EFFECTMESH)
end
function MagicFlatCone(BRICKCOLOR, MATERIAL, CFRAME, ROTATION, OFFSET, X1, Y1, Z1, X2, Y2, Z2, delay)
local EFFECTPART = CreatePart(3, Effects, MATERIAL, 0, 0, BRICKCOLOR, "Effect", VT())
EFFECTPART.Anchored = true
EFFECTPART.CFrame = CFRAME
local EFFECTMESH = CreateMesh("SpecialMesh", EFFECTPART, "FileMesh", "1033714", "", VT(X1 * Player_Size, Y1 * Player_Size, Z1 * Player_Size), OFFSET * Player_Size)
game:GetService("Debris"):AddItem(EFFECTPART, 10)
coroutine.resume(coroutine.create(function(PART, MESH)
for i = 0, 1, delay do
Swait()
PART.CFrame = PART.CFrame * ROTATION
PART.Transparency = i
MESH.Scale = MESH.Scale + VT(X2 * Player_Size, Y2 * Player_Size, Z2 * Player_Size)
end
PART.Parent = nil
end), EFFECTPART, EFFECTMESH)
end
function MagicSpikedCrown(BRICKCOLOR, MATERIAL, CFRAME, ROTATION, OFFSET, X1, Y1, Z1, X2, Y2, Z2, delay)
local EFFECTPART = CreatePart(3, Effects, MATERIAL, 0, 0, BRICKCOLOR, "Effect", VT())
EFFECTPART.Anchored = true
EFFECTPART.CFrame = CFRAME
local EFFECTMESH = CreateMesh("SpecialMesh", EFFECTPART, "FileMesh", "1323306", "", VT(X1 * Player_Size, Y1 * Player_Size, Z1 * Player_Size), OFFSET * Player_Size)
game:GetService("Debris"):AddItem(EFFECTPART, 10)
coroutine.resume(coroutine.create(function(PART, MESH)
for i = 0, 1, delay do
Swait()
PART.CFrame = PART.CFrame * ROTATION
PART.Transparency = i
MESH.Scale = MESH.Scale + VT(X2 * Player_Size, Y2 * Player_Size, Z2 * Player_Size)
end
PART.Parent = nil
end), EFFECTPART, EFFECTMESH)
end
function MagicFlatCrown(BRICKCOLOR, MATERIAL, CFRAME, ROTATION, OFFSET, X1, Y1, Z1, X2, Y2, Z2, delay)
local EFFECTPART = CreatePart(3, Effects, MATERIAL, 0, 0, BRICKCOLOR, "Effect", VT())
EFFECTPART.Anchored = true
EFFECTPART.CFrame = CFRAME
local EFFECTMESH = CreateMesh("SpecialMesh", EFFECTPART, "FileMesh", "1078075", "", VT(X1 * Player_Size, Y1 * Player_Size, Z1 * Player_Size), OFFSET * Player_Size)
game:GetService("Debris"):AddItem(EFFECTPART, 10)
coroutine.resume(coroutine.create(function(PART, MESH)
for i = 0, 1, delay do
Swait()
PART.CFrame = PART.CFrame * ROTATION
PART.Transparency = i
MESH.Scale = MESH.Scale + VT(X2 * Player_Size, Y2 * Player_Size, Z2 * Player_Size)
end
PART.Parent = nil
end), EFFECTPART, EFFECTMESH)
end
function MagicSkull(BRICKCOLOR, MATERIAL, CFRAME, ROTATION, OFFSET, X1, Y1, Z1, X2, Y2, Z2, delay)
local EFFECTPART = CreatePart(3, Effects, MATERIAL, 0, 0, BRICKCOLOR, "Effect", VT())
EFFECTPART.Anchored = true
EFFECTPART.CFrame = CFRAME
local EFFECTMESH = CreateMesh("SpecialMesh", EFFECTPART, "FileMesh", "4770583", "", VT(X1 * Player_Size, Y1 * Player_Size, Z1 * Player_Size), OFFSET * Player_Size)
game:GetService("Debris"):AddItem(EFFECTPART, 10)
coroutine.resume(coroutine.create(function(PART, MESH)
for i = 0, 1, delay do
Swait()
PART.CFrame = PART.CFrame * ROTATION
PART.Transparency = i
MESH.Scale = MESH.Scale + VT(X2 * Player_Size, Y2 * Player_Size, Z2 * Player_Size)
end
PART.Parent = nil
end), EFFECTPART, EFFECTMESH)
end
function ElectricEffect(BRICKCOLOR, MATERIAL, CFRAME, ROTATION, OFFSET, X, Y, Z, delay)
local EFFECTPART = CreatePart(3, Effects, MATERIAL, 0, 0, BRICKCOLOR, "Effect", VT())
EFFECTPART.Anchored = true
EFFECTPART.CFrame = CFRAME
local EFFECTMESH = CreateMesh("SpecialMesh", EFFECTPART, "FileMesh", "4770583", "", VT(X * Player_Size, Y * Player_Size, Z * Player_Size), OFFSET * Player_Size)
game:GetService("Debris"):AddItem(EFFECTPART, 10)
local XVALUE = MRANDOM()
local YVALUE = MRANDOM()
local ZVALUE = MRANDOM()
coroutine.resume(coroutine.create(function(PART, MESH, THEXVALUE, THEYVALUE, THEZVALUE)
for i = 0, 1, delay do
Swait()
PART.CFrame = PART.CFrame * ROTATION
PART.Transparency = i
THEXVALUE = THEXVALUE - 0.1 * (delay * 10)
THEYVALUE = THEYVALUE - 0.1 * (delay * 10)
THEZVALUE = THEZVALUE - 0.1 * (delay * 10)
MESH.Scale = MESH.Scale + VT(THEXVALUE * Player_Size, THEYVALUE * Player_Size, THEZVALUE * Player_Size)
end
PART.Parent = nil
end), EFFECTPART, EFFECTMESH, XVALUE, YVALUE, ZVALUE)
end
function TrailEffect(BRICKCOLOR, MATERIAL, CURRENTCFRAME, OLDCFRAME, MESHTYPE, REFLECTANCE, SIZE, ROTATION, X, Y, Z, delay)
local MAGNITUDECFRAME = (CURRENTCFRAME.p - OLDCFRAME.p).magnitude
if MAGNITUDECFRAME > (1 / 100) then
local EFFECTPART = CreatePart(3, Effects, MATERIAL, 0, 0, BRICKCOLOR, "Effect", VT(1, MAGNITUDECFRAME, 1))
EFFECTPART.Anchored = true
EFFECTPART.CFrame = CF((CURRENTCFRAME.p + OLDCFRAME.p) / 2, OLDCFRAME.p) * ANGLES(RAD(90), 0, 0)
local THEMESHTYPE = "BlockMesh"
if MESHTYPE == "Cylinder" then
THEMESHTYPE = "CylinderMesh"
end
local EFFECTMESH = CreateMesh(THEMESHTYPE, EFFECTPART, "", "", "", VT(0 + SIZE * Player_Size, 1, 0 + SIZE * Player_Size), VT(0, 0, 0))
game:GetService("Debris"):AddItem(EFFECTPART, 10)
coroutine.resume(coroutine.create(function(PART, MESH)
for i = 0, 1, delay do
Swait()
PART.CFrame = PART.CFrame * ROTATION
PART.Transparency = i
MESH.Scale = MESH.Scale + VT(X * Player_Size, Y * Player_Size, Z * Player_Size)
end