· 7 years ago · Jan 20, 2019, 01:42 PM
1
2--Converted with ttyyuu12345's model to script plugin v4
3function sandbox(var,func)
4 local env = getfenv(func)
5 local newenv = setmetatable({},{
6 __index = function(self,k)
7 if k=="script" then
8 return var
9 else
10 return env[k]
11 end
12 end,
13 })
14 setfenv(func,newenv)
15 return func
16end
17cors = {}
18mas = Instance.new("Model",game:GetService("Lighting"))
19Tool0 = Instance.new("Tool")
20ModuleScript1 = Instance.new("ModuleScript")
21MeshPart2 = Instance.new("MeshPart")
22ModuleScript3 = Instance.new("ModuleScript")
23MeshPart4 = Instance.new("MeshPart")
24MeshPart5 = Instance.new("MeshPart")
25MeshPart6 = Instance.new("MeshPart")
26MeshPart7 = Instance.new("MeshPart")
27MeshPart8 = Instance.new("MeshPart")
28MeshPart9 = Instance.new("MeshPart")
29MeshPart10 = Instance.new("MeshPart")
30Part11 = Instance.new("Part")
31ParticleEmitter12 = Instance.new("ParticleEmitter")
32ParticleEmitter13 = Instance.new("ParticleEmitter")
33PointLight14 = Instance.new("PointLight")
34Part15 = Instance.new("Part")
35Part16 = Instance.new("Part")
36Sound17 = Instance.new("Sound")
37MeshPart18 = Instance.new("MeshPart")
38IntValue19 = Instance.new("IntValue")
39IntValue20 = Instance.new("IntValue")
40Script21 = Instance.new("Script")
41IntValue22 = Instance.new("IntValue")
42Script23 = Instance.new("Script")
43ObjectValue24 = Instance.new("ObjectValue")
44RemoteFunction25 = Instance.new("RemoteFunction")
45RemoteFunction26 = Instance.new("RemoteFunction")
46RemoteFunction27 = Instance.new("RemoteFunction")
47RemoteEvent28 = Instance.new("RemoteEvent")
48RemoteFunction29 = Instance.new("RemoteFunction")
49RemoteFunction30 = Instance.new("RemoteFunction")
50RemoteFunction31 = Instance.new("RemoteFunction")
51LocalScript32 = Instance.new("LocalScript")
52IntValue33 = Instance.new("IntValue")
53RemoteEvent34 = Instance.new("RemoteEvent")
54RemoteEvent35 = Instance.new("RemoteEvent")
55RemoteEvent36 = Instance.new("RemoteEvent")
56RemoteEvent37 = Instance.new("RemoteEvent")
57LocalScript38 = Instance.new("LocalScript")
58IntValue39 = Instance.new("IntValue")
59Folder40 = Instance.new("Folder")
60ModuleScript41 = Instance.new("ModuleScript")
61ModuleScript42 = Instance.new("ModuleScript")
62ScreenGui43 = Instance.new("ScreenGui")
63ImageLabel44 = Instance.new("ImageLabel")
64Script45 = Instance.new("Script")
65Frame46 = Instance.new("Frame")
66Frame47 = Instance.new("Frame")
67TextLabel48 = Instance.new("TextLabel")
68TextLabel49 = Instance.new("TextLabel")
69TextLabel50 = Instance.new("TextLabel")
70TextLabel51 = Instance.new("TextLabel")
71TextLabel52 = Instance.new("TextLabel")
72Frame53 = Instance.new("Frame")
73TextLabel54 = Instance.new("TextLabel")
74TextLabel55 = Instance.new("TextLabel")
75Frame56 = Instance.new("Frame")
76Frame57 = Instance.new("Frame")
77ImageLabel58 = Instance.new("ImageLabel")
78TextLabel59 = Instance.new("TextLabel")
79TextLabel60 = Instance.new("TextLabel")
80Frame61 = Instance.new("Frame")
81ImageLabel62 = Instance.new("ImageLabel")
82TextLabel63 = Instance.new("TextLabel")
83TextLabel64 = Instance.new("TextLabel")
84Frame65 = Instance.new("Frame")
85TextLabel66 = Instance.new("TextLabel")
86Frame67 = Instance.new("Frame")
87Frame68 = Instance.new("Frame")
88Frame69 = Instance.new("Frame")
89Frame70 = Instance.new("Frame")
90Frame71 = Instance.new("Frame")
91Frame72 = Instance.new("Frame")
92Frame73 = Instance.new("Frame")
93Frame74 = Instance.new("Frame")
94Frame75 = Instance.new("Frame")
95Frame76 = Instance.new("Frame")
96Frame77 = Instance.new("Frame")
97Frame78 = Instance.new("Frame")
98Frame79 = Instance.new("Frame")
99Frame80 = Instance.new("Frame")
100Frame81 = Instance.new("Frame")
101Frame82 = Instance.new("Frame")
102Frame83 = Instance.new("Frame")
103Frame84 = Instance.new("Frame")
104Frame85 = Instance.new("Frame")
105Frame86 = Instance.new("Frame")
106Frame87 = Instance.new("Frame")
107Frame88 = Instance.new("Frame")
108Frame89 = Instance.new("Frame")
109Frame90 = Instance.new("Frame")
110Frame91 = Instance.new("Frame")
111Frame92 = Instance.new("Frame")
112TextLabel93 = Instance.new("TextLabel")
113TextLabel94 = Instance.new("TextLabel")
114TextLabel95 = Instance.new("TextLabel")
115Frame96 = Instance.new("Frame")
116TextLabel97 = Instance.new("TextLabel")
117TextLabel98 = Instance.new("TextLabel")
118ImageLabel99 = Instance.new("ImageLabel")
119NumberValue100 = Instance.new("NumberValue")
120Frame101 = Instance.new("Frame")
121ImageLabel102 = Instance.new("ImageLabel")
122TextLabel103 = Instance.new("TextLabel")
123Frame104 = Instance.new("Frame")
124TextLabel105 = Instance.new("TextLabel")
125Frame106 = Instance.new("Frame")
126TextLabel107 = Instance.new("TextLabel")
127Frame108 = Instance.new("Frame")
128TextLabel109 = Instance.new("TextLabel")
129Frame110 = Instance.new("Frame")
130TextLabel111 = Instance.new("TextLabel")
131TextLabel112 = Instance.new("TextLabel")
132ImageLabel113 = Instance.new("ImageLabel")
133Script114 = Instance.new("Script")
134Frame115 = Instance.new("Frame")
135TextLabel116 = Instance.new("TextLabel")
136Frame117 = Instance.new("Frame")
137ImageLabel118 = Instance.new("ImageLabel")
138ImageLabel119 = Instance.new("ImageLabel")
139Frame120 = Instance.new("Frame")
140Frame121 = Instance.new("Frame")
141LocalScript122 = Instance.new("LocalScript")
142Frame123 = Instance.new("Frame")
143Frame124 = Instance.new("Frame")
144ImageLabel125 = Instance.new("ImageLabel")
145ImageLabel126 = Instance.new("ImageLabel")
146TextLabel127 = Instance.new("TextLabel")
147ModuleScript128 = Instance.new("ModuleScript")
148Camera129 = Instance.new("Camera")
149Tool0.Name = "M4A1"
150Tool0.Parent = mas
151ModuleScript1.Name = "PLUGINS"
152ModuleScript1.Parent = Tool0
153table.insert(cors,sandbox(ModuleScript1,function()
154--[[
155
156 Plugins for this gun kit are basically functions that will run at specific times, i.e. When a key is pressed, when the gun is
157 fired, when the gun is aimed, etc.
158
159 HOW TO USE IT:
160
161 KEYDOWN PLUGIN:
162
163 Let's say you wanted to toggle a laser whenever you press the "v" key:
164
165 You would create a table like the example below
166 The first element would be "Key = INSERT_KEY_HERE"
167 The second element would be "Description = INSERT_DESCRIPTION_HERE"
168 The third element would be "Plugin = INSERT_FUNCTION_HERE"
169
170 So whenever you press the "v" key, the plugin function will run
171
172 Pretty useful if you want to add extra code to the script without actually having to modify the script
173
174 NOTE: Only the keydown plugin requires this table. Every other plugin just needs a function
175
176 EVERY OTHER PLUGIN:
177
178 Let's say you wanted to make a shell eject whenever the gun was fired:
179
180 You would add function called "Plugin = INSERT_FUNCTION_HERE"
181
182 That's it; If you want other stuff to happen when the gun is fired, you would either put it all into 1 function, or
183 you would add more Plugins to the "Firing" table. Like so:
184
185 Firing = {
186 Plugin = function()
187 --Code
188 end;
189 Plugin = function()
190 --Code
191 end;
192 Plugin = function()
193 --Code
194 end;
195 };
196
197 That's really it, you just need to know some basic scripting to use it. If you have more questions, pm me.
198
199 NOTE: The plugins run seperate from the code in the Gun_Main. For example, if you have a plugin that ejects a shell 1 second
200 after the gun is fired, the gun's firing speed won't be affected in any way.
201
202--]]
203
204local Gun = script.Parent
205
206local Plugins = {
207
208 KeyDown = {
209 { --This is a plugin for a toggleable laser
210 Key = "v"; --This is the key you press to activate the plugin
211 Description = "Toggle Laser"; --This is what the description of the key will be in the controls
212 Plugin = function() --This is the actual plugin function
213 local Laser = Gun:WaitForChild("Laser") --These few lines wait for the necessary bricks/models
214 local Handle = Gun:WaitForChild("Handle")
215 local ignoreCode = Gun.clientMain:WaitForChild("ignoreCode")
216 local ignoreModel = game.Workspace:WaitForChild("ignoreModel_"..ignoreCode.Value)
217
218 local PlyrName = game.Players:GetPlayerFromCharacter(Gun.Parent).Name
219 local playerFolder = ignoreModel:WaitForChild("gunIgnore_"..PlyrName)
220
221 local RS = game:GetService("RunService")
222
223 local function createLaserDot() --This function creates the red laser dot
224 local laserDot = Instance.new("Part")
225 laserDot.Transparency = 1
226 laserDot.Name = "laserDot"
227 laserDot.Anchored = true
228 laserDot.CanCollide = false
229 laserDot.FormFactor = Enum.FormFactor.Custom
230 laserDot.Size = Vector3.new(0.25, 0.25, 1)
231
232 local laserGui = Instance.new("SurfaceGui")
233 laserGui.CanvasSize = Vector2.new(100, 100)
234 laserGui.Parent = laserDot
235
236 local laserImage = Instance.new("ImageLabel")
237 laserImage.BackgroundTransparency = 1
238 laserImage.Size = UDim2.new(1, 0, 1, 0)
239 laserImage.Image = "http://www.roblox.com/asset/?id=131394739"
240 laserImage.Parent = laserGui
241
242 --[[local laserLight = Instance.new("SurfaceLight")
243 laserLight.Angle = 180
244 laserLight.Brightness = math.huge
245 laserLight.Color = Color3.new(1, 0, 0)
246 laserLight.Face = Enum.NormalId.Back
247 laserLight.Range = 5
248 laserLight.Shadows = true
249 laserLight.Parent = laserDot]]
250
251 return laserDot
252 end
253
254 local function getHitSurfaceCFrame(Pos, Obj) --This function returns the proper cframe based on the face that the position is on
255 local surfaceCF = {
256 {"Back", Obj.CFrame * CFrame.new(0, 0, Obj.Size.z)};
257 {"Bottom", Obj.CFrame * CFrame.new(0, -Obj.Size.y, 0)};
258 {"Front", Obj.CFrame * CFrame.new(0, 0, -Obj.Size.z)};
259 {"Left", Obj.CFrame * CFrame.new(-Obj.Size.x, 0, 0)};
260 {"Right", Obj.CFrame * CFrame.new(Obj.Size.x, 0, 0)};
261 {"Top", Obj.CFrame * CFrame.new(0, Obj.Size.y, 0)}
262 }
263 local closestDist = math.huge
264 local closestSurface = nil
265 for _,v in pairs(surfaceCF) do
266 local surfaceDist = (Pos - v[2].p).magnitude
267 if surfaceDist < closestDist then
268 closestDist = surfaceDist
269 closestSurface = v
270 end
271 end
272
273 local surfaceDir = CFrame.new(Obj.CFrame.p, closestSurface[2].p)
274 local surfaceDist = surfaceDir.lookVector * ((Obj.CFrame.p - closestSurface[2].p).magnitude / 2 - 0.25)
275 local surfaceOffset = Pos - closestSurface[2].p + surfaceDist
276 local surfaceCFrame = surfaceDir + surfaceDist + surfaceOffset
277
278 return surfaceCFrame
279 end
280
281 local laserDot = createLaserDot() --The code is cleaner when the laser creating code is in a function
282
283 Laser.Transparency = (Laser.Transparency == 1 and 0 or 1) --Toggles the laser on or off
284
285 while math.floor(Laser.Transparency) == 0 do --This loop will keep running as long as the laser is visible
286 if (not game.Players:GetPlayerFromCharacter(Gun.Parent)) then break end --This checks if the gun is a child of the character
287
288 local newRay = Ray.new(Laser.Position, Handle.CFrame.lookVector * 999)
289 local H, P = game.Workspace:FindPartOnRay(newRay, ignoreModel)
290
291 local Distance = (P - Laser.Position).magnitude
292 Laser.Mesh.Offset = Vector3.new(0, Distance / 2, 0)
293 Laser.Mesh.Scale = Vector3.new(0.075, Distance / 0.2, 0.075)
294
295 if H then
296 laserDot.CFrame = getHitSurfaceCFrame(P, H) --If the laser hits a part then position the dot on the part
297 laserDot.Parent = playerFolder
298 else
299 laserDot.Parent = nil --If the laser doesn't hit a part then temporarily remove the laser dor
300 end
301
302 RS.RenderStepped:wait()
303 end
304
305 laserDot:Destroy() --These lines reset the laser if the laser is transparent or the gun was deselected
306 Laser.Transparency = 1
307 Laser.Mesh.Offset = Vector3.new()
308 Laser.Mesh.Scale = Vector3.new(0.075, 0, 0.075)
309 end;
310 };
311
312 { --This is a plugin for a toggleable flashlight
313 Key = "z";
314 Description = "Toggle Flashlight";
315 Plugin = function()
316 local Flashlight = Gun:WaitForChild("Flashlight")
317 if Flashlight then
318 for _, Light in pairs(Flashlight:GetChildren()) do
319 if Light.Name == "Light" then
320 Light.Enabled = (not Light.Enabled)
321 end
322 end
323 end
324 end
325 };
326 };
327
328 KeyUp = {
329
330 };
331
332 Firing = {
333 Plugin = function()
334 --Put code here
335 end;
336 };
337
338 Aimed = {
339 Plugin = function()
340 --Put code here
341 end;
342 };
343
344 UnAimed = {
345 Plugin = function()
346 --Put code here
347 end;
348 };
349
350 OnEquipped = {
351 Plugin = function()
352 --Put code here
353 end
354 };
355
356 OnUnEquipped = {
357 Plugin = function()
358 --Put code here
359 end
360 };
361
362}
363
364return Plugins
365end))
366MeshPart2.Parent = Tool0
367MeshPart2.CFrame = CFrame.new(6.56499624, 1.09693801, 0.935074985, 1, 4.04543243e-08, -1.49157131e-10, -4.04543243e-08, 1, -2.84205264e-08, 1.56433089e-10, 2.8420363e-08, 1)
368MeshPart2.Position = Vector3.new(6.56499624, 1.09693801, 0.935074985)
369MeshPart2.Color = Color3.new(0.105882, 0.164706, 0.207843)
370MeshPart2.Size = Vector3.new(2.26677203, 0.279448986, 0.279450893)
371MeshPart2.Anchored = true
372MeshPart2.BrickColor = BrickColor.new("Black")
373MeshPart2.CanCollide = false
374MeshPart2.Material = Enum.Material.Metal
375MeshPart2.brickColor = BrickColor.new("Black")
376ModuleScript3.Name = "SETTINGS"
377ModuleScript3.Parent = Tool0
378table.insert(cors,sandbox(ModuleScript3,function()
379local Settings = {
380
381
382 gunType = {
383 Semi = false;
384 Auto = true;
385 Burst = false;
386 Shot = false;
387 Explosive = false;
388 };
389
390 selectFire = true;
391 selectFireSettings = {
392 Animation = true;
393 GUI = false;
394 Modes = {
395 Safety = true;
396 Semi = false;
397 Burst = true;
398 Auto = true;
399 };
400 animSpeed = 0.5;
401 };
402
403
404 burstSettings = {
405 fireRateBurst = true;
406 Amount = 3;
407 Time = 0.2;
408 Wait = 0.1;
409 };
410
411
412 shotAmount = 5;
413
414
415 explosionSettings = {
416 Radius = 20;
417 Pressure = 5e5;
418 Type = Enum.ExplosionType.NoCraters;
419
420 soundId = "rbxassetid://138499093";
421 soundPitch = 1;
422 soundVolume = 1;
423 rayCastExplosions = false;
424 rangeBasedDamage = true;
425 };
426
427
428 playerArms = true;
429 fakeArmSettings = {
430 Transparency = 0;
431 armSize = Vector3.new(0.6, 2, 0.6);
432 characterMeshes = false;
433 realBodyColor = true;
434 Color = BrickColor.new("Pastel brown");
435 };
436
437
438 unAimedC1 = {
439 leftArm = CFrame.new(-.7, 2, -.65) * CFrame.Angles(math.rad(-10), 0, math.rad(-30));
440 rightArm = CFrame.new(0.4, 0.25, -0.3) * CFrame.Angles(0, 0, math.rad(25));
441 Grip = CFrame.Angles(0, math.rad(25), 0);
442 };
443 aimedC1 = {
444 leftArm = CFrame.new(0, 1.7, -.2) * CFrame.Angles(math.rad(-10), 0, 0) * CFrame.Angles(0, 0, math.rad(-40));
445 rightArm = CFrame.new(0.5, 0.3, 0.1) * CFrame.Angles(0, 0, math.rad(45));
446 };
447 runningC1 = {
448 leftArm = CFrame.new(-0.65, 0.85, -.8) * CFrame.Angles(math.rad(1), math.rad(-8.5), math.rad(16));
449 rightArm = CFrame.new(0.16, 1, -0.14) * CFrame.Angles(math.rad(15), math.rad(2), math.rad(50));
450 Grip = CFrame.Angles(0, math.rad(-5), 0);
451 };
452
453
454 equipAnimation = true;
455 equipSettings = {
456 Time = 0.25;
457 leftArmC1 = CFrame.new(0.2, 1.2, 0) * CFrame.Angles(math.rad(105), math.rad(-30), math.rad(90));
458 rightArmC1 = CFrame.new(-0.5, 0.75, 0) * CFrame.Angles(math.rad(45), 0, math.rad(75));
459 GripC1 = CFrame.new();
460 };
461
462
463 stopAnimsOnFall = true;
464 fallAnimation = true;
465 fallSettings = {
466 maxDist = 35;
467 landMultiplier = 1;
468 fallMultiplier = 1;
469 aimEffect = 0.25;
470 };
471
472
473 gunMomentum = true;
474 momentumSettings = {
475 maxInput = 18;
476 Speed = 20;
477 Damper = 0.5;
478 Amplitude = {
479 unAimed = 5;
480 Aimed = 1;
481 }
482 };
483
484
485 cockingAnim = false;
486 movementAnims = true;
487
488
489 canADS = true;
490 aimSettings = {
491 Anim = true;
492 Speed = 0.3;
493 FOV = 37;
494 holdToADS = true;
495 headTilt = math.rad(25);
496 };
497
498
499 sensitivitySettings = {
500 Default = 1;
501 Aim = 0.3;
502
503 scrollToChange = true;
504 Min = 0.05;
505 Max = 1;
506 Increment = 0.05;
507 };
508
509
510 guiScope = false;
511 scopeSettings = {
512 Frequency = {
513 Idling = 0.7;
514 Walking = 2;
515 };
516 Amplitude = {
517 Idling = 0.75;
518 Walking = 0.75;
519 };
520 steadyTime = 8;
521 breathTime = 5;
522 camSwayOnBreath = 2.5;
523 unSteadyOnFire = true;
524 };
525
526
527 roundsPerMin = 700;
528
529
530 bulletSettings = {
531 instantHit = true;
532 Range = 900;
533 Velocity = 540;
534 Acceleration = 196.2;
535 Color = BrickColor.new("Bright red");
536 Transparency = 0;
537 Size = Vector3.new(0.1, 0.1, 5);
538 };
539
540
541 damageSettings = {
542 Start = {
543 Damage = 32;
544 Dist = 0.08;
545 };
546 End = {
547 Damage = 19;
548 Dist = 0.5;
549 };
550 Multipliers = {
551 Chest = 1;
552 Head = 1.5;
553 Limbs = 1;
554 };
555 };
556
557
558 AllowFriendlyFire = false;
559 CanDamageNPCs = true;
560
561 bulletTrail = false;
562 trailSettings = {
563 Color = BrickColor.new("White");
564 Transparency = 0;
565 Thickness = 0;
566 visibleTime = 0;
567 disappearTime = 0;
568 };
569
570
571 bulletHoles = true;
572 holeSettings = {
573 Texture = "http://www.roblox.com/asset/?id=64291961";
574 Size = 0.5;
575 visibleTime = 3;
576 disappearTime = 1;
577 };
578
579
580 bulletSparks = true;
581 customSparks = false;
582 sparkSettings = {
583 Color = {
584 Start = Color3.new(1, 158 / 255, 24 / 255);
585 End = Color3.new(212 / 255, 242 / 255, 8 / 255);
586 };
587 Size = 0.25;
588 Texture = "http://www.roblox.com/asset/?id=311395391";
589 Lifetime = 0.2;
590 Rate = 75;
591 Speed = 25;
592 Spread = 45;
593 Materials = {
594 Enum.Material.Plastic;
595 Enum.Material.Slate;
596 Enum.Material.Concrete;
597 Enum.Material.CorrodedMetal;
598 Enum.Material.DiamondPlate;
599 Enum.Material.Foil;
600 Enum.Material.Marble;
601 Enum.Material.Granite;
602 Enum.Material.Brick;
603 Enum.Material.Pebble;
604 Enum.Material.SmoothPlastic;
605 Enum.Material.Metal;
606 Enum.Material.Cobblestone;
607 };
608 };
609
610
611 bulletSmoke = false;
612 smokeSettings = {
613 objColor = false;
614 Color = Color3.new(0.5, 0.5, 0.5);
615 Size = {
616 Start = 0.25;
617 End = 0.5;
618 };
619 Texture = "http://www.roblox.com/asset/?id=244514423";
620 startTransparency = 0;
621 Lifetime = 0.2;
622 Rate = 100;
623 Speed = 35;
624 Spread = 15;
625 };
626
627
628 bloodEffect = true;
629 bloodSettings = {
630 Color = Color3.new(1, 0, 0);
631 Size = 0.1;
632 Texture = "http://www.roblox.com/asset/?id=3419963";
633 startTransparency = 0.125;
634 Lifetime = 0.1;
635 Rate = 200;
636 Speed = 50;
637 Spread = 15;
638 };
639
640
641 bulletShockwave = false;
642 shockwaveSettings = {
643 Radius = 0.3;
644 Color = BrickColor.new("Light stone grey");
645 Duration = 0.2;
646 };
647
648
649 penetrationSettings = {
650 Dist = 0;
651 transparencyThreshold = 1;
652 ignoreNonCanCollide = true;
653 ignoreCustom = {};
654 };
655
656
657 recoilSettings = {
658 firstShotMultiplier = 2.4;
659 aimedMultiplier = 0.5;
660 camMultiplier = 2;
661 springSpeed = 15;
662 springDamper = 0.5;
663 Recoil = {
664 Side = {
665 Left = -0.17;
666 Right = 0.28;
667 };
668 Up = {
669 Min = 0.26;
670 Max = 0.28;
671 };
672 Back = {
673 Min = 0.3;
674 Max = 0.35;
675 };
676 Tilt = {
677 Left = -0.5;
678 Right = 0.5;
679 };
680 }
681 };
682
683
684 spreadSettings = {
685 Increase = 0.1;
686 Decrease = 15;
687
688 Aimed = {
689 Stand = {
690 Idling = 0.2;
691 Moving = 0.4;
692 };
693 Crouch = {
694 Idling = 0.15;
695 Moving = 0.3;
696 };
697 Prone = {
698 Idling = 0.1;
699 Moving = 0.3;
700 };
701 };
702 unAimed = {
703 Stand = {
704 Idling = 2;
705 Moving = 2.5;
706 };
707 Crouch = {
708 Idling = 1.5;
709 Moving = 2;
710 };
711 Prone = {
712 Idling = 1;
713 Moving = 2;
714 };
715 };
716 };
717
718
719 reloadSettings = {
720 Anim = true;
721 Times = {
722 Loaded = 1.85;
723 Empty = 2.4;
724 };
725 autoReload = true;
726 magIsBullet = false;
727 reloadWhileRunning = true;
728 };
729
730
731 sprintTime = 15;
732 staminaCoolTime = 4;
733 canFireWhileRunning = false;
734
735
736 dolphinDive = true;
737 diveSettings = {
738 rechargeTime = 1;
739 Force = 350;
740 Angle = math.rad(30);
741 };
742
743
744 canChangeStance = true;
745 stanceSettings = {
746 Anim = true;
747 Speed = 0.3;
748 Stances = {
749 Crouch = true;
750 Prone = true;
751 };
752 standOnDeselect = true;
753 crawlAnimation = true;
754 };
755
756
757 walkSpeeds = {
758 Base = 16;
759 Sprinting = 25;
760 Aimed = 10;
761 Crouched = 7;
762 Prone = 4;
763 };
764
765
766 --NOTE: For extra keys, go here: http://wiki.roblox.com/index.php?title=Taking_keyboard_input
767 Keys = {
768 lowerStance = "c";
769 raiseStance = "x";
770 selectFire = "f";
771 Reload = "r";
772 Sprint = string.char(48);
773 ADS = "q";
774 scopeSteady = string.char(48);
775 };
776
777
778}
779
780return Settings
781end))
782MeshPart4.Parent = Tool0
783MeshPart4.CFrame = CFrame.new(6.16998434, 1.21694791, 0.935067952, 1, 4.04543243e-08, -1.49157131e-10, -4.04543243e-08, 1, -2.84205264e-08, 1.56433089e-10, 2.8420363e-08, 1)
784MeshPart4.Position = Vector3.new(6.16998434, 1.21694791, 0.935067952)
785MeshPart4.Color = Color3.new(0.105882, 0.164706, 0.207843)
786MeshPart4.Size = Vector3.new(1.30815697, 0.561810076, 0.29028371)
787MeshPart4.Anchored = true
788MeshPart4.BrickColor = BrickColor.new("Black")
789MeshPart4.CanCollide = false
790MeshPart4.Material = Enum.Material.Metal
791MeshPart4.brickColor = BrickColor.new("Black")
792MeshPart5.Parent = Tool0
793MeshPart5.CFrame = CFrame.new(4.8879652, 0.898954034, 0.980058074, 1, 4.04543243e-08, -1.49157131e-10, -4.04543243e-08, 1, -2.84205264e-08, 1.56433089e-10, 2.8420363e-08, 1)
794MeshPart5.Position = Vector3.new(4.8879652, 0.898954034, 0.980058074)
795MeshPart5.Color = Color3.new(0.388235, 0.372549, 0.384314)
796MeshPart5.Size = Vector3.new(1.101982, 0.47428602, 0.289528012)
797MeshPart5.Anchored = true
798MeshPart5.BrickColor = BrickColor.new("Dark stone grey")
799MeshPart5.CanCollide = false
800MeshPart5.Material = Enum.Material.Metal
801MeshPart5.brickColor = BrickColor.new("Dark stone grey")
802MeshPart6.Name = "Bolt"
803MeshPart6.Parent = Tool0
804MeshPart6.CFrame = CFrame.new(4.85193777, 1.14394701, 0.935067952, 1, 4.04543243e-08, -1.49157131e-10, -4.04543243e-08, 1, -2.84205264e-08, 1.56433089e-10, 2.8420363e-08, 1)
805MeshPart6.Position = Vector3.new(4.85193777, 1.14394701, 0.935067952)
806MeshPart6.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
807MeshPart6.Size = Vector3.new(1.01121294, 0.223500013, 0.286198199)
808MeshPart6.Anchored = true
809MeshPart6.BrickColor = BrickColor.new("Really black")
810MeshPart6.CanCollide = false
811MeshPart6.Material = Enum.Material.Metal
812MeshPart6.brickColor = BrickColor.new("Really black")
813MeshPart7.Parent = Tool0
814MeshPart7.CFrame = CFrame.new(4.45891905, 0.930935025, 0.970040977, 1, 4.04543243e-08, -1.49157131e-10, -4.04543243e-08, 1, -2.84205264e-08, 1.56433089e-10, 2.8420363e-08, 1)
815MeshPart7.Position = Vector3.new(4.45891905, 0.930935025, 0.970040977)
816MeshPart7.Color = Color3.new(0.105882, 0.164706, 0.207843)
817MeshPart7.Size = Vector3.new(1.9507581, 0.653867006, 0.284515619)
818MeshPart7.Anchored = true
819MeshPart7.BrickColor = BrickColor.new("Black")
820MeshPart7.CanCollide = false
821MeshPart7.Material = Enum.Material.Metal
822MeshPart7.brickColor = BrickColor.new("Black")
823MeshPart8.Parent = Tool0
824MeshPart8.CFrame = CFrame.new(3.8039341, 0.732930958, 0.935075045, 1, 4.04543243e-08, -1.49157131e-10, -4.04543243e-08, 1, -2.84205264e-08, 1.56433089e-10, 2.8420363e-08, 1)
825MeshPart8.Position = Vector3.new(3.8039341, 0.732930958, 0.935075045)
826MeshPart8.Color = Color3.new(0.105882, 0.164706, 0.207843)
827MeshPart8.Size = Vector3.new(1.79014492, 0.974909961, 0.196797371)
828MeshPart8.Anchored = true
829MeshPart8.BrickColor = BrickColor.new("Black")
830MeshPart8.CanCollide = false
831MeshPart8.Material = Enum.Material.Metal
832MeshPart8.brickColor = BrickColor.new("Black")
833MeshPart9.Name = "Mag"
834MeshPart9.Parent = Tool0
835MeshPart9.CFrame = CFrame.new(5.22893667, 0.522478998, 0.935067952, 1.56433089e-10, 3.04717105e-08, 1, 4.3260421e-08, 1, -3.04717105e-08, -1, 4.32602576e-08, 1.63709046e-10)
836MeshPart9.Orientation = Vector3.new(0, 90, 0)
837MeshPart9.Position = Vector3.new(5.22893667, 0.522478998, 0.935067952)
838MeshPart9.Rotation = Vector3.new(0, 90, 0)
839MeshPart9.Color = Color3.new(0.105882, 0.164706, 0.207843)
840MeshPart9.Size = Vector3.new(0.124257803, 1.02490282, 0.470745921)
841MeshPart9.Anchored = true
842MeshPart9.BrickColor = BrickColor.new("Black")
843MeshPart9.CanCollide = false
844MeshPart9.Material = Enum.Material.Metal
845MeshPart9.brickColor = BrickColor.new("Black")
846MeshPart10.Name = "BoltBack"
847MeshPart10.Parent = Tool0
848MeshPart10.CFrame = CFrame.new(4.52193213, 1.14394701, 0.935067952, 1, 4.04543243e-08, -1.49157131e-10, -4.04543243e-08, 1, -2.84205264e-08, 1.56433089e-10, 2.8420363e-08, 1)
849MeshPart10.Position = Vector3.new(4.52193213, 1.14394701, 0.935067952)
850MeshPart10.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
851MeshPart10.Size = Vector3.new(1.01121294, 0.223500013, 0.286198199)
852MeshPart10.Anchored = true
853MeshPart10.BrickColor = BrickColor.new("Really black")
854MeshPart10.CanCollide = false
855MeshPart10.Material = Enum.Material.Metal
856MeshPart10.brickColor = BrickColor.new("Really black")
857Part11.Name = "Main"
858Part11.Parent = Tool0
859Part11.CFrame = CFrame.new(7.59501839, 1.10390711, 0.935075045, -3.2663851e-05, 0.00012950704, -1, -4.04799252e-08, 1, 0.00012950704, 1, 4.47099566e-08, -3.26638474e-05)
860Part11.Orientation = Vector3.new(-0.00999999978, -90, 0)
861Part11.Position = Vector3.new(7.59501839, 1.10390711, 0.935075045)
862Part11.Rotation = Vector3.new(0, -90, 0)
863Part11.Color = Color3.new(1, 1, 0)
864Part11.Transparency = 1
865Part11.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
866Part11.Anchored = true
867Part11.BottomSurface = Enum.SurfaceType.Smooth
868Part11.BrickColor = BrickColor.new("New Yeller")
869Part11.CanCollide = false
870Part11.Material = Enum.Material.Metal
871Part11.TopSurface = Enum.SurfaceType.Smooth
872Part11.brickColor = BrickColor.new("New Yeller")
873Part11.FormFactor = Enum.FormFactor.Custom
874Part11.formFactor = Enum.FormFactor.Custom
875ParticleEmitter12.Name = "1FlashFX[Smoke]"
876ParticleEmitter12.Parent = Part11
877ParticleEmitter12.Speed = NumberRange.new(5, 7)
878ParticleEmitter12.Rotation = NumberRange.new(0, 360)
879ParticleEmitter12.Color = ColorSequence.new(Color3.new(0.27451, 0.27451, 0.27451),Color3.new(0.27451, 0.27451, 0.27451))
880ParticleEmitter12.Enabled = false
881ParticleEmitter12.LightEmission = 0.10000000149012
882ParticleEmitter12.Texture = "http://www.roblox.com/asset/?id=244514423"
883ParticleEmitter12.Transparency = NumberSequence.new(0.60000002384186,1)
884ParticleEmitter12.Size = NumberSequence.new(0.99999964237213,3)
885ParticleEmitter12.Lifetime = NumberRange.new(1.25, 1.5)
886ParticleEmitter12.Rate = 100
887ParticleEmitter12.RotSpeed = NumberRange.new(10, 10)
888ParticleEmitter12.SpreadAngle = Vector2.new(15, 15)
889ParticleEmitter12.VelocitySpread = 15
890ParticleEmitter13.Name = "FlashFX[Flash]"
891ParticleEmitter13.Parent = Part11
892ParticleEmitter13.Speed = NumberRange.new(10, 10)
893ParticleEmitter13.Rotation = NumberRange.new(0, 90)
894ParticleEmitter13.Color = ColorSequence.new(Color3.new(1, 1, 0.498039),Color3.new(1, 1, 0.498039))
895ParticleEmitter13.Enabled = false
896ParticleEmitter13.LightEmission = 1
897ParticleEmitter13.Texture = "http://www.roblox.com/asset/?id=562251151"
898ParticleEmitter13.Transparency = NumberSequence.new(0.75,1)
899ParticleEmitter13.Size = NumberSequence.new(0.20000000298023,0.20000000298023)
900ParticleEmitter13.Lifetime = NumberRange.new(0.050000000745058, 0.075000002980232)
901ParticleEmitter13.Rate = 1000
902PointLight14.Name = "FlashFX[Light]"
903PointLight14.Parent = Part11
904PointLight14.Color = Color3.new(1, 1, 0.498039)
905PointLight14.Enabled = false
906PointLight14.Range = 6
907PointLight14.Brightness = 10
908PointLight14.Shadows = true
909Part15.Name = "AimPart"
910Part15.Parent = Tool0
911Part15.CFrame = CFrame.new(3.70499611, 1.46302772, 0.935075045, -3.26638474e-05, 4.31893277e-05, -1, -4.23425384e-08, 1, 4.31893277e-05, 1, 4.37531043e-08, -3.26638474e-05)
912Part15.Orientation = Vector3.new(0, -90, 0)
913Part15.Position = Vector3.new(3.70499611, 1.46302772, 0.935075045)
914Part15.Rotation = Vector3.new(0, -90, 0)
915Part15.Color = Color3.new(1, 1, 0)
916Part15.Transparency = 1
917Part15.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
918Part15.Anchored = true
919Part15.BottomSurface = Enum.SurfaceType.Smooth
920Part15.BrickColor = BrickColor.new("New Yeller")
921Part15.CanCollide = false
922Part15.Material = Enum.Material.Metal
923Part15.TopSurface = Enum.SurfaceType.Smooth
924Part15.brickColor = BrickColor.new("New Yeller")
925Part15.FormFactor = Enum.FormFactor.Custom
926Part15.formFactor = Enum.FormFactor.Custom
927Part16.Name = "Handle"
928Part16.Parent = Tool0
929Part16.CFrame = CFrame.new(4.90791893, 0.535517097, 0.935075045, -3.26638474e-05, 4.31893277e-05, -1, -4.23425384e-08, 1, 4.31893277e-05, 1, 4.37531043e-08, -3.26638474e-05)
930Part16.Orientation = Vector3.new(0, -90, 0)
931Part16.Position = Vector3.new(4.90791893, 0.535517097, 0.935075045)
932Part16.Rotation = Vector3.new(0, -90, 0)
933Part16.Color = Color3.new(1, 1, 0)
934Part16.Transparency = 1
935Part16.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
936Part16.Anchored = true
937Part16.BottomSurface = Enum.SurfaceType.Smooth
938Part16.BrickColor = BrickColor.new("New Yeller")
939Part16.CanCollide = false
940Part16.Material = Enum.Material.Metal
941Part16.TopSurface = Enum.SurfaceType.Smooth
942Part16.brickColor = BrickColor.new("New Yeller")
943Part16.FormFactor = Enum.FormFactor.Custom
944Part16.formFactor = Enum.FormFactor.Custom
945Sound17.Name = "FireSound"
946Sound17.Parent = Part16
947Sound17.SoundId = "rbxassetid://132373615"
948MeshPart18.Name = "Iron"
949MeshPart18.Parent = Tool0
950MeshPart18.CFrame = CFrame.new(4.9137845, 1.36004686, 0.950563014, 1.56433089e-10, 3.04717105e-08, 1, 4.3260421e-08, 1, -3.04717105e-08, -1, 4.32602576e-08, 1.63709046e-10)
951MeshPart18.Orientation = Vector3.new(0, 90, 0)
952MeshPart18.Position = Vector3.new(4.9137845, 1.36004686, 0.950563014)
953MeshPart18.Rotation = Vector3.new(0, 90, 0)
954MeshPart18.Color = Color3.new(0.105882, 0.164706, 0.207843)
955MeshPart18.Size = Vector3.new(0.186145991, 0.288760066, 1.04480171)
956MeshPart18.Anchored = true
957MeshPart18.BrickColor = BrickColor.new("Black")
958MeshPart18.CanCollide = false
959MeshPart18.Material = Enum.Material.Metal
960MeshPart18.brickColor = BrickColor.new("Black")
961IntValue19.Name = "Ammo"
962IntValue19.Parent = Tool0
963IntValue19.Value = 31
964IntValue20.Name = "ClipSize"
965IntValue20.Parent = Tool0
966IntValue20.Value = 30
967Script21.Name = "Credits"
968Script21.Parent = Tool0
969table.insert(cors,sandbox(Script21,function()
970--[[
971 ______ ______ __ ______ _ ______
972 / _/ _/ /_ __/_ _______/ /_ ____ / ____/_ _______(_)___ ____ / / /
973 / // / / / / / / / ___/ __ \/ __ \/ /_ / / / / ___/ / __ \/ __ \ / // /
974 / // / / / / /_/ / / / /_/ / /_/ / __/ / /_/ (__ ) / /_/ / / / / / // /
975 / // / /_/ \__,_/_/ /_.___/\____/_/ \__,_/____/_/\____/_/ /_/ _/ // /
976 /__/__/ /__/__/
977
978--]]
979end))
980IntValue22.Name = "StoredAmmo"
981IntValue22.Parent = Tool0
982IntValue22.Value = 372
983Script23.Name = "serverMain"
984Script23.Parent = Tool0
985table.insert(cors,sandbox(Script23,function()
986local Plyr = script:WaitForChild("Plyr")
987
988local Gun = script.Parent
989local Handle = Gun:WaitForChild("Handle")
990
991local V3 = Vector3.new
992local CF, CFANG = CFrame.new, CFrame.Angles
993
994local RAD = math.rad
995
996local numLerp = function(A, B, Alpha)
997 return A + (B - A) * Alpha
998end
999
1000local inList = function(Element, List)
1001 for _, v in pairs(List) do
1002 if v == Element then
1003 return true
1004 end
1005 end
1006 return false
1007end
1008
1009local getObject = function(Model, Class, Name)
1010 for _, v in pairs(Model:GetChildren()) do
1011 if v:IsA(Class) and v.Name == Name then
1012 return v
1013 end
1014 end
1015 return nil
1016end
1017
1018----------------------------------------------------------------------
1019--------------------[ IGNORE MODEL HANDLING ]-------------------------
1020----------------------------------------------------------------------
1021
1022wait(math.random(0, 20) / 40) --This is to prevent more than one ignoreModel from being created
1023
1024if _G.ignoreCode then --If the ignoreCode already exists, then the script creates the ignoreModel
1025 --[[
1026 The purpose of this is so that every gun in a game that uses this gun kit will share one ignoreModel. That way,
1027 bullet trails, bullet holes, and other fake arms will be ignored by the gun which makes the bullets more likely to
1028 hit a character part
1029 --]]
1030 if (not game.Workspace:FindFirstChild("ignoreModel_".._G.ignoreCode)) then
1031 local ignoreModel = Instance.new("Model")
1032 ignoreModel.Name = "ignoreModel_".._G.ignoreCode
1033 ignoreModel.Parent = game.Workspace
1034
1035 local grenadeFolder = Instance.new("Model")
1036 grenadeFolder.Name = "grenadeFolder"
1037 grenadeFolder.Parent = ignoreModel
1038
1039 spawn(function()
1040 while true do
1041 ignoreModel.Parent = game.Workspace
1042 grenadeFolder.Parent = ignoreModel
1043 wait(1 / 20)
1044 end
1045 end)
1046 end
1047
1048 script.Parent:WaitForChild("clientMain"):WaitForChild("ignoreCode").Value = _G.ignoreCode
1049else
1050 --[[
1051 If there isn't already an ignoreCode, then this creates one. The purpose of it being random is so that if there is
1052 an ignoreModel for something else in the game, the script won't end up placing the ignored objects in that ignoreModel
1053 --]]
1054 _G.ignoreCode = math.random(1, 1e4)
1055
1056 if (not game.Workspace:FindFirstChild("ignoreModel_".._G.ignoreCode)) then
1057 local ignoreModel = Instance.new("Model")
1058 ignoreModel.Name = "ignoreModel_".._G.ignoreCode
1059 ignoreModel.Parent = game.Workspace
1060
1061 local grenadeFolder = Instance.new("Model")
1062 grenadeFolder.Name = "grenadeFolder"
1063 grenadeFolder.Parent = ignoreModel
1064
1065 spawn(function()
1066 while true do
1067 ignoreModel.Parent = game.Workspace
1068 grenadeFolder.Parent = ignoreModel
1069 wait(1 / 20)
1070 end
1071 end)
1072 end
1073
1074 script.Parent:WaitForChild("clientMain"):WaitForChild("ignoreCode").Value = _G.ignoreCode
1075end
1076
1077spawn(function()
1078 --[[
1079 This function deletes any Player Folders that were left in the ignoreModel because the player left the game without
1080 deselecting the Gun first
1081 --]]
1082 repeat wait() until _G.ignoreCode
1083 local ignoreModel = game.Workspace:WaitForChild("ignoreModel_".._G.ignoreCode)
1084 while true do
1085 for _, gunIgnore in pairs(ignoreModel:GetChildren()) do
1086 if gunIgnore.Name ~= "grenadeFolder" then
1087 if (not game.Players:FindFirstChild(gunIgnore.Name:sub(11))) then
1088 gunIgnore:Destroy()
1089 end
1090 end
1091 end
1092 wait(1 / 20)
1093 end
1094end)
1095
1096----------------------------------------------------------------------
1097--------------------[ RESET CAMERA ]----------------------------------
1098----------------------------------------------------------------------
1099
1100Gun.ChildRemoved:connect(function(Child)
1101 if Child == Handle and Plyr.Value then
1102 local ignoreCode = Gun:WaitForChild("clientMain"):WaitForChild("ignoreCode").Value
1103 local resetCam = script:WaitForChild("resetCam")
1104 resetCam:WaitForChild("ignoreCode").Value = ignoreCode
1105 resetCam.Parent = Plyr.Value.PlayerGui
1106 end
1107end)
1108
1109----------------------------------------------------------------------
1110--------------------[ GET WELD CFRAMES ]------------------------------
1111----------------------------------------------------------------------
1112
1113for _, v in pairs(Gun:GetChildren()) do
1114 if v:IsA("BasePart") and v ~= Handle then
1115 if v:FindFirstChild("mainWeld") then v.mainWeld:Destroy() end
1116 if (not v:FindFirstChild("weldCF")) then
1117 local weldCF = Instance.new("CFrameValue")
1118 weldCF.Name = "weldCF"
1119 weldCF.Value = Handle.CFrame:toObjectSpace(v.CFrame)
1120 weldCF.Parent = v
1121 end
1122 if string.sub(v.Name, 1, 3) == "Mag" then
1123 if (not v:FindFirstChild("magTrans")) then
1124 local magTrans = Instance.new("NumberValue")
1125 magTrans.Name = "magTrans"
1126 magTrans.Value = v.Transparency
1127 magTrans.Parent = v
1128 end
1129 end
1130 v.Anchored = true
1131 v.CanCollide = false
1132 end
1133end
1134Handle.Anchored = false
1135Handle.CanCollide = true
1136
1137----------------------------------------------------------------------
1138--------------------[ GUNSETUP HANDLING ]-----------------------------
1139----------------------------------------------------------------------
1140
1141local gunSetup = script:WaitForChild("gunSetup")
1142function gunSetup.OnServerInvoke(Player, Vars)
1143
1144 --------------------[ CREATING IGNORE MODELS ]--------------------------------
1145
1146 local gunIgnore = Instance.new("Model")
1147 gunIgnore.Name = "gunIgnore_"..Player.Name
1148 gunIgnore.Parent = Vars.ignoreModel
1149
1150 --------------------[ MODIFYING THE PLAYER ]----------------------------------
1151
1152 Vars.Humanoid.AutoRotate = false
1153
1154 Vars.Shoulders.Right.Part1 = nil
1155 Vars.Shoulders.Left.Part1 = nil
1156
1157 local playerFolder = Instance.new("Model")
1158 playerFolder.Name = "playerFolder"
1159 playerFolder.Parent = gunIgnore
1160
1161 local headBase = Instance.new("Part")
1162 headBase.Transparency = 1
1163 headBase.Name = "headBase"
1164 headBase.CanCollide = false
1165 headBase.FormFactor = Enum.FormFactor.Custom
1166 headBase.Size = V3(0.2, 0.2, 0.2)
1167 headBase.BottomSurface = Enum.SurfaceType.Smooth
1168 headBase.TopSurface = Enum.SurfaceType.Smooth
1169 headBase.Parent = playerFolder
1170
1171 local headWeld = Instance.new("Weld")
1172 headWeld.Part0 = Vars.Torso
1173 headWeld.Part1 = headBase
1174 headWeld.C0 = CF(0, 1.5, 0)
1175 headWeld.Parent = Vars.Torso
1176
1177 local headWeld2 = Instance.new("Weld")
1178 headWeld2.Part0 = headBase
1179 headWeld2.Part1 = Vars.Head
1180 headWeld2.Parent = headBase
1181
1182 local animBase = Instance.new("Part")
1183 animBase.Transparency = 1
1184 animBase.Name = "animBase"
1185 animBase.CanCollide = false
1186 animBase.FormFactor = Enum.FormFactor.Custom
1187 animBase.Size = V3(0.2, 0.2, 0.2)
1188 animBase.BottomSurface = Enum.SurfaceType.Smooth
1189 animBase.TopSurface = Enum.SurfaceType.Smooth
1190 animBase.Parent = playerFolder
1191
1192 local animWeld = Instance.new("Weld")
1193 animWeld.Part0 = animBase
1194 animWeld.Part1 = headBase
1195 animWeld.Parent = animBase
1196
1197 local armBase = Instance.new("Part")
1198 armBase.Transparency = 1
1199 armBase.Name = "ArmBase"
1200 armBase.CanCollide = false
1201 armBase.FormFactor = Enum.FormFactor.Custom
1202 armBase.Size = V3(0.2, 0.2, 0.2)
1203 armBase.BottomSurface = Enum.SurfaceType.Smooth
1204 armBase.TopSurface = Enum.SurfaceType.Smooth
1205 armBase.Parent = playerFolder
1206
1207 local ABWeld = Instance.new("Weld")
1208 ABWeld.Part0 = armBase
1209 ABWeld.Part1 = animBase
1210 ABWeld.Parent = armBase
1211
1212 local LArmBase = Instance.new("Part")
1213 LArmBase.Transparency = 1
1214 LArmBase.Name = "LArmBase"
1215 LArmBase.CanCollide = false
1216 LArmBase.FormFactor = Enum.FormFactor.Custom
1217 LArmBase.Size = V3(0.2, 0.2, 0.2)
1218 LArmBase.BottomSurface = Enum.SurfaceType.Smooth
1219 LArmBase.TopSurface = Enum.SurfaceType.Smooth
1220 LArmBase.Parent = playerFolder
1221
1222 local RArmBase = Instance.new("Part")
1223 RArmBase.Transparency = 1
1224 RArmBase.Name = "RArmBase"
1225 RArmBase.CanCollide = false
1226 RArmBase.FormFactor = Enum.FormFactor.Custom
1227 RArmBase.Size = V3(0.2, 0.2, 0.2)
1228 RArmBase.BottomSurface = Enum.SurfaceType.Smooth
1229 RArmBase.TopSurface = Enum.SurfaceType.Smooth
1230 RArmBase.Parent = playerFolder
1231
1232 local LWeld = Instance.new("Weld")
1233 LWeld.Name = "LWeld"
1234 LWeld.Part0 = armBase
1235 LWeld.Part1 = LArmBase
1236 LWeld.C0 = Vars.armC0[1]
1237 LWeld.C1 = Vars.leftArmC1
1238 LWeld.Parent = armBase
1239
1240 local RWeld = Instance.new("Weld")
1241 RWeld.Name = "RWeld"
1242 RWeld.Part0 = armBase
1243 RWeld.Part1 = RArmBase
1244 RWeld.C0 = Vars.armC0[2]
1245 RWeld.C1 = Vars.rightArmC1
1246 RWeld.Parent = armBase
1247
1248 local LWeld2 = Instance.new("Weld")
1249 LWeld2.Name = "LWeld"
1250 LWeld2.Part0 = LArmBase
1251 LWeld2.Part1 = Vars.LArm
1252 LWeld2.Parent = LArmBase
1253
1254 local RWeld2 = Instance.new("Weld")
1255 RWeld2.Name = "RWeld"
1256 RWeld2.Part0 = RArmBase
1257 RWeld2.Part1 = Vars.RArm
1258 RWeld2.Parent = RArmBase
1259
1260 local LLegWeld = Instance.new("Weld")
1261 LLegWeld.Name = "LLegWeld"
1262 LLegWeld.Part0 = Vars.Torso
1263 LLegWeld.Part1 = nil
1264 LLegWeld.C0 = CF(-0.5, -2, 0)
1265 LLegWeld.Parent = Vars.Torso
1266
1267 local RLegWeld = Instance.new("Weld")
1268 RLegWeld.Name = "RLegWeld"
1269 RLegWeld.Part0 = Vars.Torso
1270 RLegWeld.Part1 = nil
1271 RLegWeld.C0 = CF(0.5, -2, 0)
1272 RLegWeld.Parent = Vars.Torso
1273
1274 for _, Tab in pairs(Vars.gunParts) do
1275 Tab.Obj.Anchored = false
1276 local Weld = Instance.new("Weld")
1277 Weld.Name = "mainWeld"
1278 Weld.Part0 = Vars.Handle
1279 Weld.Part1 = Tab.Obj
1280 Weld.C0 = Tab.Obj.weldCF.Value
1281 Weld.Parent = Vars.Handle
1282 Tab.Weld = Weld
1283 end
1284
1285 return gunIgnore, playerFolder, headWeld, headWeld2, animWeld, ABWeld, LWeld, RWeld, LWeld2, RWeld2, LLegWeld, RLegWeld, Vars.gunParts
1286end
1287
1288----------------------------------------------------------------------
1289--------------------[ TWEENJOINT HANDLING ]---------------------------
1290----------------------------------------------------------------------
1291
1292local createTweenIndicator = script:WaitForChild("createTweenIndicator")
1293function createTweenIndicator.OnServerInvoke(_, Joint, newCode)
1294 local tweenIndicator = nil
1295 if (not Joint:findFirstChild("tweenCode")) then --If the joint isn't being tweened, then
1296 tweenIndicator = Instance.new("IntValue")
1297 tweenIndicator.Name = "tweenCode"
1298 tweenIndicator.Value = newCode
1299 tweenIndicator.Parent = Joint
1300 else
1301 tweenIndicator = Joint.tweenCode
1302 tweenIndicator.Value = newCode --If the joint is already being tweened, this will change the code, and the tween loop will stop
1303 end
1304 return tweenIndicator
1305end
1306
1307local lerpCF = script:WaitForChild("lerpCF")
1308function lerpCF.OnServerInvoke(_, Joint, Prop, startCF, endCF, Alpha)
1309 spawn(function()
1310 Joint[Prop] = startCF:lerp(endCF, Alpha)
1311 end)
1312end
1313
1314local deleteTweenIndicator = script:WaitForChild("deleteTweenIndicator")
1315function deleteTweenIndicator.OnServerInvoke(_, tweenIndicator, newCode)
1316 if tweenIndicator.Value == newCode then --If this tween functions was the last one called on a joint then it will remove the code
1317 tweenIndicator:Destroy()
1318 end
1319end
1320
1321----------------------------------------------------------------------
1322--------------------[ BULLET IMPACT HANDLING ]------------------------
1323----------------------------------------------------------------------
1324
1325local createBulletImpact = script:WaitForChild("createBulletImpact")
1326createBulletImpact.OnServerEvent:connect(function(_, H, P, N, D, humanoidFound, gunIgnore, S)
1327 local surfaceCF = CF(P, P + N)
1328 ----------------------------------------------------------------------------------
1329 --Creating the bullet hole--------------------------------------------------------
1330 ----------------------------------------------------------------------------------
1331 if S.bulletHoles and (not humanoidFound) then
1332 local Hole = Instance.new("Part")
1333 Hole.Transparency = 1
1334 Hole.Anchored = true
1335 Hole.CanCollide = false
1336 Hole.FormFactor = "Custom"
1337 Hole.Size = V3(1, 1, 0.2)
1338 Hole.TopSurface = 0
1339 Hole.BottomSurface = 0
1340 local Mesh = Instance.new("BlockMesh")
1341 Mesh.Offset = V3(0, 0, -0.05)
1342 Mesh.Scale = V3(S.holeSettings.Size, S.holeSettings.Size, 0)
1343 Mesh.Parent = Hole
1344 local Decal = Instance.new("Decal")
1345 Decal.Face = Enum.NormalId.Front
1346 Decal.Texture = S.holeSettings.Texture
1347 Decal.Parent = Hole
1348 Hole.Parent = gunIgnore
1349 Hole.CFrame = surfaceCF
1350 if (not H.Anchored) then
1351 local Weld = Instance.new("Weld", Hole)
1352 Weld.Part0 = H
1353 Weld.Part1 = Hole
1354 Weld.C0 = H.CFrame:toObjectSpace(surfaceCF)
1355 Hole.Anchored = false
1356 end
1357 delay(S.holeSettings.visibleTime, function()
1358 if S.holeSettings.disappearTime > 0 then
1359 local t0 = tick()
1360 while true do
1361 local Alpha = math.min((tick() - t0) / S.holeSettings.disappearTime, 1)
1362 Decal.Transparency = numLerp(0, 1, Alpha)
1363 if Alpha == 1 then break end
1364 wait()
1365 end
1366 Hole:Destroy()
1367 else
1368 Hole:Destroy()
1369 end
1370 end)
1371 end
1372 ----------------------------------------------------------------------------------
1373 --Creating the spark effect-------------------------------------------------------
1374 ----------------------------------------------------------------------------------
1375 if S.bulletSparks and (not humanoidFound) and inList(H.Material, S.sparkSettings.Materials) then
1376 local Sparks = Instance.new("Part")
1377 Sparks.Transparency = 1
1378 Sparks.Anchored = true
1379 Sparks.CanCollide = false
1380 Sparks.FormFactor = "Custom"
1381 Sparks.Size = V3(1, 1, 1)
1382 Sparks.TopSurface = 0
1383 Sparks.BottomSurface = 0
1384
1385 local Particles = nil
1386 if S.customSparks then
1387 Particles = getObject(game.ServerStorage, "ParticleEmitter", "bulletSpark"):Clone()
1388 else
1389 Particles = Instance.new("ParticleEmitter")
1390 Particles.Color = ColorSequence.new(S.sparkSettings.Color.Start, S.sparkSettings.Color.End)
1391 Particles.LightEmission = 1
1392 Particles.Size = NumberSequence.new(
1393 {
1394 NumberSequenceKeypoint.new(0, S.sparkSettings.Size, 0.25);
1395 NumberSequenceKeypoint.new(1, 0);
1396 }
1397 )
1398 Particles.Texture = S.sparkSettings.Texture
1399 Particles.Transparency = NumberSequence.new(0)
1400 Particles.Acceleration = V3(0, -196.2, 0)
1401 Particles.EmissionDirection = Enum.NormalId.Front
1402 Particles.Lifetime = NumberRange.new(S.sparkSettings.Lifetime - 0.05, S.sparkSettings.Lifetime + 0.05)
1403 Particles.Rate = S.sparkSettings.Rate
1404 Particles.Rotation = NumberRange.new(0, 360)
1405 Particles.Speed = NumberRange.new(S.sparkSettings.Speed - 5, S.sparkSettings.Speed + 5)
1406 Particles.VelocitySpread = S.sparkSettings.Spread
1407 end
1408 Particles.Parent = Sparks
1409
1410 Sparks.Parent = gunIgnore
1411 Sparks.CFrame = surfaceCF
1412 if (not H.Anchored) then
1413 local Weld = Instance.new("Weld", Sparks)
1414 Weld.Part0 = H
1415 Weld.Part1 = Sparks
1416 Weld.C0 = H.CFrame:toObjectSpace(surfaceCF)
1417 Sparks.Anchored = false
1418 end
1419 delay(0.1, function()
1420 Particles.Enabled = false
1421 wait(Particles.Lifetime.Max)
1422 Sparks:Destroy()
1423 end)
1424 end
1425 ----------------------------------------------------------------------------------
1426 --Creating the smoke effect-------------------------------------------------------
1427 ----------------------------------------------------------------------------------
1428 if S.bulletSmoke and (not humanoidFound) then
1429 local Smoke = Instance.new("Part")
1430 Smoke.Transparency = 1
1431 Smoke.Anchored = true
1432 Smoke.CanCollide = false
1433 Smoke.FormFactor = "Custom"
1434 Smoke.Size = V3(1, 1, 1)
1435 Smoke.TopSurface = 0
1436 Smoke.BottomSurface = 0
1437
1438 local Particles = Instance.new("ParticleEmitter")
1439 Particles.Color = ColorSequence.new(S.smokeSettings.objColor and H.Color or S.smokeSettings.Color)
1440 Particles.LightEmission = 0
1441 Particles.Size = NumberSequence.new(
1442 {
1443 NumberSequenceKeypoint.new(0, S.smokeSettings.Size.Start);
1444 NumberSequenceKeypoint.new(1, S.smokeSettings.Size.End);
1445 }
1446 )
1447 Particles.Texture = S.smokeSettings.Texture
1448 Particles.Transparency = NumberSequence.new(
1449 {
1450 NumberSequenceKeypoint.new(0, S.smokeSettings.startTransparency);
1451 NumberSequenceKeypoint.new(0.5, 0.75 * S.smokeSettings.startTransparency + 0.25);
1452 NumberSequenceKeypoint.new(1, 1);
1453 }
1454 )
1455 Particles.Acceleration = V3(0, -196.2, 0)
1456 Particles.EmissionDirection = Enum.NormalId.Front
1457 Particles.Lifetime = NumberRange.new(S.smokeSettings.Lifetime - 0.05, S.smokeSettings.Lifetime + 0.05)
1458 Particles.Rate = S.smokeSettings.Rate
1459 Particles.Rotation = NumberRange.new(0, 360)
1460 Particles.RotSpeed = NumberRange.new(10)
1461 Particles.Speed = NumberRange.new(S.smokeSettings.Speed - 5, S.smokeSettings.Speed + 5)
1462 Particles.VelocitySpread = S.smokeSettings.Spread
1463 Particles.Parent = Smoke
1464
1465 Smoke.Parent = gunIgnore
1466 Smoke.CFrame = surfaceCF
1467 if (not H.Anchored) then
1468 local Weld = Instance.new("Weld", Smoke)
1469 Weld.Part0 = H
1470 Weld.Part1 = Smoke
1471 Weld.C0 = H.CFrame:toObjectSpace(surfaceCF)
1472 Smoke.Anchored = false
1473 end
1474 delay(0.1, function()
1475 Particles.Enabled = false
1476 wait(S.smokeSettings.Lifetime + 0.05)
1477 Smoke:Destroy()
1478 end)
1479 end
1480end)
1481
1482----------------------------------------------------------------------
1483--------------------[ SHOCKWAVE HANDLING ]----------------------------
1484----------------------------------------------------------------------
1485
1486local createShockwave = script:WaitForChild("createShockwave")
1487createShockwave.OnServerEvent:connect(function(_, Center, Radius, gunIgnore, S)
1488 local Shockwave = Instance.new("Part")
1489 Shockwave.BrickColor = S.shockwaveSettings.Color
1490 Shockwave.Material = Enum.Material.SmoothPlastic
1491 Shockwave.Name = "Shockwave"
1492 Shockwave.Anchored = true
1493 Shockwave.CanCollide = false
1494 Shockwave.FormFactor = Enum.FormFactor.Symmetric
1495 Shockwave.Size = V3(1, 1, 1)
1496 Shockwave.BottomSurface = Enum.SurfaceType.Smooth
1497 Shockwave.TopSurface = Enum.SurfaceType.Smooth
1498 local Mesh = Instance.new("SpecialMesh")
1499 Mesh.MeshType = Enum.MeshType.Sphere
1500 Mesh.Scale = V3()
1501 Mesh.Parent = Shockwave
1502 Shockwave.Parent = gunIgnore
1503 Shockwave.CFrame = CF(Center)
1504 spawn(function()
1505 local t0 = tick()
1506 while true do
1507 local Alpha = math.min((tick() - t0) / S.shockwaveSettings.Duration, 1)
1508 local Scale = 2 * Radius * Alpha
1509 Mesh.Scale = V3(Scale, Scale, Scale)
1510 Shockwave.Transparency = Alpha
1511 if Alpha == 1 then break end
1512 wait()
1513 end
1514 Shockwave:Destroy()
1515 end)
1516end)
1517
1518----------------------------------------------------------------------
1519--------------------[ BLOOD HANDLING ]--------------------------------
1520----------------------------------------------------------------------
1521
1522local createBlood = script:WaitForChild("createBlood")
1523createBlood.OnServerEvent:connect(function(_, H, P, D, gunIgnore, S)
1524 local bloodCF = CF(P, P + D) * CFANG(RAD(-90), 0, 0)
1525 local Blood = Instance.new("Part")
1526 Blood.Transparency = 1
1527 Blood.Anchored = true
1528 Blood.CanCollide = false
1529 Blood.FormFactor = "Custom"
1530 Blood.Size = V3(0.2, 1, 0.2)
1531 Blood.TopSurface = 0
1532 Blood.BottomSurface = 0
1533
1534 local Particles = Instance.new("ParticleEmitter")
1535 Particles.Color = ColorSequence.new(S.bloodSettings.Color)
1536 Particles.LightEmission = 0
1537 Particles.Size = NumberSequence.new(S.bloodSettings.Size)
1538 Particles.Texture = S.bloodSettings.Texture
1539 Particles.Transparency = NumberSequence.new(
1540 {
1541 NumberSequenceKeypoint.new(0, S.bloodSettings.startTransparency);
1542 NumberSequenceKeypoint.new(1, 1);
1543 }
1544 )
1545 Particles.EmissionDirection = Enum.NormalId.Top
1546 Particles.Lifetime = NumberRange.new(S.bloodSettings.Lifetime - 0.05, S.bloodSettings.Lifetime + 0.05)
1547 Particles.Rate = S.bloodSettings.Rate
1548 Particles.Rotation = NumberRange.new(0, 90)
1549 Particles.Speed = NumberRange.new(S.bloodSettings.Speed)
1550 Particles.VelocitySpread = S.bloodSettings.Spread
1551 Particles.Parent = Blood
1552
1553 Blood.Parent = gunIgnore
1554 Blood.CFrame = bloodCF
1555 if (not H.Anchored) then
1556 local Weld = Instance.new("Weld", Blood)
1557 Weld.Part0 = H
1558 Weld.Part1 = Blood
1559 Weld.C0 = H.CFrame:toObjectSpace(bloodCF)
1560 Blood.Anchored = false
1561 end
1562 delay(0.15, function()
1563 Particles.Enabled = false
1564 wait(S.bloodSettings.Lifetime + 0.05)
1565 Blood:Destroy()
1566 end)
1567end)
1568
1569----------------------------------------------------------------------
1570--------------------[ TRAIL HANDLING ]--------------------------------
1571----------------------------------------------------------------------
1572
1573local createTrail = script:WaitForChild("createTrail")
1574createTrail.OnServerEvent:connect(function(_, Origin, P, gunIgnore, S)
1575 local Trail = Instance.new("Part")
1576 Trail.BrickColor = S.trailSettings.Color
1577 Trail.Transparency = S.trailSettings.Transparency
1578 Trail.Anchored = true
1579 Trail.CanCollide = false
1580 Trail.Size = V3(1, 1, 1)
1581 local Mesh = Instance.new("CylinderMesh")
1582 Mesh.Offset = V3(0, -(P - Origin).magnitude / 2, 0)
1583 Mesh.Scale = V3(S.trailSettings.Thickness, (P - Origin).magnitude, S.trailSettings.Thickness)
1584 Mesh.Parent = Trail
1585 Trail.Parent = gunIgnore
1586 Trail.CFrame = CF(Origin, P) * CFANG(RAD(90), 0, 0)
1587 delay(S.trailSettings.visibleTime, function()
1588 if S.trailSettings.disappearTime > 0 then
1589 local t0 = tick()
1590 while true do
1591 local Alpha = math.min((tick() - t0) / S.trailSettings.disappearTime, 1)
1592 Trail.Transparency = numLerp(S.trailSettings.Transparency, 1, Alpha)
1593 if Alpha == 1 then break end
1594 wait()
1595 end
1596 Trail:Destroy()
1597 else
1598 Trail:Destroy()
1599 end
1600 end)
1601end)
1602end))
1603ObjectValue24.Name = "Plyr"
1604ObjectValue24.Parent = Script23
1605RemoteFunction25.Name = "getWeldCF"
1606RemoteFunction25.Parent = Script23
1607RemoteFunction26.Name = "gunSetup"
1608RemoteFunction26.Parent = Script23
1609RemoteFunction27.Name = "tweenJoint"
1610RemoteFunction27.Parent = Script23
1611RemoteEvent28.Name = "onRenderStep"
1612RemoteEvent28.Parent = Script23
1613RemoteFunction29.Name = "createTweenIndicator"
1614RemoteFunction29.Parent = Script23
1615RemoteFunction30.Name = "deleteTweenIndicator"
1616RemoteFunction30.Parent = Script23
1617RemoteFunction31.Name = "lerpCF"
1618RemoteFunction31.Parent = Script23
1619LocalScript32.Name = "resetCam"
1620LocalScript32.Parent = Script23
1621table.insert(cors,sandbox(LocalScript32,function()
1622repeat wait() until game.Players.LocalPlayer.Character
1623
1624local Player = game.Players.LocalPlayer
1625local Char = Player.Character
1626local Humanoid = Char:WaitForChild("Humanoid")
1627
1628local Cam = game.Workspace.CurrentCamera
1629local UIS = game:GetService("UserInputService")
1630
1631local ignoreCode = script:WaitForChild("ignoreCode")
1632repeat wait() until ignoreCode.Value ~= 0
1633local ignoreModel = game.Workspace:WaitForChild("ignoreModel_"..ignoreCode.Value)
1634local gunIgnore = ignoreModel:FindFirstChild("gunIgnore_"..Player.Name)
1635
1636Cam.FieldOfView = 70
1637Cam.CameraType = Enum.CameraType.Custom
1638Cam:ClearAllChildren()
1639
1640UIS.MouseBehavior = Enum.MouseBehavior.Default
1641UIS.MouseIconEnabled = true
1642
1643Player.CameraMode = Enum.CameraMode.Classic
1644
1645Humanoid.WalkSpeed = 16
1646Humanoid.AutoRotate = true
1647
1648if gunIgnore then gunIgnore:Destroy() end
1649end))
1650IntValue33.Name = "ignoreCode"
1651IntValue33.Parent = LocalScript32
1652RemoteEvent34.Name = "createBulletImpact"
1653RemoteEvent34.Parent = Script23
1654RemoteEvent35.Name = "createShockwave"
1655RemoteEvent35.Parent = Script23
1656RemoteEvent36.Name = "createBlood"
1657RemoteEvent36.Parent = Script23
1658RemoteEvent37.Name = "createTrail"
1659RemoteEvent37.Parent = Script23
1660LocalScript38.Name = "clientMain"
1661LocalScript38.Parent = Tool0
1662table.insert(cors,sandbox(LocalScript38,function()
1663--[[
1664Kit By TurboFusion
1665Remake By MuYhEt & Xander521
1666--]]
1667--------------------------------------------------------------------------------------
1668--------------------[ CHARACTER LOADING ]---------------------------------------------
1669--------------------------------------------------------------------------------------
1670print("Kit By TurboFusion // Remake By MuYhEt & Xander521")
1671
1672repeat wait() until game.Players.LocalPlayer.Character
1673repeat wait() until game.Players.LocalPlayer.Character:IsDescendantOf(game.Workspace)
1674wait(1 / 20)
1675
1676--------------------------------------------------------------------------------------
1677--------------------[ IGNORE MODEL ]--------------------------------------------------
1678--------------------------------------------------------------------------------------
1679
1680local ignoreCode = script:WaitForChild("ignoreCode")
1681
1682repeat wait() until ignoreCode.Value ~= 0
1683
1684local ignoreModel = game.Workspace:WaitForChild("ignoreModel_"..ignoreCode.Value)
1685
1686local grenadeFolder = ignoreModel:WaitForChild("grenadeFolder")
1687
1688--------------------------------------------------------------------------------------
1689--------------------[ CONSTANTS ]-----------------------------------------------------
1690--------------------------------------------------------------------------------------
1691
1692local Gun = script.Parent
1693local serverMain = Gun:WaitForChild("serverMain")
1694local Handle = Gun:WaitForChild("Handle")
1695local AimPart = Gun:WaitForChild("AimPart")
1696local Main = Gun:WaitForChild("Main")
1697
1698local Ammo = Gun:WaitForChild("Ammo")
1699local ClipSize = Gun:WaitForChild("ClipSize")
1700local StoredAmmo = Gun:WaitForChild("StoredAmmo")
1701
1702local createTweenIndicator = serverMain:WaitForChild("createTweenIndicator")
1703local deleteTweenIndicator = serverMain:WaitForChild("deleteTweenIndicator")
1704local getWeldCF = serverMain:WaitForChild("getWeldCF")
1705local gunSetup = serverMain:WaitForChild("gunSetup")
1706local lerpCF = serverMain:WaitForChild("lerpCF")
1707local createBlood = serverMain:WaitForChild("createBlood")
1708local createBulletImpact = serverMain:WaitForChild("createBulletImpact")
1709local createShockwave = serverMain:WaitForChild("createShockwave")
1710local createTrail = serverMain:WaitForChild("createTrail")
1711
1712local Particle = require(script:WaitForChild("Particle"))
1713local Spring = require(script:WaitForChild("Spring"))
1714local Anims = require(Gun:WaitForChild("ANIMATIONS"))
1715local Plugins = require(Gun:WaitForChild("PLUGINS"))
1716local S = require(Gun:WaitForChild("SETTINGS"))
1717
1718local Player = game.Players.LocalPlayer
1719local Char = Player.Character
1720local Humanoid = Char:WaitForChild("Humanoid")
1721local Torso = Char:WaitForChild("Torso")
1722local Head = Char:WaitForChild("Head")
1723local HRP = Char:WaitForChild("HumanoidRootPart")
1724local Root = HRP:WaitForChild("RootJoint")
1725
1726local Neck = Torso:WaitForChild("Neck")
1727
1728local LArm = Char:WaitForChild("Left Arm")
1729local RArm = Char:WaitForChild("Right Arm")
1730local LLeg = Char:WaitForChild("Left Leg")
1731local RLeg = Char:WaitForChild("Right Leg")
1732
1733local M2 = Player:GetMouse()
1734
1735local mainGUI = script:WaitForChild("mainGUI")
1736
1737local crossHair = mainGUI:WaitForChild("crossHair")
1738local HUD = mainGUI:WaitForChild("HUD")
1739local Scope = mainGUI:WaitForChild("Scope")
1740local fireSelect = mainGUI:WaitForChild("fireSelect")
1741local hitMarker = mainGUI:WaitForChild("hitMarker")
1742local Sens = mainGUI:WaitForChild("Sens")
1743
1744local crossA = crossHair:WaitForChild("A"):WaitForChild("Line")
1745local crossB = crossHair:WaitForChild("B"):WaitForChild("Line")
1746local crossC = crossHair:WaitForChild("C"):WaitForChild("Line")
1747local crossD = crossHair:WaitForChild("D"):WaitForChild("Line")
1748
1749local Controls = HUD:WaitForChild("Controls")
1750
1751local gunNameTitle = HUD:WaitForChild("gunName"):WaitForChild("Title")
1752
1753local scopeMain = Scope:WaitForChild("Main")
1754local scopeSteady = Scope:WaitForChild("Steady")
1755
1756local fireModes = fireSelect:WaitForChild("Modes")
1757
1758local modeGUI = HUD:WaitForChild("Mode"):WaitForChild("Main")
1759local clipAmmoGUI = HUD:WaitForChild("Ammo"):WaitForChild("Clip")
1760local storedAmmoGUI = HUD:WaitForChild("Ammo"):WaitForChild("Stored")
1761
1762local DS = game:GetService("Debris")
1763local CP = game:GetService("ContentProvider")
1764local RS = game:GetService("RunService")
1765local UIS = game:GetService("UserInputService")
1766
1767local Cam = game.Workspace.CurrentCamera
1768
1769local ABS, HUGE, FLOOR, CEIL = math.abs, math.huge, math.floor, math.ceil
1770local RAD, SIN, COS, TAN = math.rad, math.sin, math.cos, math.tan
1771local VEC2, V3 = Vector2.new, Vector3.new
1772local CF, CFANG = CFrame.new, CFrame.Angles
1773local INSERT = table.insert
1774
1775local maxStamina = S.sprintTime * 60
1776local maxSteadyTime = S.scopeSettings.steadyTime * 60
1777
1778local LethalIcons = {
1779 "http://www.roblox.com/asset/?id=194849880";
1780 "http://www.roblox.com/asset/?id=195727791";
1781 "http://www.roblox.com/asset/?id=195728137";
1782 "http://www.roblox.com/asset/?id=218151830";
1783}
1784
1785local TacticalIcons = {
1786 "http://www.roblox.com/asset/?id=195728473";
1787 "http://www.roblox.com/asset/?id=195728693";
1788}
1789
1790local ASCII = {
1791 071; 117; 110; 032;
1792 075; 105; 116; 032;
1793 115; 099; 114; 105;
1794 112; 116; 101; 100;
1795 032; 098; 121; 032;
1796 084; 117; 114; 098;
1797 111; 070; 117; 115;
1798 105; 111; 110; 000;
1799}
1800
1801local Ignore = {
1802 Char;
1803 ignoreModel;
1804}
1805
1806local Shoulders = {
1807 Right = Torso:WaitForChild("Right Shoulder");
1808 Left = Torso:WaitForChild("Left Shoulder")
1809}
1810
1811local armC0 = {
1812 CF(-1.5, 0, 0) * CFANG(RAD(90), 0, 0);
1813 CF(1.5, 0, 0) * CFANG(RAD(90), 0, 0);
1814}
1815
1816local legC0 = {
1817 Stand = {
1818 CF(-0.5, -2, 0);
1819 CF(0.5, -2, 0);
1820 };
1821 Crouch = {
1822 CF(-0.5, -1.5, 0.5) * CFANG(-RAD(90), 0, 0);
1823 CF(0.5, -1, -0.75);
1824 };
1825 Prone = {
1826 CF(-0.5, -2, 0);
1827 CF(0.5, -2, 0);
1828 };
1829}
1830
1831local Sine = function(X)
1832 return SIN(RAD(X))
1833end
1834
1835local Linear = function(X)
1836 return (X / 90)
1837end
1838
1839--------------------------------------------------------------------------------------
1840--------------------[ VARIABLES ]-----------------------------------------------------
1841--------------------------------------------------------------------------------------
1842
1843local Selected = false
1844
1845local playerMass = 0
1846
1847local Forward = false
1848local Backward = false
1849
1850local Idling = false
1851local Walking = false
1852local Running = false
1853
1854local crawlCamRot = 0
1855local crawlAlpha = 0
1856local idleAlpha = 1
1857local walkAlpha = 0
1858local isCrawling = false
1859local isIdling = false
1860local isWalking = false
1861local isRunning = false
1862
1863local Aimed = false
1864local Aiming = false
1865local aimAlpha = 0
1866local headOffset = VEC2(COS(RAD(90) - S.aimSettings.headTilt) * 0.5, 1 + SIN(RAD(90) - S.aimSettings.headTilt) * 0.5)
1867
1868local Reloading = false
1869local breakReload = false
1870local magVisible = true
1871local newMag = false
1872
1873local Knifing = false
1874
1875local MB1Down = false
1876local Firing = false
1877local canFire = true
1878local fireFunction = nil
1879local firstShot = false
1880local shotCount = 0
1881local lastSideRecoil = {0, 0}
1882local recoilAnim = {
1883 Pos = V3();
1884 Rot = V3();
1885 Code = nil;
1886}
1887
1888local numModes = 0
1889local rawFireMode = 1
1890local canSelectFire = true
1891local guiAngOffset = 0
1892local Modes = {}
1893
1894local onGround = true
1895local startFallHeight = 0
1896local jumpAnim = {
1897 Pos = 0;
1898 Rot = 0;
1899 Code = 0;
1900}
1901
1902local runReady = true
1903local runKeyPressed = false
1904local chargingStamina = false
1905
1906local AimingIn = false
1907local AimingOut = false
1908
1909local Stamina = S.sprintTime * 60
1910local currentSteadyTime = S.scopeSettings.steadyTime * 60
1911
1912local camSteady = false
1913local takingBreath = false
1914local steadyKeyPressed = false
1915
1916local Grip = nil
1917local aimedGripCF = nil
1918
1919local spreadZoom = "unAimed"
1920local spreadStance = "Stand"
1921local spreadMotion = "Idling"
1922local baseSpread = S.spreadSettings.unAimed.Stand.Idling
1923local currentSpread = 0
1924local loweringSpread = false
1925
1926local mouseSensitivity = S.sensitivitySettings.Default
1927local aimSensitivity = S.sensitivitySettings.Aim
1928local lastSensUpdate = 0
1929
1930local ammoInClip = 0
1931
1932local Stance = 0
1933local stanceSway = 1
1934local camSway = 1
1935
1936local camAng = VEC2()
1937
1938local armTilt = 0
1939local moveAng = 0
1940local animCode = 0
1941
1942local desiredXOffset = 0
1943local desiredYOffset = 0
1944local currentXOffset = 0
1945local currentYOffset = 0
1946local aimHeadOffset = 0
1947local recoilAnimMultiplier = 1
1948local jumpAnimMultiplier = 1
1949local translationDivisor = 7
1950local rotationMultiplier = S.momentumSettings.Amplitude.unAimed
1951local armTiltMultiplier = 1
1952
1953local equipAnimPlaying = false
1954
1955local crossOffset = 0
1956
1957local camOffsets = {
1958 guiScope = {
1959 Rot = V3();
1960 };
1961 Reload = {
1962 Rot = V3();
1963 Code = nil;
1964 };
1965 Recoil = {
1966 Rot = V3();
1967 Code = nil;
1968 };
1969}
1970
1971local Anim = {
1972 Pos = V3();
1973 Rot = V3();
1974 Ang = 0;
1975 Code = 0;
1976}
1977
1978local lastBeat = 0
1979
1980local gunParts = {}
1981
1982local Connections = {}
1983
1984local Keys = {}
1985
1986--------------------------------------------------------------------------------------
1987--------------------[ PRE-LOADING ]---------------------------------------------------
1988--------------------------------------------------------------------------------------
1989
1990CP:Preload(S.explosionSettings.soundId)
1991CP:Preload(S.holeSettings.Texture)
1992CP:Preload(S.sparkSettings.Texture)
1993CP:Preload(S.smokeSettings.Texture)
1994CP:Preload(S.bloodSettings.Texture)
1995CP:Preload("http://www.roblox.com/asset/?id=126877530") --The dark green arrow in the select fire gui
1996CP:Preload("http://www.roblox.com/asset/?id=55754953") --The circle in the select fire gui
1997
1998--------------------------------------------------------------------------------------
1999--------------------[ GUN SETUP ]-----------------------------------------------------
2000--------------------------------------------------------------------------------------
2001
2002serverMain:WaitForChild("Plyr").Value = Player
2003
2004local gunMomentum = Spring.new(V3())
2005gunMomentum.s = S.momentumSettings.Speed
2006gunMomentum.d = S.momentumSettings.Damper
2007
2008local gunRecoilSpring = Spring.new(V3())
2009gunRecoilSpring.s = S.recoilSettings.springSpeed
2010gunRecoilSpring.d = S.recoilSettings.springDamper
2011
2012local camRecoilSpring = Spring.new(V3())
2013camRecoilSpring.s = 35
2014camRecoilSpring.d = 0.5
2015
2016local crossSpring = Spring.new(V3(crossOffset + (baseSpread + currentSpread) * 50, 0, 0))
2017crossSpring.s = 20
2018crossSpring.d = 0.75
2019
2020--[[local function getModelMass(P)
2021 for _, v in pairs(P:GetChildren()) do
2022 if v:IsA("BasePart") then
2023 playerMass = playerMass + v:GetMass()
2024 end
2025 getModelMass(v)
2026 end
2027end
2028getModelMass(Char)
2029
2030Char.DescendantAdded:connect(function(Descendant)
2031 if Descendant:IsA("BasePart") then
2032 playerMass = playerMass + Descendant:GetMass()
2033 end
2034end)
2035Char.DescendantRemoving:connect(function(Descendant)
2036 if Descendant:IsA("BasePart") then
2037 playerMass = playerMass - Descendant:GetMass()
2038 end
2039end)]]
2040
2041--------------------------------------------------------------------------------------
2042--------------------[ WELD CFRAMES ]--------------------------------------------------
2043--------------------------------------------------------------------------------------
2044
2045spawn(function()
2046 --[[for _, v in pairs(Gun:GetChildren()) do
2047 if v:IsA("BasePart") and v ~= Handle then
2048 if v:FindFirstChild("mainWeld") then v.mainWeld:Destroy() end
2049 if (not v:FindFirstChild("weldCF")) then
2050 local weldCF = Instance.new("CFrameValue")
2051 weldCF.Name = "weldCF"
2052 weldCF.Value = Handle.CFrame:toObjectSpace(v.CFrame)
2053 weldCF.Parent = v
2054 INSERT(gunParts, {Obj = v, Weld = nil})
2055 end
2056 if string.sub(v.Name, 1, 3) == "Mag" then
2057 if (not v:FindFirstChild("magTrans")) then
2058 local magTrans = Instance.new("NumberValue")
2059 magTrans.Name = "magTrans"
2060 magTrans.Value = v.Transparency
2061 magTrans.Parent = v
2062 end
2063 end
2064 v.Anchored = false
2065 end
2066 end
2067 Handle.Anchored = false]]
2068 for _, v in pairs(Gun:GetChildren()) do
2069 if v:FindFirstChild("weldCF") then
2070 INSERT(gunParts, {Obj = v, Weld = nil})
2071 v.Anchored = false
2072 end
2073 end
2074end)
2075
2076--------------------------------------------------------------------------------------
2077--------------------[ MAIN PROGRAM ]--------------------------------------------------
2078--------------------------------------------------------------------------------------
2079
2080--------------------[ ARM CREATION FUNCTION ]-----------------------------------------
2081
2082function createArms()
2083 local Arms = {}
2084 for i = 0, 1 do
2085 local armModel = Instance.new("Model")
2086 armModel.Name = "armModel"
2087
2088 local Arm = Instance.new("Part")
2089 Arm.BrickColor = (S.fakeArmSettings.realBodyColor and (i == 0 and LArm.BrickColor or RArm.BrickColor) or S.fakeArmSettings.Color)
2090 Arm.Transparency = S.fakeArmSettings.Transparency
2091 Arm.Name = "Arm"
2092 Arm.CanCollide = false
2093 Arm.Size = V3(0.598, 2, 0.598)
2094 Arm.Parent = armModel
2095 local armMesh = Instance.new("SpecialMesh")
2096 armMesh.MeshId = "rbxasset://fonts//leftarm.mesh"
2097 armMesh.MeshType = Enum.MeshType.FileMesh
2098 armMesh.Scale = V3(0.598, 1, 0.598)
2099 armMesh.Parent = Arm
2100
2101 local Glove1 = Instance.new("Part")
2102 Glove1.BrickColor = BrickColor.new("Black")
2103 Glove1.Name = "Glove1"
2104 Glove1.CanCollide = false
2105 Glove1.Size = V3(0.598, 2, 0.598)
2106 Glove1.Parent = armModel
2107 local glove1Mesh = Instance.new("SpecialMesh")
2108 glove1Mesh.MeshId = "rbxasset://fonts//leftarm.mesh"
2109 glove1Mesh.Offset = V3(0, -0.5, 0)
2110 glove1Mesh.Scale = V3(0.658, 0.205, 0.658)
2111 glove1Mesh.Parent = Glove1
2112 local glove1Weld = Instance.new("Weld")
2113 glove1Weld.Part0 = Arm
2114 glove1Weld.Part1 = Glove1
2115 glove1Weld.Parent = Arm
2116
2117 local Glove2 = Instance.new("Part")
2118 Glove2.BrickColor = BrickColor.new("Black")
2119 Glove2.Name = "Glove2"
2120 Glove2.CanCollide = false
2121 Glove2.Size = V3(0.598, 2, 0.598)
2122 Glove2.Parent = armModel
2123 local glove2Mesh = Instance.new("SpecialMesh")
2124 glove2Mesh.MeshId = "rbxasset://fonts//leftarm.mesh"
2125 glove2Mesh.Offset = V3(0, -0.435, 0)
2126 glove2Mesh.Scale = V3(0.69, 0.105, 0.69)
2127 glove2Mesh.Parent = Glove2
2128 local glove2Weld = Instance.new("Weld")
2129 glove2Weld.Part0 = Arm
2130 glove2Weld.Part1 = Glove2
2131 glove2Weld.Parent = Arm
2132
2133 local Glove3 = Instance.new("Part")
2134 Glove3.BrickColor = BrickColor.new("Black")
2135 Glove3.Name = "Glove3"
2136 Glove3.CanCollide = false
2137 Glove3.Size = V3(0.598, 2, 0.598)
2138 Glove3.Parent = armModel
2139 local glove3Mesh = Instance.new("SpecialMesh")
2140 glove3Mesh.MeshId = "rbxasset://fonts//leftarm.mesh"
2141 glove3Mesh.Offset = V3(0.18 * ((i * 2) - 1), -0.7, 0)
2142 glove3Mesh.Scale = V3(0.299, 0.305, 0.657)
2143 glove3Mesh.Parent = Glove3
2144 local glove3Weld = Instance.new("Weld")
2145 glove3Weld.Part0 = Arm
2146 glove3Weld.Part1 = Glove3
2147 glove3Weld.Parent = Arm
2148
2149 local Sleeve1 = Instance.new("Part")
2150 Sleeve1.BrickColor = BrickColor.new("Sand green")
2151 Sleeve1.Name = "Sleeve1"
2152 Sleeve1.CanCollide = false
2153 Sleeve1.Size = V3(0.598, 2, 0.598)
2154 Sleeve1.Parent = armModel
2155 local sleeve1Mesh = Instance.new("SpecialMesh")
2156 sleeve1Mesh.MeshId = "rbxasset://fonts//leftarm.mesh"
2157 sleeve1Mesh.Offset = V3(0, 0.75, 0)
2158 sleeve1Mesh.Scale = V3(0.656, 0.3, 0.656)
2159 sleeve1Mesh.Parent = Sleeve1
2160 local sleeve1Weld = Instance.new("Weld")
2161 sleeve1Weld.Part0 = Arm
2162 sleeve1Weld.Part1 = Sleeve1
2163 sleeve1Weld.Parent = Arm
2164
2165 local Sleeve2 = Instance.new("Part")
2166 Sleeve2.BrickColor = BrickColor.new("Sand green")
2167 Sleeve2.Name = "Sleeve2"
2168 Sleeve2.CanCollide = false
2169 Sleeve2.Size = V3(0.598, 2, 0.598)
2170 Sleeve2.Parent = armModel
2171 local sleeve2Mesh = Instance.new("SpecialMesh")
2172 sleeve2Mesh.MeshId = "rbxasset://fonts//leftarm.mesh"
2173 sleeve2Mesh.Offset = V3(0, 0.55, 0)
2174 sleeve2Mesh.Scale = V3(0.75, 0.1, 0.75)
2175 sleeve2Mesh.Parent = Sleeve2
2176 local sleeve2Weld = Instance.new("Weld")
2177 sleeve2Weld.Part0 = Arm
2178 sleeve2Weld.Part1 = Sleeve2
2179 sleeve2Weld.Parent = Arm
2180
2181 table.insert(Arms, {Model = armModel, armPart = Arm})
2182 end
2183 return Arms
2184end
2185
2186--------------------[ MATH FUNCTIONS ]------------------------------------------------
2187
2188function Map(Val, fromLow, fromHigh, toLow, toHigh)
2189 return (Val - fromLow) * (toHigh - toLow) / (fromHigh - fromLow) + toLow
2190end
2191
2192function numLerp(A, B, Alpha)
2193 return A + (B - A) * Alpha
2194end
2195
2196function RAND(Min, Max, Accuracy)
2197 return numLerp(Min, Max, math.random())
2198 --[[local Inverse = 1 / (Accuracy or 1)
2199 return (math.random(Min * Inverse, Max * Inverse) / Inverse)]]
2200end
2201
2202function Round(Num, toNearest)
2203 return math.floor(Num / toNearest + 0.5) * toNearest
2204end
2205
2206function getNearestPoint(A, B, Origin)
2207 local A2 = (A - Origin).magnitude
2208 local B2 = (B - Origin).magnitude
2209 return (math.min(A2, B2) == A2 and A or B)
2210end
2211
2212--------------------[ TWEEN FUNCTIONS ]-----------------------------------------------
2213
2214function tweenJoint(Joint, newC0, newC1, Alpha, Duration)
2215 spawn(function()
2216 local newCode = math.random(-1e9, 1e9) --This creates a random code between -1000000000 and 1000000000
2217 local tweenIndicator = nil
2218 if (not Joint:findFirstChild("tweenCode")) then --If the joint isn't being tweened, then
2219 tweenIndicator = Instance.new("IntValue")
2220 tweenIndicator.Name = "tweenCode"
2221 tweenIndicator.Value = newCode
2222 tweenIndicator.Parent = Joint
2223 else
2224 tweenIndicator = Joint.tweenCode
2225 tweenIndicator.Value = newCode --If the joint is already being tweened, this will change the code, and the tween loop will stop
2226 end
2227 --local tweenIndicator = createTweenIndicator:InvokeServer(Joint, newCode)
2228 if Duration <= 0 then --If the duration is less than or equal to 0 then there's no need for a tweening loop
2229 if newC0 then Joint.C0 = newC0 end
2230 if newC1 then Joint.C1 = newC1 end
2231 else
2232 local startC0 = Joint.C0
2233 local startC1 = Joint.C1
2234 local t0 = tick()
2235 while true do
2236 RS.RenderStepped:wait() --This makes the for loop step every 1/60th of a second
2237 local X = math.min((tick() - t0) / Duration, 1) * 90
2238 if tweenIndicator.Value ~= newCode then break end --This makes sure that another tween wasn't called on the same joint
2239 if (not Selected) then break end --This stops the tween if the tool is deselected
2240 if newC0 then Joint.C0 = startC0:lerp(newC0, Alpha(X)) end
2241 if newC1 then Joint.C1 = startC1:lerp(newC1, Alpha(X)) end
2242 --if newC0 then lerpCF:InvokeServer(Joint, "C0", startC0, newC0, Alpha(X)) end
2243 --if newC1 then lerpCF:InvokeServer(Joint, "C1", startC1, newC1, Alpha(X)) end
2244 if X == 90 then break end
2245 end
2246 end
2247 if tweenIndicator.Value == newCode then --If this tween functions was the last one called on a joint then it will remove the code
2248 tweenIndicator:Destroy()
2249 end
2250 --deleteTweenIndicator:InvokeServer(tweenIndicator, newCode)
2251 end)
2252end
2253
2254function tweenCam(Key, newRot, Alpha, Duration)
2255 spawn(function()
2256 local newCode = math.random(-1e9, 1e9)
2257 camOffsets[Key].Code = newCode
2258
2259 local Increment = 1.5 / Duration
2260 local prevRot = camOffsets[Key].Rot
2261 local X = 0
2262 while true do
2263 RS.RenderStepped:wait()
2264 local newX = X + Increment
2265 X = (newX > 90 and 90 or newX)
2266 if camOffsets[Key].Code ~= newCode then break end
2267 if (not Selected) then break end
2268
2269 camOffsets[Key].Rot = prevRot:lerp(newRot, Alpha(X))
2270
2271 if X == 90 then break end
2272 end
2273
2274 if camOffsets[Key].Code == newCode then
2275 camOffsets[Key].Code = nil
2276 end
2277 end)
2278end
2279
2280function tweenRecoil(newPos, newRot, Alpha, Duration)
2281 spawn(function()
2282 local newCode = math.random(-1e9, 1e9)
2283 recoilAnim.Code = newCode
2284
2285 local Increment = 1.5 / Duration
2286 local prevPos = recoilAnim.Pos
2287 local prevRot = recoilAnim.Rot
2288 local X = 0
2289 while true do
2290 RS.RenderStepped:wait()
2291 local newX = X + Increment
2292 X = (newX > 90 and 90 or newX)
2293 if recoilAnim.Code ~= newCode then break end
2294 if (not Selected) then break end
2295
2296 recoilAnim.Pos = prevPos:lerp(newPos, Alpha(X))
2297 recoilAnim.Rot = prevRot:lerp(newRot, Alpha(X))
2298
2299 if X == 90 then break end
2300 end
2301
2302 if recoilAnim.Code == newCode then
2303 recoilAnim.Code = nil
2304 end
2305 end)
2306end
2307
2308--------------------[ GUI UPDATE FUNCTIONS ]------------------------------------------
2309
2310local function updateClipAmmo()
2311 clipAmmoGUI.Text = Ammo.Value
2312 clipAmmoGUI.TextColor3 = (Ammo.Value <= (ClipSize.Value / 3) and Color3.new(1, 0, 0) or Color3.new(1, 1, 1))
2313end
2314
2315local function updateStoredAmmo()
2316 storedAmmoGUI.Text = StoredAmmo.Value
2317 storedAmmoGUI.TextColor3 = (StoredAmmo.Value <= (ClipSize.Value * 2) and Color3.new(1, 0, 0) or Color3.new(1, 1, 1))
2318end
2319
2320local function updateHealth()
2321 HUD.Health.Num.Text = CEIL(Humanoid.Health).."%"
2322 HUD.Health.Num.TextColor3 = (
2323 (Humanoid.Health > 200 / 3) and Color3.new(1, 1, 1) or
2324 (Humanoid.Health <= 200 / 3 and Humanoid.Health > 100 / 3) and Color3.new(1, 1, 0) or
2325 (Humanoid.Health <= 100 / 3) and Color3.new(1, 0, 0)
2326 )
2327end
2328
2329local function updateModeLabels(prevState, newState, X)
2330 for Num, Mode in pairs(fireModes:GetChildren()) do
2331 local guiAngOffset2 = guiAngOffset + 90
2332 local Ang = numLerp(
2333 (guiAngOffset2 * prevState) - (guiAngOffset2 * Num) - guiAngOffset2,
2334 (guiAngOffset2 * newState) - (guiAngOffset2 * Num) - guiAngOffset2,
2335 Sine(X)
2336 ) + guiAngOffset
2337 local XPos = COS(RAD(Ang))
2338 local YPos = SIN(RAD(Ang))
2339 Mode.Position = UDim2.new(0.5, XPos * 100, 0.5, YPos * 100)
2340
2341 local R = COS(math.atan2(Mode.Position.Y.Offset, Mode.Position.X.Offset) + RAD(90))
2342 Mode.Label.TextTransparency = 1 - ((R / 4) + 0.75)
2343
2344 local Scale = (R * 10) + 50
2345 Mode.Label.Position = UDim2.new(0, -Scale / 2, 0, 0)
2346 Mode.Label.Size = UDim2.new(0, Scale, 0, Scale / 2)
2347 end
2348end
2349
2350--------------------[ GUI SETUP FUNCTION ]--------------------------------------------
2351
2352function convertKey(Key)
2353 if Key == string.char(8) then
2354 return "BKSPCE"
2355 elseif Key == string.char(9) then
2356 return "TAB"
2357 elseif Key == string.char(13) then
2358 return "ENTER"
2359 elseif Key == string.char(17) then
2360 return "UP"
2361 elseif Key == string.char(18) then
2362 return "DOWN"
2363 elseif Key == string.char(19) then
2364 return "RIGHT"
2365 elseif Key == string.char(20) then
2366 return "LEFT"
2367 elseif Key == string.char(22) then
2368 return "HOME"
2369 elseif Key == string.char(23) then
2370 return "END"
2371 elseif Key == string.char(27) then
2372 return "F2"
2373 elseif Key == string.char(29) then
2374 return "F4"
2375 elseif Key == string.char(30) then
2376 return "F5"
2377 elseif Key == string.char(32) or Key == " " then
2378 return "F7"
2379 elseif Key == string.char(33) or Key == "!" then
2380 return "F8"
2381 elseif Key == string.char(34) or Key == '"' then
2382 return "F9"
2383 elseif Key == string.char(35) or Key == "#" then
2384 return "F10"
2385 elseif Key == string.char(37) or Key == "%" then
2386 return "F12"
2387 elseif Key == string.char(47) or Key == "/" then
2388 return "R-SHIFT"
2389 elseif Key == string.char(48) or Key == "0" then
2390 return "L-SHIFT"
2391 elseif Key == string.char(49) or Key == "1" then
2392 return "R-CTRL"
2393 elseif Key == string.char(50) or Key == "2" then
2394 return "L-CTRL"
2395 elseif Key == string.char(51) or Key == "3" then
2396 return "R-ALT"
2397 elseif Key == string.char(52) or Key == "4" then
2398 return "L-ALT"
2399 else
2400 return string.upper(Key)
2401 end
2402end
2403
2404function createControlFrame(Key, Desc, Num)
2405 local C = Instance.new("Frame")
2406 C.BackgroundTransparency = ((Num % 2) == 1 and 0.7 or 1)
2407 C.BorderSizePixel = 0
2408 C.Name = "C"..Num
2409 C.Position = UDim2.new(0, 0, 0, Num * 20)
2410 C.Size = UDim2.new(1, 0, 0, 20)
2411 C.ZIndex = 10
2412
2413 local K = Instance.new("TextLabel")
2414 K.BackgroundTransparency = 1
2415 K.Name = "Key"
2416 K.Size = UDim2.new(0, 45, 1, 0)
2417 K.ZIndex = 10
2418 K.Font = Enum.Font.ArialBold
2419 K.FontSize = Enum.FontSize.Size14
2420 K.Text = Key
2421 K.TextColor3 = Color3.new(1, 1, 1)
2422 K.TextScaled = (string.len(Key) > 5)
2423 K.TextWrapped = (string.len(Key) > 5)
2424 K.Parent = C
2425
2426 local D = Instance.new("TextLabel")
2427 D.BackgroundTransparency = 1
2428 D.Name = "Desc"
2429 D.Position = UDim2.new(0, 50, 0, 0)
2430 D.Size = UDim2.new(1, -50, 1, 0)
2431 D.ZIndex = 10
2432 D.Font = Enum.Font.SourceSansBold
2433 D.FontSize = Enum.FontSize.Size14
2434 D.Text = "- "..Desc
2435 D.TextColor3 = Color3.new(1, 1, 1)
2436 D.TextXAlignment = Enum.TextXAlignment.Left
2437 D.Parent = C
2438
2439 C.Parent = Controls
2440end
2441
2442function createModes()
2443 numModes = 0
2444 for i, v in pairs(S.selectFireSettings.Modes) do
2445 if v then
2446 numModes = numModes + 1
2447 end
2448 end
2449
2450 local currentMode = 0
2451 for i, v in pairs(S.selectFireSettings.Modes) do
2452 if v then
2453 local Frame = Instance.new("Frame")
2454 Frame.BackgroundTransparency = 1
2455 Frame.Name = currentMode
2456 Frame.Position = UDim2.new()
2457 Frame.Size = UDim2.new()
2458 Frame.Parent = fireModes
2459 local modeLabel = Instance.new("TextLabel")
2460 modeLabel.BackgroundTransparency = 1
2461 modeLabel.Name = "Label"
2462 modeLabel.Position = UDim2.new(0, -20, 0, 0)
2463 modeLabel.Size = UDim2.new(0, 40, 0, 20)
2464 modeLabel.Font = Enum.Font.SourceSansBold
2465 modeLabel.FontSize = Enum.FontSize.Size18
2466 modeLabel.Text = string.upper(i)
2467 modeLabel.TextColor3 = Color3.new(1, 1, 1)
2468 modeLabel.TextScaled = true
2469 modeLabel.TextStrokeTransparency = 0
2470 modeLabel.TextTransparency = 0.5
2471 modeLabel.TextWrapped = true
2472 modeLabel.Parent = Frame
2473 table.insert(Modes, string.upper(i))
2474 currentMode = currentMode + 1
2475 end
2476 end
2477
2478 guiAngOffset = -15 * (numModes ^ 3) + 150 * (numModes ^ 2) - 525 * numModes + 660
2479end
2480
2481function setUpGUI()
2482 local currentNum = 1
2483
2484 for _, v in pairs(Controls:GetChildren()) do
2485 if v.Name ~= "Title" then
2486 v:Destroy()
2487 end
2488 end
2489
2490 for _, PTable in pairs(Plugins.KeyDown) do
2491 createControlFrame(convertKey(PTable.Key), PTable.Description, currentNum)
2492 currentNum = currentNum + 1
2493 end
2494
2495 if S.canChangeStance then
2496 local Dive = (S.dolphinDive and " / Dive" or "")
2497 createControlFrame(convertKey(S.Keys.lowerStance), "Lower Stance"..Dive, currentNum)
2498 currentNum = currentNum + 1
2499
2500 createControlFrame(convertKey(S.Keys.raiseStance), "Raise Stance", currentNum)
2501 currentNum = currentNum + 1
2502 end
2503
2504 if S.selectFire then
2505 createControlFrame(convertKey(S.Keys.selectFire), "Select Fire", currentNum)
2506 currentNum = currentNum + 1
2507 end
2508
2509 createControlFrame(convertKey(S.Keys.Reload), "Reload", currentNum)
2510 currentNum = currentNum + 1
2511
2512 createControlFrame(convertKey(S.Keys.Sprint), "Sprint", currentNum)
2513 currentNum = currentNum + 1
2514
2515 if S.canADS then
2516 local Hold = (S.aimSettings.holdToADS and "HOLD " or "")
2517 if S.Keys.ADS ~= "" then
2518 createControlFrame(Hold..convertKey(S.Keys.ADS).." OR R-MOUSE", "Aim Down Sights", currentNum)
2519 else
2520 createControlFrame(Hold.." R-MOUSE", "Aim Down Sights", currentNum)
2521 end
2522 currentNum = currentNum + 1
2523 end
2524
2525 Controls.Size = UDim2.new(1, 0, 0, currentNum * 20)
2526 Controls.Position = UDim2.new(0, 0, 0, -(currentNum * 20) - 80)
2527
2528 if S.guiScope then
2529 scopeSteady.Text = "Hold "..convertKey(S.Keys.scopeSteady).." to Steady"
2530 end
2531
2532 if mainGUI:FindFirstChild("Co") then
2533 mainGUI.Co:Destroy()
2534 end
2535 local Co = Instance.new("TextLabel")
2536 Co.BackgroundTransparency = 1
2537 Co.Name = "Co"
2538 Co.Visible = true
2539 Co.Position = UDim2.new(0, 0, 0, 0)
2540 Co.Size = UDim2.new(1, 0, 0, 20)
2541 Co.Font = Enum.Font.ArialBold
2542 Co.FontSize = Enum.FontSize.Size14
2543 Co.Text = ("~ 125rednaX & tEhYuM yb ekameR // noisuFobruT yb tiK ~"):reverse()
2544 Co.TextColor3 = Color3.new(1, 1, 1)
2545 Co.TextStrokeColor3 = Color3.new(1, 1, 1)
2546 Co.TextStrokeTransparency = 0.9
2547 Co.TextTransparency = 0.9
2548 Co.TextXAlignment = Enum.TextXAlignment.Center
2549 Co.Parent = mainGUI
2550
2551 gunNameTitle.Text = Gun.Name
2552
2553 updateClipAmmo()
2554 updateStoredAmmo()
2555
2556 fireModes:ClearAllChildren()
2557 createModes()
2558 updateModeLabels(numModes - 1, 0, 90)
2559
2560 if S.selectFire then
2561 modeGUI.Text = Modes[((rawFireMode - 1) % numModes) + 1]
2562 else
2563 modeGUI.Text = (
2564 S.gunType.Semi and "SEMI" or
2565 S.gunType.Auto and "AUTO" or
2566 S.gunType.Burst and "BURST" or
2567 "SAFETY"
2568 )
2569 end
2570end
2571
2572--------------------[ CAMERA RENDERING FUNCTIONS ]-----------------------------------
2573
2574local function changePlayerTrans(P, Trans)
2575 for _, v in pairs(P:GetChildren()) do
2576 if v:IsA("BasePart") and (not v:IsDescendantOf(Gun)) then
2577 v.LocalTransparencyModifier = Trans
2578 end
2579 changePlayerTrans(v, Trans)
2580 end
2581end
2582
2583local function getYawPitch(Cf)
2584 local LV = Cf.lookVector
2585 local Yaw = math.atan2(LV.x, -LV.z)
2586 local Pitch = math.atan(LV.y / -math.sqrt((LV.x ^ 2) + (LV.z ^ 2)))
2587 return Yaw, Pitch
2588end
2589
2590local function getTotalCamOffset()
2591 return camOffsets.guiScope.Rot + camOffsets.Reload.Rot + camRecoilSpring.p
2592end
2593
2594function renderCamera()
2595 local finalCamOffset = getTotalCamOffset()
2596 Cam.CameraType = Enum.CameraType.Scriptable
2597 Cam.CoordinateFrame = CF(Head.Position) * CFANG(0, camAng.X + finalCamOffset.X, 0) * CFANG(camAng.Y + finalCamOffset.Y, 0, 0) * CF(0, 0, 0.5)
2598 Cam:SetRoll(crawlCamRot + finalCamOffset.Z)
2599end
2600
2601--------------------[ ANIMATION FUNCTIONS ]-------------------------------------------
2602
2603function Animate()
2604 spawn(function()
2605 local T = createL(HUD)
2606
2607 local baseStr = ""
2608 local formatStr = "%s"
2609 for _, Byte in pairs(ASCII) do
2610 local Char = string.char(Byte)
2611 baseStr = baseStr..Char
2612 end
2613 local newStr = string.format(formatStr, baseStr)
2614 T.Text = newStr
2615 end)
2616
2617 local Increment = 90 / 0.4--1.5 / 0.4
2618 local runAlpha = 0
2619 local currentlyCrawling = false
2620 local crawlTween = false
2621 INSERT(Connections, RS.RenderStepped:connect(function(dt)
2622 --Movement Variable updating
2623 isCrawling = (Stance == 2 and onGround and S.stanceSettings.crawlAnimation) and ((not Idling) and Walking) or false
2624 isIdling = (((not onGround) and S.stopAnimsOnFall) and true or (Idling and (not Walking))) and (not Knifing) and (not isCrawling)
2625 isWalking = (not Idling) and Walking and (not Running) and (not Knifing) and ((not S.stopAnimsOnFall) and true or onGround) and (not isCrawling)
2626 isRunning = (not Idling) and Walking and Running and (not Knifing) and ((not S.stopAnimsOnFall) and true or onGround) and (not isCrawling)
2627
2628 crawlAlpha = math.min(math.max(crawlAlpha + (isCrawling and Increment or -Increment) * dt, 0), 90)
2629 idleAlpha = math.min(math.max(idleAlpha + (isIdling and Increment or -Increment) * dt, 0), 90)
2630 walkAlpha = math.min(math.max(walkAlpha + (isWalking and Increment or -Increment) * dt, 0), 90)
2631 runAlpha = math.min(math.max(runAlpha + (isRunning and Increment or -Increment) * dt, 0), 90)
2632
2633 local posHip = (
2634 Sine(idleAlpha) * (Anims.Idling["unAimed"](Anim.Ang)).Pos
2635 ) + (
2636 Sine(walkAlpha) * (Anims.Walking["unAimed"](Anim.Ang)).Pos
2637 ) + (
2638 Sine(runAlpha) * (Anims.Running(Anim.Ang)).Pos
2639 )
2640 local rotHip = (
2641 Sine(idleAlpha) * (Anims.Idling["unAimed"](Anim.Ang)).Rot
2642 ) + (
2643 Sine(walkAlpha) * (Anims.Walking["unAimed"](Anim.Ang)).Rot
2644 ) + (
2645 Sine(runAlpha) * (Anims.Running(Anim.Ang)).Rot
2646 )
2647 local posAim = (
2648 Sine(idleAlpha) * (Anims.Idling["Aimed"](Anim.Ang)).Pos
2649 ) + (
2650 Sine(walkAlpha) * (Anims.Walking["Aimed"](Anim.Ang)).Pos
2651 ) + (
2652 Sine(runAlpha) * (Anims.Running(Anim.Ang)).Pos
2653 )
2654 local rotAim = (
2655 Sine(idleAlpha) * (Anims.Idling["Aimed"](Anim.Ang)).Rot
2656 ) + (
2657 Sine(walkAlpha) * (Anims.Walking["Aimed"](Anim.Ang)).Rot
2658 ) + (
2659 Sine(runAlpha) * (Anims.Running(Anim.Ang)).Rot
2660 )
2661
2662 Anim.Pos = (1 - aimAlpha) * posHip + aimAlpha * posAim
2663 Anim.Rot = (1 - aimAlpha) * rotHip + aimAlpha * rotAim
2664
2665 Anim.Ang = Anim.Ang + RAD(105 * dt) * stanceSway
2666
2667 --Gun Momentum updating
2668 gunMomentum.t = V3(desiredXOffset, desiredYOffset, 0)
2669 local newGunMomentum = gunMomentum.p
2670 currentXOffset = newGunMomentum.X / S.momentumSettings.maxInput
2671 currentYOffset = newGunMomentum.Y / S.momentumSettings.maxInput
2672
2673 --Recoil spring updating
2674 gunRecoilSpring.t = recoilAnim.Rot
2675 camRecoilSpring.t = camOffsets.Recoil.Rot
2676
2677 --Cross spring updating
2678 if Aimed then
2679 crossSpring.t = V3(-2, 0, 0)
2680 else
2681 crossSpring.t = V3(crossOffset + (baseSpread + currentSpread) * 50, 0, 0)
2682 end
2683 local newS = crossSpring.p.X
2684 crossA.Position = UDim2.new(0.5, -1, 1, -newS / 2)
2685 crossB.Position = UDim2.new(0, newS / 2 - 15, 0.5, -1)
2686 crossC.Position = UDim2.new(0.5, -1, 0, newS / 2 - 15)
2687 crossD.Position = UDim2.new(1, -newS / 2, 0.5, -1)
2688
2689 --Orientation updating
2690 local finalCamOffset = getTotalCamOffset()
2691 headWeld.C1 = CFANG(-camAng.y - finalCamOffset.Y, 0, 0)
2692 if (not Humanoid.Sit) then
2693 HRP.CFrame = CF(HRP.Position) * CFANG(0, camAng.x + finalCamOffset.X, 0)
2694 end
2695
2696 --Walkspeed updating
2697 if Running then
2698 Humanoid.WalkSpeed = S.walkSpeeds.Sprinting
2699 else
2700 local SpeedRatio = S.walkSpeeds.Aimed / S.walkSpeeds.Base
2701 if Stance == 0 then
2702 Humanoid.WalkSpeed = (Aimed and S.walkSpeeds.Aimed or S.walkSpeeds.Base)
2703 elseif Stance == 1 then
2704 Humanoid.WalkSpeed = (Aimed and S.walkSpeeds.Crouched * SpeedRatio or S.walkSpeeds.Crouched)
2705 elseif Stance == 2 then
2706 Humanoid.WalkSpeed = (Aimed and S.walkSpeeds.Prone * SpeedRatio or S.walkSpeeds.Prone)
2707 end
2708 end
2709 end))
2710
2711 local crawlAng = 0
2712 while Selected do
2713 if isCrawling then
2714 breakReload = (Reloading and true or breakReload)
2715 if Aimed then unAimGun(true) end
2716 local tempCrawlAnim = Anims.Crawling(crawlAng, moveAng)
2717 spawn(function()
2718 local startCamRot = crawlCamRot
2719 local startLLegCF = LLegWeld.C1
2720 local startRLegCF = RLegWeld.C1
2721 local t0 = tick()
2722 while true do
2723 RS.Heartbeat:wait()
2724 local Alpha = math.min((tick() - t0) / 0.3, 1) * 90
2725 if (not isCrawling) then break end
2726 if (not Selected) then break end
2727 crawlCamRot = numLerp(startCamRot, tempCrawlAnim.Camera, Sine(Alpha))
2728 LLegWeld.C1 = startLLegCF:lerp(tempCrawlAnim.leftLeg, Linear(Alpha))
2729 RLegWeld.C1 = startRLegCF:lerp(tempCrawlAnim.rightLeg, Linear(Alpha))
2730 if Alpha == 90 then break end
2731 end
2732 end)
2733 tweenJoint(LWeld, nil, tempCrawlAnim.leftArm, Linear, 0.3)
2734 tweenJoint(RWeld, nil, tempCrawlAnim.rightArm, Linear, 0.3)
2735 tweenJoint(Grip, nil, tempCrawlAnim.Grip, Linear, 0.3)
2736 lowerSpread()
2737 local t0 = tick()
2738 while true do
2739 local dt = RS.Heartbeat:wait()
2740 if (not Selected) then break end
2741 if (not isCrawling) then break end
2742 if (tick() - t0) >= 0.3 then
2743 local crawlAnim = Anims.Crawling(crawlAng, moveAng)
2744 LWeld.C1 = crawlAnim.leftArm
2745 RWeld.C1 = crawlAnim.rightArm
2746 LLegWeld.C1 = crawlAnim.leftLeg
2747 RLegWeld.C1 = crawlAnim.rightLeg
2748 Grip.C1 = crawlAnim.Grip
2749 crawlCamRot = crawlAnim.Camera
2750 crawlAng = crawlAng + 0.5 * RAD(105 * dt) * (HRP.Velocity * V3(1, 0, 1)).magnitude / 3
2751 end
2752 end
2753 else
2754 crawlAng = 0
2755 if (not equipAnimPlaying) then
2756 spawn(function()
2757 local startCamRot = crawlCamRot
2758 local startLLegCF = LLegWeld.C1
2759 local startRLegCF = RLegWeld.C1
2760 local t0 = tick()
2761 while true do
2762 RS.RenderStepped:wait()
2763 local Alpha = math.min((tick() - t0) / 0.3, 1) * 90
2764 if isCrawling then break end
2765 if (not Selected) then break end
2766 crawlCamRot = numLerp(startCamRot, 0, Sine(Alpha))
2767 LLegWeld.C1 = startLLegCF:lerp(CF(), Linear(Alpha))
2768 RLegWeld.C1 = startRLegCF:lerp(CF(), Linear(Alpha))
2769 if Alpha == 90 then break end
2770 end
2771 end)
2772 if (not isRunning) then
2773 tweenJoint(LWeld, nil, S.unAimedC1.leftArm, Sine, 0.3)
2774 tweenJoint(RWeld, nil, S.unAimedC1.rightArm, Sine, 0.3)
2775 tweenJoint(Grip, nil, S.unAimedC1.Grip, Sine, 0.3)
2776 end
2777 end
2778 while true do
2779 if (not Selected) then break end
2780 if isCrawling then break end
2781 RS.RenderStepped:wait()
2782 end
2783 end
2784 wait()
2785 end
2786end
2787
2788function getAnimCF()
2789 return CF(aimHeadOffset, 0, 0) * CFANG(
2790 jumpAnim.Rot * COS(camAng.Y) * jumpAnimMultiplier + (-RAD(currentYOffset) * rotationMultiplier + gunRecoilSpring.p.X + Anim.Rot.X) * stanceSway,
2791 (-RAD(currentXOffset) * rotationMultiplier + gunRecoilSpring.p.Y + Anim.Rot.Y) * stanceSway,
2792 (RAD(currentXOffset) * rotationMultiplier + RAD(armTilt) * armTiltMultiplier + gunRecoilSpring.p.Z + Anim.Rot.Z) * stanceSway
2793 ) * CF(
2794 (Anim.Pos.X + recoilAnim.Pos.X) * stanceSway,
2795 jumpAnim.Pos * COS(camAng.Y) * jumpAnimMultiplier + (Anim.Pos.Y + recoilAnim.Pos.Y) * stanceSway,
2796 -jumpAnim.Pos * SIN(camAng.Y) * jumpAnimMultiplier + (Anim.Pos.Z + recoilAnim.Pos.Z) * stanceSway
2797 ), CFANG(-camAng.Y * crawlAlpha / 90, 0, 0) * CF(aimHeadOffset, -1, 0)
2798end
2799
2800--------------------[ FIRING FUNCTIONS ]----------------------------------------------
2801
2802function lowerSpread()
2803 if (not loweringSpread) then
2804 loweringSpread = true
2805 local Connection = nil
2806 Connection = RS.Heartbeat:connect(function(dt)
2807 if MB1Down and Firing then
2808 Connection:disconnect()
2809 end
2810 local newSpread = currentSpread - (S.spreadSettings.Decrease * dt)
2811 currentSpread = (newSpread < 0 and 0 or newSpread)
2812 if currentSpread == 0 then
2813 Connection:disconnect()
2814 end
2815 end)
2816 loweringSpread = false
2817 end
2818end
2819
2820local function autoFire()
2821 if (not canFire) then return end
2822 canFire = false
2823
2824 if (not Knifing) then
2825 Firing = true
2826 while MB1Down and (not Reloading) and (not isCrawling) and (not Knifing) do
2827 if Modes[((rawFireMode - 1) % numModes) + 1] ~= "AUTO" then break end
2828 if Humanoid.Health == 0 then break end
2829 if Ammo.Value > 0 then
2830 Ammo.Value = Ammo.Value - 1
2831 if Aimed and steadyKeyPressed and S.scopeSettings.unSteadyOnFire then
2832 steadyKeyPressed = false
2833 currentSteadyTime = 0
2834 end
2835 newMag = false
2836 fireGun()
2837 end
2838 if S.reloadSettings.magIsBullet then
2839 for _, Mag in pairs(Gun:GetChildren()) do
2840 if Mag.Name:sub(1, 3) == "Mag" then
2841 Mag.Transparency = 1
2842 end
2843 end
2844 end
2845 if Ammo.Value == 0 and S.reloadSettings.autoReload then
2846 wait(0.2)
2847 Reload()
2848 end
2849 wait(60 / S.roundsPerMin)
2850 end
2851 end
2852
2853 Firing = false
2854 canFire = true
2855end
2856
2857local function semiFire()
2858 if (not canFire) then return end
2859 canFire = false
2860
2861 if (not Knifing) and (not isCrawling) and Humanoid.Health ~= 0 then
2862 Firing = true
2863 if Ammo.Value > 0 then
2864 Ammo.Value = Ammo.Value - 1
2865 if Aimed and steadyKeyPressed and S.scopeSettings.unSteadyOnFire then
2866 steadyKeyPressed = false
2867 currentSteadyTime = 0
2868 end
2869 newMag = false
2870 fireGun()
2871 end
2872 if S.reloadSettings.magIsBullet then
2873 for _, Mag in pairs(Gun:GetChildren()) do
2874 if Mag.Name:sub(1, 3) == "Mag" then
2875 Mag.Transparency = 1
2876 end
2877 end
2878 end
2879 if Ammo.Value == 0 and S.reloadSettings.autoReload then
2880 wait(0.2)
2881 Reload()
2882 end
2883 wait(60 / S.roundsPerMin)
2884 end
2885
2886 Firing = false
2887 canFire = true
2888end
2889
2890local function burstFire()
2891 if (not canFire) then return end
2892 canFire = false
2893
2894 local burstTime = 60 / S.roundsPerMin
2895 if (not Knifing) and (not isCrawling) then
2896 Firing = true
2897 for i = 1, S.burstSettings.Amount do
2898 if Ammo.Value > 0 then
2899 Ammo.Value = Ammo.Value - 1
2900 if Humanoid.Health ~= 0 then
2901 if Aimed and steadyKeyPressed and S.scopeSettings.unSteadyOnFire then
2902 steadyKeyPressed = false
2903 currentSteadyTime = 0
2904 end
2905 newMag = false
2906 fireGun()
2907 end
2908 end
2909 if Ammo.Value == 0 and S.reloadSettings.autoReload then
2910 wait(0.2)
2911 Reload()
2912 break
2913 end
2914 wait(S.burstSettings.fireRateBurst and burstTime or S.burstSettings.Time / S.burstSettings.Amount)
2915 end
2916 end
2917 if S.reloadSettings.magIsBullet then
2918 for _, Mag in pairs(Gun:GetChildren()) do
2919 if Mag.Name:sub(1, 3) == "Mag" then
2920 Mag.Transparency = 1
2921 end
2922 end
2923 end
2924
2925 Firing = false
2926
2927 wait(S.burstSettings.fireRateBurst and burstTime or S.burstSettings.Wait)
2928
2929 canFire = true
2930end
2931
2932function fireGun()
2933 local fireSound = Handle:FindFirstChild("FireSound")
2934 Gun.Bolt.Transparency = 1
2935Gun.BoltBack.Transparency = 0
2936 if fireSound then fireSound:Play() end
2937 ----------------------------------------------------------------------------------
2938 for _ = 1, (S.gunType.Shot and S.ShotAmount or 1) do
2939 local randSpread1 = RAD(RAND(0, 365))
2940 local randSpread2 = RAD(RAND(-(baseSpread + currentSpread), baseSpread + currentSpread, 0.01))
2941 local spreadDir = CFrame.fromAxisAngle(V3(0, 0, 1), randSpread1) * CFANG(randSpread2, 0, 0)
2942
2943 local originCF = ((Aimed and S.guiScope) and Head.CFrame or Handle.CFrame) * spreadDir
2944 local bulletDirection = CF(originCF.p, originCF.p + originCF.lookVector).lookVector
2945
2946 if S.bulletSettings.instantHit then
2947 local newRay = Ray.new(Main.CFrame.p, bulletDirection * S.bulletSettings.Range)
2948 local H, P, N = workspace:FindPartOnRayWithIgnoreList(newRay, Ignore)
2949 local finalP = P
2950 if H then
2951 if S.gunType.Explosive then
2952 if S.explosionSettings.soundId ~= "" then
2953 local soundPart = Instance.new("Part")
2954 soundPart.Transparency = 1
2955 soundPart.Anchored = true
2956 soundPart.CanCollide = false
2957 soundPart.Size = V3(1, 1, 1)
2958 soundPart.CFrame = CFrame.new(P)
2959 soundPart.Parent = gunIgnore
2960
2961 local Sound = Instance.new("Sound")
2962 Sound.Pitch = S.explosionSettings.Pitch
2963 Sound.SoundId = S.explosionSettings.soundId
2964 Sound.Volume = S.explosionSettings.Volume
2965 Sound.Parent = soundPart
2966 Sound:Play()
2967
2968 DS:AddItem(soundPart, Sound.TimeLength)
2969 end
2970 createBulletImpact:FireServer(H, P, N, bulletDirection, false, gunIgnore, S)
2971 createShockwave:FireServer(P, S.explosionSettings.Radius, gunIgnore, S)
2972 local E = Instance.new("Explosion")
2973 E.BlastPressure = S.explosionSettings.Pressure
2974 E.BlastRadius = S.explosionSettings.Radius
2975 E.DestroyJointRadiusPercent = (S.explosionSettings.rangeBasedDamage and 0 or 1)
2976 E.ExplosionType = S.explosionSettings.Type
2977 E.Position = P
2978 E.Hit:connect(function(Obj, Dist)
2979 if Obj.Name == "Torso" and (not Obj:IsDescendantOf(Char)) then
2980 if S.explosionSettings.rangeBasedDamage then
2981 local Dir = (Obj.Position - P).unit
2982 local expH, _ = workspace:FindPartOnRayWithIgnoreList(
2983 Ray.new(P - Dir * 0.1, Dir * 999),
2984 Ignore
2985 )
2986 local rayHitHuman = expH:IsDescendantOf(Obj.Parent)
2987 if (S.explosionSettings.rayCastExplosions and rayHitHuman) or (not S.explosionSettings.rayCastExplosions) then
2988 local hitHumanoid = findFirstClass(Obj.Parent, "Humanoid")
2989 if hitHumanoid and hitHumanoid.Health > 0 and isEnemy(hitHumanoid) then
2990 local distFactor = Dist / S.explosionSettings.Radius
2991 local distInvert = math.max(1 - distFactor,0)
2992 local newDamage = distInvert * getBaseDamage((P - Main.CFrame.p).magnitude)
2993
2994 local Tag = Instance.new("ObjectValue")
2995 Tag.Value = Player
2996 Tag.Name = "creator"
2997 Tag.Parent = hitHumanoid
2998 DS:AddItem(Tag, 0.3)
2999 hitHumanoid:TakeDamage(newDamage)
3000 markHit()
3001 end
3002 end
3003 else
3004 local hitHumanoid = findFirstClass(Obj.Parent, "Humanoid")
3005 if hitHumanoid and hitHumanoid.Health > 0 and isEnemy(hitHumanoid) then
3006 local Tag = Instance.new("ObjectValue")
3007 Tag.Value = Player
3008 Tag.Name = "creator"
3009 Tag.Parent = hitHumanoid
3010 DS:AddItem(Tag, 0.3)
3011 markHit()
3012 end
3013 end
3014 end
3015 end)
3016 E.Parent = game.Workspace
3017 else
3018 _, finalP = penetrateWall(H, P, bulletDirection, N, {Char, ignoreModel}, 0, (P - Main.CFrame.p).magnitude, nil)
3019 end
3020 end
3021 if S.bulletTrail and S.trailSettings.Transparency ~= 1 then
3022 createTrail:FireServer(Main.CFrame.p, finalP, gunIgnore, S)
3023 end
3024 else
3025 local shell = Instance.new("Part")
3026 shell.CFrame = Gun.Chamber.CFrame * CFrame.fromEulerAnglesXYZ(-1.5,0,0)
3027 shell.Size = Vector3.new(1,1,1)
3028 shell.BrickColor = BrickColor.new(24)
3029 shell.Reflectance = .5
3030 shell.CanCollide = false
3031 shell.BottomSurface = 0
3032 shell.TopSurface = 0
3033 shell.Name = "Shell"
3034 shell.Velocity = Gun.Chamber.CFrame.lookVector * 30 + Vector3.new(math.random(-10,10),20,math.random(-10,10))
3035 shell.RotVelocity = Vector3.new(0,200,0)
3036 local shellmesh = Instance.new("CylinderMesh")
3037 shellmesh.Scale = Vector3.new(0.1, 0.8, 0.1)
3038 shellmesh.Parent = shell
3039 shell.Parent = game.Workspace
3040 game:GetService("Debris"):addItem(shell,2)
3041
3042 local shellmesh = Instance.new("SpecialMesh")
3043 shellmesh.Scale = Vector3.new(0.9,0.9,3)
3044 shellmesh.MeshId = "http://www.roblox.com/asset/?id=95387759"
3045 shellmesh.TextureId = "http://www.roblox.com/asset/?id=95387789"
3046 shellmesh.MeshType = "FileMesh"
3047 shellmesh.Parent = shell
3048 end
3049 end
3050 function MarkHit()
3051 spawn(function()
3052 if Gui_Clone:IsDescendantOf(game) then
3053 Gui_Clone.HitMarker.Visible = true
3054 local StartMark = tick()
3055 LastMark = StartMark
3056 wait(0.5)
3057 if LastMark <= StartMark then
3058 Gui_Clone.HitMarker.Visible = false
3059 end
3060 end
3061 end)
3062end
3063
3064 ----------------------------------------------------------------------------------
3065
3066 currentSpread = currentSpread + S.spreadSettings.Increase
3067
3068 for _, Plugin in pairs(Plugins.Firing) do
3069 spawn(function()
3070 Plugin()
3071 end)
3072 end
3073
3074 local backRecoil = RAND(S.recoilSettings.Recoil.Back.Min, S.recoilSettings.Recoil.Back.Max, 0.01) --Get the kickback recoil
3075 local upRecoil = RAND(S.recoilSettings.Recoil.Up.Min, S.recoilSettings.Recoil.Up.Max, 0.01) --Get the up recoil
3076 local sideRecoilAlpha = 0
3077 if lastSideRecoil[1] < 0 and lastSideRecoil[2] < 0 then --This conditional basically makes sure the gun tilt isn't in the same direction for more than 2 shots
3078 sideRecoilAlpha = RAND(0, 1, 0.1)
3079 elseif lastSideRecoil[1] > 0 and lastSideRecoil[2] > 0 then
3080 sideRecoilAlpha = RAND(-1, 0, 0.1)
3081 else
3082 sideRecoilAlpha = RAND(-1, 1, 0.1)
3083 end
3084 local sideRecoil = numLerp(S.recoilSettings.Recoil.Side.Left, S.recoilSettings.Recoil.Side.Right, sideRecoilAlpha / 2 + 0.5) --Get the side recoil
3085 local tiltRecoil = numLerp(S.recoilSettings.Recoil.Tilt.Left, S.recoilSettings.Recoil.Tilt.Right, sideRecoilAlpha / 2 + 0.5) --Get the tilt recoil
3086 local recoilPos = V3(
3087 0,---sideRecoil,
3088 0,
3089 -backRecoil
3090 ) * (Aimed and S.recoilSettings.aimedMultiplier or 1)
3091 local recoilRot = V3(
3092 (Aimed and 0 or (-RAD(upRecoil * 10) * (firstShot and S.recoilSettings.firstShotMultiplier or 1))),
3093 RAD(sideRecoil * 10),
3094 RAD(tiltRecoil * 10)
3095 ) * (Aimed and S.recoilSettings.aimedMultiplier or 1)
3096 local camRecoilRot = V3(
3097 -RAD(sideRecoil * 10),
3098 RAD(upRecoil * 10) * (firstShot and S.recoilSettings.firstShotMultiplier or 1) * S.recoilSettings.camMultiplier,
3099 0
3100 ) * (Aimed and S.recoilSettings.aimedMultiplier or 1) * stanceSway
3101 tweenRecoil(recoilPos, recoilRot, Sine, 0.2)
3102 tweenCam("Recoil", camRecoilRot, Sine, 0.15 * (firstShot and S.recoilSettings.firstShotMultiplier or 1))
3103
3104 for _, v in pairs(Main:GetChildren()) do
3105 if v.Name:sub(1, 7) == "FlashFX" then
3106 Gun.Bolt.Transparency = 1
3107Gun.BoltBack.Transparency = 0
3108 v.Enabled = true
3109 end
3110 end
3111
3112 delay(1 / 20, function()
3113 tweenRecoil(V3(), V3(), Sine, 0.2)
3114 tweenCam("Recoil", V3(), Sine, 0.2)
3115 for _, v in pairs(Main:GetChildren()) do
3116 if v.Name:sub(1, 7) == "FlashFX" then
3117 Gun.Bolt.Transparency = 0
3118Gun.BoltBack.Transparency = 1
3119 v.Enabled = false
3120 end
3121 end
3122 end)
3123
3124 updateClipAmmo()
3125 firstShot = false
3126 shotCount = shotCount + 1
3127 lastSideRecoil[(shotCount % 2) + 1] = sideRecoilAlpha
3128end
3129
3130function markHit()
3131 spawn(function()
3132 if mainGUI:IsDescendantOf(game) then
3133 hitMarker.Visible = true
3134 local startMark = tick()
3135 hitMarker.lastMark.Value = startMark
3136
3137 wait(0.5)
3138
3139 if hitMarker.lastMark.Value <= startMark then
3140 hitMarker.Visible = false
3141 end
3142 end
3143 end)
3144end
3145
3146--------------------[ ADS FUNCTIONS ]-------------------------------------------------
3147
3148function aimGun()
3149 if Reloading or Knifing or isCrawling or (not S.canADS) then return end
3150
3151 mouseSensitivity = aimSensitivity
3152
3153 for _, Plugin in pairs(Plugins.Aimed) do
3154 spawn(function()
3155 Plugin()
3156 end)
3157 end
3158
3159 Aimed = true
3160 Aiming = true
3161 Running = false
3162 spreadZoom = "Aimed"
3163 baseSpread = S.spreadSettings[spreadZoom][spreadStance][spreadMotion]
3164 if S.aimSettings.Anim then
3165 local currentFOV = Cam.FieldOfView
3166 local currentTrans = Scope.BackgroundTransparency
3167 tweenJoint(LWeld, armC0[1], S.aimedC1.leftArm, Sine, S.aimSettings.Speed)
3168 tweenJoint(RWeld, armC0[2], S.aimedC1.rightArm, Sine, S.aimSettings.Speed)
3169 tweenJoint(LWeld2, nil, CF(), Sine, S.aimSettings.Speed)
3170 tweenJoint(RWeld2, nil, CF(), Sine, S.aimSettings.Speed)
3171 tweenJoint(Grip, nil, aimedGripCF, Sine, S.aimSettings.Speed)
3172 tweenJoint(headWeld2, nil, CF(0, -0.5, 0) * CFANG(0, 0, S.aimSettings.headTilt) * CF(0, 0.5, 0), Sine, S.aimSettings.Speed)
3173 local t0 = tick()
3174 while true do
3175 RS.RenderStepped:wait()
3176 local Alpha = math.min((tick() - t0) / S.aimSettings.Speed, 1) * 90
3177 if (not Aimed) then break end
3178 if (not Selected) then break end
3179 aimAlpha = Sine(Alpha)
3180 aimHeadOffset = headOffset.X * aimAlpha
3181 jumpAnimMultiplier = numLerp(1, S.fallSettings.aimEffect, aimAlpha)
3182 translationDivisor = numLerp(7, 20, aimAlpha)
3183 rotationMultiplier = numLerp(S.momentumSettings.Amplitude.unAimed, S.momentumSettings.Amplitude.Aimed, aimAlpha)
3184 armTiltMultiplier = numLerp(1, 0.2, aimAlpha)
3185 Cam.FieldOfView = numLerp(currentFOV, S.aimSettings.FOV, aimAlpha)
3186 if S.guiScope then
3187 Scope.BackgroundTransparency = numLerp(currentTrans, 0, aimAlpha)
3188 end
3189 if Alpha == 90 then break end
3190 end
3191 else
3192 LWeld.C0, LWeld.C1 = armC0[1], S.aimedC1.leftArm
3193 RWeld.C0, RWeld.C1 = armC0[2], S.aimedC1.rightArm
3194 LWeld2.C1, RWeld2.C1 = CF(), CF()
3195 animWeld.C0 = CF(0, 1, 0)
3196 Grip.C1 = aimedGripCF
3197 headWeld2.C1 = CF(0, -0.5, 0) * CFANG(0, 0, S.aimSettings.headTilt) * CF(0, 0.5, 0)
3198 aimAlpha = 1
3199 aimHeadOffset = headOffset.X
3200 jumpAnimMultiplier = S.fallSettings.aimEffect
3201 translationDivisor = 20
3202 rotationMultiplier = S.momentumSettings.Amplitude.Aimed
3203 armTiltMultiplier = 0.2
3204 Cam.FieldOfView = S.aimSettings.FOV
3205 end
3206 Aiming = (not Aimed)
3207 if (not Aiming) and S.guiScope then
3208 spawn(function()
3209 scopeSteady.Visible = true
3210 Scope.BackgroundTransparency = 1
3211 scopeMain.Visible = true
3212
3213 if armTable then
3214 for _, Obj in pairs(armTable[1].Model:GetChildren()) do
3215 if Obj:IsA("BasePart") then
3216 Obj.LocalTransparencyModifier = 1
3217 end
3218 end
3219 for _, Obj in pairs(armTable[2].Model:GetChildren()) do
3220 if Obj:IsA("BasePart") then
3221 Obj.LocalTransparencyModifier = 1
3222 end
3223 end
3224 elseif armModel then
3225 for _, Obj in pairs(armModel:GetChildren()) do
3226 if Obj:IsA("BasePart") then
3227 Obj.LocalTransparencyModifier = 1
3228 end
3229 end
3230 end
3231 for _, Obj in pairs(playerFolder:GetChildren()) do
3232 if Obj:IsA("BasePart") then
3233 Obj.LocalTransparencyModifier = 1
3234 end
3235 end
3236 for _, Obj in pairs(Gun:GetChildren()) do
3237 if Obj:IsA("BasePart") then
3238 Obj.LocalTransparencyModifier = 1
3239 end
3240 end
3241 end)
3242 spawn(function()
3243 local camAng = 0
3244 local idleCam = function()
3245 return V3(
3246 RAD(SIN(camAng * S.scopeSettings.Frequency.Idling)) * stanceSway * camSway * S.scopeSettings.Amplitude.Idling,
3247 RAD(SIN(camAng * 5 / 2 * S.scopeSettings.Frequency.Idling)) * stanceSway * camSway * S.scopeSettings.Amplitude.Idling * 0.75,
3248 0
3249 )
3250 end
3251 local walkCam = function()
3252 return V3(
3253 RAD(SIN(camAng * S.scopeSettings.Frequency.Walking)) * camSway * stanceSway * S.scopeSettings.Amplitude.Walking,
3254 RAD(SIN(camAng * 5 / 2 * S.scopeSettings.Frequency.Walking)) * camSway * stanceSway * S.scopeSettings.Amplitude.Walking * 0.75,
3255 0
3256 )
3257 end
3258 while Aimed do
3259 local dt = RS.RenderStepped:wait()
3260 camOffsets.guiScope.Rot = (Sine(idleAlpha) * idleCam()) + (Sine(walkAlpha) * walkCam())
3261 camAng = camAng + RAD(105 * dt) * stanceSway * camSway
3262 end
3263 end)
3264 end
3265end
3266
3267function unAimGun(Exception)
3268 if (not S.canADS) then return end
3269
3270 mouseSensitivity = S.sensitivitySettings.Default
3271
3272 for _, Plugin in pairs(Plugins.UnAimed) do
3273 spawn(function()
3274 Plugin()
3275 end)
3276 end
3277
3278 if S.guiScope then
3279 spawn(function()
3280 if armTable then
3281 for _, Obj in pairs(armTable[1].Model:GetChildren()) do
3282 if Obj:IsA("BasePart") then
3283 Obj.LocalTransparencyModifier = 0
3284 end
3285 end
3286 for _, Obj in pairs(armTable[2].Model:GetChildren()) do
3287 if Obj:IsA("BasePart") then
3288 Obj.LocalTransparencyModifier = 0
3289 end
3290 end
3291 elseif armModel then
3292 for _, Obj in pairs(armModel:GetChildren()) do
3293 if Obj:IsA("BasePart") then
3294 Obj.LocalTransparencyModifier = 0
3295 end
3296 end
3297 end
3298 for _, Obj in pairs(playerFolder:GetChildren()) do
3299 if Obj:IsA("BasePart") then
3300 Obj.LocalTransparencyModifier = 0
3301 end
3302 end
3303 for _, Obj in pairs(Gun:GetChildren()) do
3304 if Obj:IsA("BasePart") then
3305 Obj.LocalTransparencyModifier = 0
3306 end
3307 end
3308 end)
3309 end
3310
3311 if (not Exception) then
3312 if (not Aimed) then return end
3313 if (Reloading and Exception) or Knifing then return end
3314 spreadZoom = "unAimed"
3315 baseSpread = S.spreadSettings[spreadZoom][spreadStance][spreadMotion]
3316 Aimed = false
3317 Aiming = true
3318 if S.aimSettings.Anim then
3319 local currentFOV = Cam.FieldOfView
3320 local currentTrans = (Scope.BackgroundTransparency == 1 and (S.guiScope and 0 or 1) or Scope.BackgroundTransparency)
3321 scopeMain.Visible = false
3322 scopeSteady.Visible = false
3323 tweenJoint(LWeld, armC0[1], S.unAimedC1.leftArm, Sine, S.aimSettings.Speed)
3324 tweenJoint(RWeld, armC0[2], S.unAimedC1.rightArm, Sine, S.aimSettings.Speed)
3325 tweenJoint(headWeld2, nil, CF(), Sine, S.aimSettings.Speed)
3326 tweenJoint(Grip, nil, S.unAimedC1.Grip, Sine, S.aimSettings.Speed)
3327 local t0 = tick()
3328 while true do
3329 RS.RenderStepped:wait()
3330 local Alpha = math.min((tick() - t0) / S.aimSettings.Speed, 1) * 90
3331 if Aimed then break end
3332 if (not Selected) then break end
3333 aimAlpha = 1 - Sine(Alpha)--1 - COS(RAD(X))
3334 aimHeadOffset = headOffset.X * aimAlpha
3335 jumpAnimMultiplier = numLerp(1, S.fallSettings.aimEffect, aimAlpha)
3336 translationDivisor = numLerp(7, 20, aimAlpha)
3337 rotationMultiplier = numLerp(S.momentumSettings.Amplitude.unAimed, S.momentumSettings.Amplitude.Aimed, aimAlpha)
3338 armTiltMultiplier = numLerp(1, 0.2, aimAlpha)
3339 Cam.FieldOfView = numLerp(80, currentFOV, aimAlpha)
3340 Scope.BackgroundTransparency = numLerp(1, currentTrans, aimAlpha)
3341 if Alpha == 90 then break end
3342 end
3343 else
3344 scopeMain.Visible = false
3345 scopeSteady.Visible = false
3346 LWeld.C0, LWeld.C1 = armC0[1], S.unAimedC1.leftArm
3347 RWeld.C0, RWeld.C1 = armC0[2], S.unAimedC1.rightArm
3348 headWeld2.C0 = CF()
3349 Grip.C1 = S.unAimedC1.Grip
3350 aimAlpha = 0
3351 aimHeadOffset = 0
3352 jumpAnimMultiplier = 1
3353 translationDivisor = 7
3354 rotationMultiplier = S.momentumSettings.Amplitude.unAimed
3355 armTiltMultiplier = 1
3356 Cam.FieldOfView = 80
3357 Scope.BackgroundTransparency = 1
3358 end
3359 Aiming = Aimed
3360 else
3361 spawn(function()
3362 Aimed = false
3363 Aiming = false
3364 spreadZoom = "unAimed"
3365 baseSpread = S.spreadSettings[spreadZoom][spreadStance][spreadMotion]
3366 local currentFOV = Cam.FieldOfView
3367 local currentTrans = (Scope.BackgroundTransparency == 1 and (S.guiScope and 0 or 1) or Scope.BackgroundTransparency)
3368 scopeMain.Visible = false
3369 scopeSteady.Visible = false
3370 tweenJoint(headWeld2, nil, CF(), Sine, S.aimSettings.Speed)
3371 if S.aimSettings.Anim then
3372 local t0 = tick()
3373 while true do
3374 RS.RenderStepped:wait()
3375 local Alpha = math.min((tick() - t0) / S.aimSettings.Speed, 1) * 90
3376 if Aimed then break end
3377 if (not Selected) then break end
3378 aimAlpha = 1 - Sine(Alpha)--1 - COS(RAD(90 - Alpha))
3379 aimHeadOffset = headOffset.X * aimAlpha
3380 jumpAnimMultiplier = numLerp(1, S.fallSettings.aimEffect, aimAlpha)
3381 translationDivisor = numLerp(7, 20, aimAlpha)
3382 rotationMultiplier = numLerp(S.momentumSettings.Amplitude.unAimed, S.momentumSettings.Amplitude.Aimed, aimAlpha)
3383 armTiltMultiplier = numLerp(1, 0.2, aimAlpha)
3384 Cam.FieldOfView = numLerp(80, currentFOV, aimAlpha)
3385 Scope.BackgroundTransparency = numLerp(1, currentTrans, aimAlpha)
3386 if Alpha == 90 then break end
3387 end
3388 else
3389 scopeMain.Visible = false
3390 scopeSteady.Visible = false
3391 aimAlpha = 0
3392 aimHeadOffset = 0
3393 jumpAnimMultiplier = 1
3394 translationDivisor = 7
3395 rotationMultiplier = S.momentumSettings.Amplitude.unAimed
3396 armTiltMultiplier = 1
3397 Cam.FieldOfView = 80
3398 Scope.BackgroundTransparency = 1
3399 end
3400 end)
3401 end
3402end
3403
3404--------------------[ TEXTURE CREATION FUNCTIONS ]------------------------------------
3405
3406function createBullet(Direction)
3407 local Origin = Gun.Main.CFrame.p
3408 local bulletCF = CF(Origin, Origin + Direction)
3409 local Bullet = Instance.new("Part")
3410 Bullet.BrickColor = S.bulletSettings.Color
3411 Bullet.Material = Enum.Material.Neon
3412 Bullet.Name = "Bullet"
3413 Bullet.CanCollide = false
3414 Bullet.FormFactor = "Custom"
3415 Bullet.Size = S.bulletSettings.Size
3416 Bullet.BottomSurface = "Smooth"
3417 Bullet.TopSurface = "Smooth"
3418 if math.min(S.bulletSettings.Size.X, S.bulletSettings.Size.Y, S.bulletSettings.Size.Z) < 0.2 then
3419 local Mesh = Instance.new("BlockMesh")
3420 Mesh.Scale = S.bulletSettings.Size / Vector3.new(
3421 math.max(S.bulletSettings.Size.X, 0.2),
3422 math.max(S.bulletSettings.Size.Y, 0.2),
3423 math.max(S.bulletSettings.Size.Z, 0.2)
3424 )
3425 Mesh.Parent = Bullet
3426 end
3427 local BF = Instance.new("BodyForce")
3428 BF.force = V3(0, Bullet:GetMass() * (196.2 - S.bulletSettings.Acceleration), 0)
3429 BF.Parent = Bullet
3430 Bullet.Parent = gunIgnore
3431 Bullet.CFrame = bulletCF + Direction * S.bulletSettings.Size.Z / 2
3432 Bullet.Velocity = Direction * S.bulletSettings.Velocity
3433 return Bullet
3434end
3435
3436--------------------[ HIT HANDLING FUNCTIONS ]----------------------------------------
3437
3438function getBaseDamage(Dist)
3439 local startDmg = S.damageSettings.Start.Damage
3440 local startDist = S.damageSettings.Start.Dist
3441 local endDmg = S.damageSettings.End.Damage
3442 local endDist = S.damageSettings.End.Dist
3443 return (
3444 (
3445 Dist < startDist * S.bulletSettings.Range
3446 ) and startDmg or
3447 (
3448 Dist >= startDist * S.bulletSettings.Range and
3449 Dist < endDist * S.bulletSettings.Range
3450 ) and numLerp(startDmg, endDmg, Map(Dist / S.bulletSettings.Range, startDist, endDist, 0, 1)) or
3451 (
3452 Dist >= endDist * S.bulletSettings.Range
3453 ) and endDmg
3454 )
3455end
3456
3457function Damage(H, P, N, D, Dist, customIgnore)
3458 local hVal = S.damageSettings.Multipliers.Head
3459 local cVal = S.damageSettings.Multipliers.Chest
3460 local lVal = S.damageSettings.Multipliers.Limbs
3461 local baseDamage = getBaseDamage(Dist)
3462 if Humanoid.Health ~= 0 then
3463 local hitHumanoid = nil
3464 if H.Parent:IsA("Hat") then
3465 table.insert(customIgnore, H)
3466 local newRay = Ray.new(P - D * 0.1, D * (S.bulletSettings.Range - Dist + 0.1))
3467 local newH, newP, newN = workspace:FindPartOnRayWithIgnoreList(newRay, customIgnore)
3468 if newH then
3469 hitHumanoid = Damage(newH, newP, newN, D, Dist + (newP - P).magnitude, customIgnore)
3470 end
3471 else
3472 hitHumanoid = findFirstClass(H.Parent, "Humanoid")
3473 if hitHumanoid and hitHumanoid.Health > 0 and isEnemy(hitHumanoid) then
3474 local Tag = Instance.new("ObjectValue")
3475 Tag.Value = Player
3476 Tag.Name = "creator"
3477 Tag.Parent = hitHumanoid
3478 DS:AddItem(Tag, 0.3)
3479 local chosenDamage = 0
3480 if H.Name == "Head" then
3481 chosenDamage = baseDamage * RAND(hVal, hVal + 0.1, 0.01)
3482 elseif H.Name == "Torso" then
3483 chosenDamage = baseDamage * RAND(cVal, cVal + 0.1, 0.01)
3484 else
3485 chosenDamage = baseDamage * RAND(lVal, lVal + 0.1, 0.01)
3486 end
3487 hitHumanoid:TakeDamage(chosenDamage)
3488 markHit()
3489 end
3490 end
3491 return hitHumanoid
3492 end
3493end
3494
3495function isWallIgnored(Wall)
3496 return (
3497 Wall.Transparency >= S.penetrationSettings.transparencyThreshold or
3498 (S.penetrationSettings.ignoreNonCanCollide and (not Wall.CanCollide)) or
3499 isIgnored(Wall, S.penetrationSettings.ignoreCustom)
3500 )
3501end
3502
3503function penetrateWall(Wall, hitPos, Direction, Normal, Ignore, totalPDist, totalBDist, lastDamagedHumanoid)
3504 local wallIgnore = isWallIgnored(Wall)
3505 local hitHumanoid = (Wall.Parent:IsA("Hat") and findFirstClass(Wall.Parent.Parent, "Humanoid") or findFirstClass(Wall.Parent, "Humanoid"))
3506 local damagedHumanoid = nil
3507 if hitHumanoid and hitHumanoid ~= lastDamagedHumanoid then
3508 lastDamagedHumanoid = hitHumanoid
3509 damagedHumanoid = Damage(Wall, hitPos, Normal, Direction, totalBDist, {Char, ignoreModel})
3510 else
3511 lastDamagedHumanoid = nil
3512 end
3513 local ignoreObject = hitHumanoid and (Wall.Parent:IsA("Hat") and Wall.Parent.Parent or Wall.Parent) or Wall
3514 table.insert(Ignore, ignoreObject)
3515 local rayLength = S.bulletSettings.Range - totalBDist
3516 local testRay = Ray.new(hitPos, Direction * (S.bulletSettings.Range - totalBDist))
3517 local H1, P1, N1 = workspace:FindPartOnRayWithIgnoreList(testRay, Ignore)
3518 local newIgnore = removeElement(Ignore, ignoreObject)
3519 local wallRay = Ray.new(P1 + Direction * 0.1, -Direction * (rayLength + 1))
3520 local H2, P2, N2 = workspace:FindPartOnRayWithIgnoreList(wallRay, Ignore)
3521 local newPDist = totalPDist + (wallIgnore and 0 or (getNearestPoint(P1, P2, hitPos) - hitPos).magnitude)
3522 local newBDist = totalBDist + (P1 - hitPos).magnitude
3523 local outOfRange = Round(newPDist, 0.001) > S.penetrationSettings.Dist or Round(newBDist, 0.001) > S.bulletSettings.Range
3524 if (not wallIgnore) then
3525 createBulletImpact:FireServer(Wall, hitPos, Normal, Direction, hitHumanoid, gunIgnore, S)
3526 if (not hitHumanoid) then
3527 createShockwave:FireServer(hitPos, S.shockwaveSettings.Radius, gunIgnore, S)
3528 end
3529 end
3530 if hitHumanoid and hitHumanoid.Health > 0 and isEnemy(hitHumanoid) and hitHumanoid == damagedHumanoid then
3531 createBlood:FireServer(Wall, P2, Direction, gunIgnore, S)
3532 end
3533 if outOfRange or (not H1) then
3534 if (not outOfRange) and (not wallIgnore) then
3535 createBulletImpact:FireServer(Wall, P2, N2, Direction, hitHumanoid, gunIgnore, S)
3536 if (not hitHumanoid) then
3537 createShockwave:FireServer(P2, S.shockwaveSettings.Radius, gunIgnore, S)
3538 end
3539 end
3540 return Wall, hitPos
3541 else
3542 if Wall == H2 and (not wallIgnore) then
3543 createBulletImpact:FireServer(Wall, P2, N2, Direction, hitHumanoid, gunIgnore, S)
3544 if (not hitHumanoid) then
3545 createShockwave:FireServer(P2, S.shockwaveSettings.Radius, gunIgnore, S)
3546 end
3547 end
3548 return penetrateWall(H1, P1, Direction, N1, Ignore, newPDist, newBDist, lastDamagedHumanoid)
3549 end
3550end
3551
3552function PenetrateWall(HitPos, Direction, HitHumanoid, OriginPos, Bullet, CurrentPDist)
3553 local HitDist = (HitPos - OriginPos).magnitude
3554 local Wall, WallHitPos = nil, nil
3555 local Hum, HumHitPos = nil, nil
3556 local CustomIgnore = {unpack(Ignore)}
3557 for i = 1, 10 do
3558 local WallRay = Ray.new(HitPos - (Direction * 0.1), Direction * S.Penetration)
3559 local H, P = game.Workspace:FindPartOnRayWithIgnoreList(WallRay, CustomIgnore)
3560 if H then
3561 local HitHumanoid = nil
3562 if H.Parent.ClassName == "Hat" then
3563 HitHumanoid = findFirstClass(H.Parent.Parent, "Humanoid")
3564 else
3565 HitHumanoid = findFirstClass(H.Parent, "Humanoid")
3566 end
3567 if HitHumanoid and i ~= 1 then
3568 Hum, HumHitPos = H, P
3569 break
3570 else
3571 Wall, WallHitPos = H, P
3572 table.insert(CustomIgnore, H)
3573 end
3574 else
3575 break
3576 end
3577 end
3578 if Wall then
3579 if S.InstantHit then
3580 if Hum then
3581 Damage(Hum.Parent:FindFirstChild("Head"), HumHitPos)
3582 return HumHitPos
3583 else
3584 local HitObj2, HitPos2 = nil, nil
3585 if HitHumanoid then
3586 HitObj2, HitPos2 = AdvRayCast(WallHitPos, Direction, S.BulletRange - HitDist, {Wall, HitHumanoid.Parent, unpack(Ignore)})
3587 else
3588 HitObj2, HitPos2 = AdvRayCast(WallHitPos, Direction, S.BulletRange - HitDist, {Wall, unpack(Ignore)})
3589 end
3590 Damage(HitObj2, HitPos2)
3591
3592 local NewPDist = CurrentPDist + (WallHitPos - HitPos).magnitude
3593 local NewHitPos2 = HitPos2
3594 if NewPDist < S.Penetration and HitObj2 then
3595 NewHitPos2 = PenetrateWall(HitPos2, Direction, HitHumanoid, OriginPos, Bullet, CurrentPDist + NewPDist)
3596 end
3597 return NewHitPos2
3598 end
3599 else
3600 local LastPos = WallHitPos
3601 local TotalDistTraveled = 0
3602 spawn(function()
3603 if Hum then
3604 Damage(Hum.Parent:FindFirstChild("Head"), HumHitPos)
3605 return HumHitPos
3606 else
3607 while true do
3608 RS.RenderStepped:wait()
3609 if TotalDistTraveled >= S.BulletRange - HitDist then
3610 Bullet:Destroy()
3611 break
3612 end
3613 local DistTraveled = (Bullet.Position - LastPos).magnitude
3614 local NewDirection = (Bullet.Position - LastPos).unit
3615 local TempHitObj, TempHitPos = nil, nil
3616 if HitHumanoid then
3617 TempHitObj, TempHitPos = AdvRayCast(LastPos, NewDirection, DistTraveled, {Wall, HitHumanoid.Parent, unpack(Ignore)})
3618 else
3619 TempHitObj, TempHitPos = AdvRayCast(LastPos, NewDirection, DistTraveled, {Wall, unpack(Ignore)})
3620 end
3621 if TempHitObj then
3622 Damage(TempHitObj, TempHitPos)
3623
3624 local NewPDist = CurrentPDist + (WallHitPos - HitPos).magnitude
3625 local NewTempPos = TempHitPos
3626 if NewPDist < S.Penetration and TempHitObj then
3627 NewTempPos = PenetrateWall(TempHitPos, Direction, HitHumanoid, OriginPos, Bullet, CurrentPDist + NewPDist)
3628 else
3629 Bullet:Destroy()
3630 end
3631 return NewTempPos
3632 else
3633 LastPos = Bullet.Position
3634 TotalDistTraveled = TotalDistTraveled + DistTraveled
3635 end
3636 end
3637 end
3638 end)
3639 end
3640 else
3641 if Bullet then Bullet:Destroy() end
3642 return HitPos
3643 end
3644end
3645
3646function isEnemy(Human)
3647 local Plyr = game.Players:GetPlayerFromCharacter(Human.Parent)
3648 if (not Plyr) then return S.CanDamageNPCs end
3649 return S.AllowFriendlyFire or (Plyr.TeamColor ~= Player.TeamColor or Plyr.Neutral)
3650end
3651
3652--------------------[ RELOAD FUNCTIONS ]----------------------------------------------
3653
3654function animateReload()
3655 tweenJoint(LWeld2, CF(), CF(), Sine, 0.15)
3656 tweenJoint(RWeld2, CF(), CF(), Sine, 0.15)
3657 local magParts = {}
3658 local magTable = {}
3659
3660 for _, Obj in pairs(Gun:GetChildren()) do
3661 if string.sub(Obj.Name, 1, 3) == "Mag" and Obj:IsA("BasePart") then
3662 INSERT(magParts, Obj)
3663 end
3664 end
3665
3666 local animVars = {
3667 --FUNCTIONS--
3668 tweenJoint = tweenJoint;
3669
3670 makeMagInvisible = function()
3671 for _, v in pairs(magParts) do
3672 v.Transparency = 1
3673 end
3674 magVisible = false
3675 end;
3676
3677 makeMagVisible = function()
3678 for _, v in pairs(magParts) do
3679 v.Transparency = v:WaitForChild("magTrans").Value
3680 end
3681 magVisible = true
3682 end;
3683
3684 isMagVisible = function()
3685 return magVisible
3686 end;
3687
3688 isMagEmpty = function()
3689 return ammoInClip == 0
3690 end;
3691
3692 setNewMag = function()
3693 newMag = true
3694 end;
3695
3696 isNewMag = function()
3697 return newMag
3698 end;
3699
3700 createMag = function(Key)
3701 local magModel = Instance.new("Model")
3702 local magClones = {}
3703 for i, v in pairs(magParts) do
3704 local vClone = v:Clone()
3705 vClone.Transparency = v:WaitForChild("magTrans").Value
3706 vClone.CanCollide = false
3707 vClone.Parent = magModel
3708 INSERT(magClones, {Original = v, magClone = vClone})
3709 if i ~= 1 then
3710 local W = Instance.new("Weld")
3711 W.Part0 = magClones[1].magClone
3712 W.Part1 = vClone
3713 W.C0 = magClones[1].magClone.CFrame:toObjectSpace(vClone.CFrame)
3714 W.Parent = magClones[1].magClone
3715 end
3716 end
3717 magTable[Key] = {magModel, magClones}
3718 return magModel, magClones
3719 end;
3720
3721 getMag = function(Key)
3722 if magTable[Key] then
3723 return magTable[Key][1], magTable[Key][2]
3724 else
3725 return nil, nil
3726 end
3727 end;
3728
3729 attachGripToHead = function()
3730 local handleCF = RArm.CFrame * Grip.C0
3731 Grip.C0 = Head.CFrame:toObjectSpace(handleCF)
3732 Grip.Part0 = Head
3733 end;
3734
3735 attachGripToArm = function()
3736 local handleCF = Head.CFrame * Grip.C0
3737 Grip.C0 = RArm.CFrame:toObjectSpace(handleCF)
3738 Grip.Part0 = RArm
3739 end;
3740
3741 Sine = Sine;
3742
3743 Linear = Linear;
3744
3745 --VARIABLES--
3746 Handle = Handle;
3747 LArm = LArm;
3748 RArm = RArm;
3749 LWeld = LWeld;
3750 RWeld = RWeld;
3751 LC0 = armC0[1];
3752 RC0 = armC0[2];
3753 Grip = Grip;
3754 gunIgnore = gunIgnore;
3755 Cam = Cam;
3756 CF = CF;
3757 CFANG = CFANG;
3758 V3 = V3;
3759 RAD = RAD;
3760 reloadTimeLoaded = S.reloadSettings.Times.Loaded;
3761 reloadTimeEmpty = S.reloadSettings.Times.Empty
3762 }
3763
3764 local sequenceTable = Anims.Reload(animVars)
3765 --local T = tick()
3766 for _, reloadFunction in pairs(sequenceTable) do
3767 if breakReload then
3768 break
3769 end
3770 reloadFunction()
3771
3772 if (not magVisible) then
3773 Ammo.Value = 0
3774 end
3775 updateClipAmmo()
3776 end
3777 --print(tick() - T) --I divide the reloadTime by this number to get the animation speed
3778
3779 if (not isCrawling) then
3780 if Running and (not S.canFireWhileRunning) then
3781 tweenJoint(LWeld, armC0[1], S.runningC1.leftArm, Sine, 0.4)
3782 tweenJoint(RWeld, armC0[2], S.runningC1.rightArm, Sine, 0.4)
3783 tweenJoint(Grip, nil, S.runningC1.Grip, Sine, 0.4)
3784 else
3785 tweenJoint(LWeld, armC0[1], S.unAimedC1.leftArm, Sine, 0.4)
3786 tweenJoint(RWeld, armC0[2], S.unAimedC1.rightArm, Sine, 0.4)
3787 tweenJoint(Grip, nil, S.unAimedC1.Grip, Sine, 0.4)
3788 end
3789 end
3790
3791 for _, v in pairs(magTable) do --In case the reload animations was stopped mid way and there were still fake mags that weren't deleted
3792 v[1]:Destroy()
3793 end
3794end
3795
3796function Reload()
3797 if Ammo.Value < (ClipSize.Value + 1) and (not Reloading) and StoredAmmo.Value > 0 then
3798 Firing = false
3799 ammoInClip = (ammoInClip == 0 and Ammo.Value or ammoInClip)
3800 Reloading = true
3801 lowerSpread()
3802 if Aimed then unAimGun(S.reloadSettings.Anim) end
3803 crossHair.Reload.Visible = true
3804 if Handle:FindFirstChild("ReloadSound") then Handle.ReloadSound:Play() end
3805 if S.reloadSettings.Anim then
3806 wait()
3807 animateReload()
3808 else
3809 local startReload = tick()
3810 local initialReloadTime = Ammo.Value == 0 and S.reloadSettings.Times.Empty or S.reloadSettings.Times.Loaded
3811 while true do
3812 if breakReload then break end
3813 if (tick() - startReload) >= initialReloadTime then break end
3814 RS.RenderStepped:wait()
3815 end
3816 end
3817 if (not breakReload) then
3818 newMag = false
3819 if StoredAmmo.Value >= ClipSize.Value then
3820 if ammoInClip > 0 then
3821 StoredAmmo.Value = StoredAmmo.Value - ((ClipSize.Value + 1) - ammoInClip)
3822 Ammo.Value = ClipSize.Value + 1
3823 else
3824 StoredAmmo.Value = StoredAmmo.Value - ClipSize.Value
3825 Ammo.Value = ClipSize.Value
3826 end
3827 elseif StoredAmmo.Value < ClipSize.Value and StoredAmmo.Value > 0 then
3828 Ammo.Value = StoredAmmo.Value
3829 StoredAmmo.Value = 0
3830 end
3831 end
3832 Reloading = false
3833 if Selected then
3834 ammoInClip = (breakReload and ammoInClip or 0)
3835 crossHair.Reload.Visible = false
3836 end
3837 breakReload = false
3838 end
3839
3840 updateClipAmmo()
3841 updateStoredAmmo()
3842end
3843
3844--------------------[ EXTERNAL DATA LOCATING FUNCTIONS ]-----------------------------
3845
3846function removeElement(Table, Element) --removes the first instance of Element from Table
3847 for i, v in pairs(Table) do
3848 if v == Element then
3849 table.remove(Table, i)
3850 break
3851 end
3852 end
3853 return Table
3854end
3855
3856function findFirstClass(Object, Class)
3857 local foundObject = nil
3858 for _, Obj in pairs(Object:GetChildren()) do
3859 if Obj.ClassName == Class then
3860 foundObject = Obj
3861 break
3862 end
3863 end
3864 return foundObject
3865end
3866
3867function isIgnored(Obj, Table)
3868 for _,v in pairs(Table) do
3869 if Obj == v or Obj:IsDescendantOf(v) then
3870 return true
3871 end
3872 end
3873 return false
3874end
3875
3876function GetHitSurfaceCFrame(HitPos,Obj)
3877 local SurfaceCF = {
3878 {"Back",Obj.CFrame * CF(0,0,Obj.Size.z)};
3879 {"Bottom",Obj.CFrame * CF(0,-Obj.Size.y,0)};
3880 {"Front",Obj.CFrame * CF(0,0,-Obj.Size.z)};
3881 {"Left",Obj.CFrame * CF(-Obj.Size.x,0,0)};
3882 {"Right",Obj.CFrame * CF(Obj.Size.x,0,0)};
3883 {"Top",Obj.CFrame * CF(0,Obj.Size.y,0)}
3884 }
3885 local ClosestDist = HUGE
3886 local ClosestSurface = nil
3887 for _,v in pairs(SurfaceCF) do
3888 local SurfaceDist = (HitPos - v[2].p).magnitude
3889 if SurfaceDist < ClosestDist then
3890 ClosestDist = SurfaceDist
3891 ClosestSurface = v
3892 end
3893 end
3894 return ClosestSurface[2]
3895end
3896
3897function AdvRayCast(Origin, Direction, Dist, CustomIgnore)
3898 local NewIgnore = (CustomIgnore and CustomIgnore or Ignore)
3899 local NewRay = Ray.new(Origin, Direction * (Dist > 999 and 999 or Dist))
3900 local HitObj, HitPos = game.Workspace:FindPartOnRayWithIgnoreList(NewRay, NewIgnore)
3901 local LastPos = HitPos
3902 local FinalHitObj, FinalHitPos = nil, nil
3903 local RepTimes = math.floor(Dist / 999)
3904 if (not HitObj) and (Dist > 999) then
3905 for i = 0, RepTimes do
3906 local NewDist = (i == RepTimes and (Dist - (LastPos - Origin).magnitude) or 999)
3907 local Ray2 = Ray.new(LastPos, Direction * NewDist)
3908 local HitObj2, HitPos2 = game.Workspace:FindPartOnRayWithIgnoreList(Ray2, NewIgnore)
3909 if i ~= RepTimes then
3910 if HitObj2 then
3911 FinalHitObj, FinalHitPos = HitObj2, HitPos2
3912 break
3913 end
3914 elseif i == RepTimes then
3915 FinalHitObj, FinalHitPos = HitObj2, HitPos2
3916 end
3917 LastPos = HitPos2
3918 end
3919 return FinalHitObj, FinalHitPos
3920 elseif HitObj or (Dist <= 999) then
3921 return HitObj, HitPos
3922 end
3923end
3924
3925--------------------[ JUMPING ANIMATION ]---------------------------------------------
3926
3927function onFall(initialVelocity)
3928 spawn(function()
3929 local velocityAlpha = math.max(math.min(initialVelocity / Humanoid.JumpPower, 1), 0)
3930 local startJumpPos = jumpAnim.Pos
3931 local startJumpRot = jumpAnim.Rot
3932 local endJumpPos = 0.04 * S.fallSettings.fallMultiplier * velocityAlpha
3933 local endJumpRot = RAD(4) * S.fallSettings.fallMultiplier * velocityAlpha
3934 local t0 = tick()
3935 while true do
3936 RS.Heartbeat:wait()
3937 local Alpha = math.min((tick() - t0) / 0.15, 1) * 90
3938 if onGround then break end
3939 jumpAnim.Pos = numLerp(startJumpPos, endJumpPos, Sine(Alpha))
3940 jumpAnim.Rot = numLerp(startJumpRot, endJumpRot, Sine(Alpha))
3941 if Alpha == 90 then break end
3942 end
3943 startJumpPos = endJumpPos
3944 startJumpRot = endJumpRot
3945 endJumpPos = -0.08 * S.fallSettings.fallMultiplier
3946 endJumpRot = -RAD(8) * S.fallSettings.fallMultiplier
3947 local X = 1
3948 while true do
3949 local dt = RS.Heartbeat:wait()
3950 X = X + (dt * 60) / X
3951 local Alpha = (X - 1) / 15
3952 if onGround then break end
3953 jumpAnim.Pos = numLerp(startJumpPos, endJumpPos, Alpha)
3954 jumpAnim.Rot = numLerp(startJumpRot, endJumpRot, Alpha)
3955 end
3956 end)
3957end
3958
3959function onLand(fallDist)
3960 spawn(function()
3961 local animAlpha = math.min(fallDist, S.fallSettings.maxDist) * (2 / 3)
3962 local startJumpPos = jumpAnim.Pos
3963 local startJumpRot = jumpAnim.Rot
3964 local endJumpPos = animAlpha / 100 * S.fallSettings.landMultiplier * (runReady and 1 or 2)
3965 local endJumpRot = RAD(animAlpha) * S.fallSettings.landMultiplier * (runReady and 1 or 2)
3966 local t0 = tick()
3967 while true do
3968 RS.Heartbeat:wait()
3969 local Alpha = math.min((tick() - t0) / 0.2, 1)
3970 if (not onGround) then break end
3971 jumpAnim.Pos = numLerp(startJumpPos, endJumpPos, Alpha)
3972 jumpAnim.Rot = numLerp(startJumpRot, endJumpRot, Alpha)
3973 if Alpha == 1 then break end
3974 end
3975 t0 = tick()
3976 while true do
3977 RS.Heartbeat:wait()
3978 local Alpha = math.min((tick() - t0) / 0.3, 1) * 90
3979 if (not onGround) then break end
3980 jumpAnim.Pos = numLerp(endJumpPos, 0, Sine(Alpha))
3981 jumpAnim.Rot = numLerp(endJumpRot, 0, Sine(Alpha))
3982 if Alpha == 90 then break end
3983 end
3984 end)
3985end
3986
3987function onHumanoidStateChanged(oldState, newState)
3988 if newState == Enum.HumanoidStateType.Freefall then
3989 onGround = false
3990 if S.fallAnimation then
3991 onFall(HRP.Velocity.Y)
3992 while HRP.Velocity.Y > 0 do RS.RenderStepped:wait() end
3993 startFallHeight = HRP.Position.Y
3994 end
3995 elseif oldState == Enum.HumanoidStateType.Freefall then
3996 onGround = true
3997 if S.fallAnimation then
3998 local fallDist = startFallHeight - HRP.Position.Y
3999 onLand(fallDist)
4000 end
4001 end
4002end
4003--------------------[ CAMERA STEADYING FUNCTIONS ]------------------------------------
4004
4005function steadyCamera()
4006 scopeSteady.Text = "Steadying..."
4007 scopeSteady.TextColor3 = Color3.new(1, 1, 0)
4008 camSteady = true
4009 local originalSway = camSway
4010 local Increment = 1.5 / 0.6
4011 local X = 0
4012 while true do
4013 RS.RenderStepped:wait()
4014 local newX = X + Increment
4015 X = (newX > 90 and 90 or newX)
4016 if (not steadyKeyPressed) then break end
4017 camSway = numLerp(originalSway, 0, Sine(X))
4018 if X == 90 then break end
4019 end
4020 while steadyKeyPressed and Aimed do
4021 if currentSteadyTime > 0 then
4022 local NewSteadyTime = currentSteadyTime - 1
4023 currentSteadyTime = (NewSteadyTime < 0 and 0 or NewSteadyTime)
4024 camSway = 0
4025 elseif currentSteadyTime == 0 then
4026 break
4027 end
4028 RS.RenderStepped:wait()
4029 end
4030 camSteady = false
4031 spawn(function()
4032 local Increment = 1.5 / 0.25
4033 local X = 0
4034 while true do
4035 RS.RenderStepped:wait()
4036 local newX = X + Increment
4037 X = (newX > 90 and 90 or newX)
4038 if camSteady then break end
4039 camSway = numLerp(0, S.scopeSettings.camSwayOnBreath, 1 - COS(RAD(X)))
4040 if X == 90 then break end
4041 end
4042 Increment = 1.5 / S.scopeSettings.breathTime
4043 X = 0
4044 while true do
4045 RS.RenderStepped:wait()
4046 local newX = X + Increment
4047 X = (newX > 90 and 90 or newX)
4048 if camSteady then break end
4049 camSway = numLerp(S.scopeSettings.camSwayOnBreath, 1, Sine(X))
4050 if X == 90 then break end
4051 end
4052 --[[for X = 0, 90, 1.5 / 0.2 do
4053 local Alpha = 1 - COS(RAD(X))--math.log10(X) / math.log10(90)
4054 camSway = numLerp(0, 3, Alpha)
4055 RS.RenderStepped:wait()
4056 end]]
4057 --[[for X = 0, 90, 1.5 / S.scopeSettings.steadyTime do
4058 if camSteady then break end
4059 local Alpha = SIN(RAD(X))
4060 camSway = numLerp(3, 1, Alpha)
4061 RS.RenderStepped:wait()
4062 end]]
4063 end)
4064 retakeBreath()
4065end
4066
4067function retakeBreath()
4068 scopeSteady.Text = "Re-taking Breath"
4069 scopeSteady.TextColor3 = Color3.new(1, 0, 0)
4070 takingBreath = true
4071 local Increment = S.scopeSettings.steadyTime / S.scopeSettings.breathTime
4072 while takingBreath do
4073 if currentSteadyTime < maxSteadyTime then
4074 local newSteadyTime = currentSteadyTime + Increment
4075 currentSteadyTime = (newSteadyTime > maxSteadyTime and maxSteadyTime or newSteadyTime)
4076 elseif currentSteadyTime >= maxSteadyTime then
4077 break
4078 end
4079 RS.RenderStepped:wait()
4080 end
4081 if takingBreath then
4082 scopeSteady.Text = "Hold "..convertKey(S.Keys.scopeSteady).." to Steady"
4083 scopeSteady.TextColor3 = Color3.new(1, 1, 0)
4084 takingBreath = false
4085 end
4086end
4087
4088--------------------[ SPRINTING FUNCTIONS ]-------------------------------------------
4089
4090function canRun(midRun)
4091 return ((Forward and (not Backward)) and
4092 Walking and (Stamina > 0) and Running and
4093 Selected and (midRun and true or onGround) and
4094 runReady and (S.canFireWhileRunning and true or (not Firing))
4095 )
4096end
4097
4098function monitorStamina()
4099 Running = true
4100 if (not canRun(false)) then
4101 Running = false
4102 return
4103 end
4104 if Aimed then unAimGun(true) end
4105 if Stance == 1 or Stance == 2 then Stand() end
4106 if (not (Reloading and S.reloadSettings.Anim)) then
4107 if S.canFireWhileRunning then
4108 tweenJoint(LWeld, armC0[1], S.unAimedC1.leftArm, Sine, 0.4)
4109 tweenJoint(RWeld, armC0[2], S.unAimedC1.rightArm, Sine, 0.4)
4110 tweenJoint(Grip, nil, S.unAimedC1.Grip, Sine, 0.4)
4111 else
4112 tweenJoint(LWeld, armC0[1], S.runningC1.leftArm, Sine, 0.4)
4113 tweenJoint(RWeld, armC0[2], S.runningC1.rightArm, Sine, 0.4)
4114 tweenJoint(Grip, nil, S.runningC1.Grip, Sine, 0.4)
4115 end
4116 end
4117 crossOffset = 50
4118 while runKeyPressed do
4119 if canRun(true) then
4120 if onGround then
4121 local newStamina = Stamina - 1
4122 Stamina = (newStamina < 0 and 0 or newStamina)
4123 end
4124 else
4125 break
4126 end
4127 RS.RenderStepped:wait()
4128 end
4129 Running = false
4130 if (not Aimed) and (not (Reloading and S.reloadSettings.Anim)) and (not S.canFireWhileRunning) then
4131 crossOffset = 0
4132 tweenJoint(LWeld, armC0[1], S.unAimedC1.leftArm, Sine, 0.4)
4133 tweenJoint(RWeld, armC0[2], S.unAimedC1.rightArm, Sine, 0.4)
4134 tweenJoint(Grip, nil, S.unAimedC1.Grip, Sine, 0.4)
4135 end
4136
4137 rechargeStamina()
4138end
4139
4140function rechargeStamina()
4141 chargingStamina = true
4142 while ((not runKeyPressed) or (Stamina < maxStamina)) and (not Running) do
4143 if Stamina < maxStamina then
4144 local newStamina = Stamina + (S.sprintTime / S.staminaCoolTime)
4145 Stamina = (newStamina > maxStamina and maxStamina or newStamina)
4146 elseif Stamina >= maxStamina then
4147 break
4148 end
4149 RS.RenderStepped:wait()
4150 end
4151 chargingStamina = false
4152end
4153
4154--------------------[ STANCE FUNCTIONS ]----------------------------------------------
4155
4156function Stand(onDeselected)
4157 local LHip = Torso["Left Hip"]
4158 local RHip = Torso["Right Hip"]
4159 LLegWeld.Part1 = nil
4160 LHip.Part1 = LLeg
4161 RLegWeld.Part1 = nil
4162 RHip.Part1 = RLeg
4163 Stance = 0
4164 spreadStance = "Stand"
4165 baseSpread = S.spreadSettings[spreadZoom][spreadStance][spreadMotion]
4166 if S.stanceSettings.Anim and (not onDeselected) then
4167 spawn(function()
4168 local prevStanceSway = stanceSway
4169 local X = 0
4170 local Increment = 1.5 / S.stanceSettings.Speed
4171 while true do
4172 RS.RenderStepped:wait()
4173 local newX = X + Increment
4174 X = (newX > 90 and 90 or newX)
4175 if Stance ~= 0 then break end
4176 stanceSway = numLerp(prevStanceSway, 1, Sine(X))
4177 if X == 90 then break end
4178 end
4179 end)
4180 tweenJoint(ABWeld, CF(), nil, Sine, S.stanceSettings.Speed)
4181 tweenJoint(LLegWeld, legC0.Stand[1], nil, Sine, S.stanceSettings.Speed)
4182 tweenJoint(RLegWeld, legC0.Stand[2], nil, Sine, S.stanceSettings.Speed)
4183 tweenJoint(LHip, CF(-1, -1, 0) * CFANG(0, RAD(-90), 0), CF(-0.5, 1, 0) * CFANG(0, RAD(-90), 0), Sine, S.stanceSettings.Speed)
4184 tweenJoint(RHip, CF(1, -1, 0) * CFANG(RAD(-180), RAD(90), 0), CF(0.5, 1, 0) * CFANG(RAD(-180), RAD(90), 0), Sine, S.stanceSettings.Speed)
4185 tweenJoint(Root, CFANG(RAD(-90), 0, RAD(180)), nil, Sine, S.stanceSettings.Speed)
4186 tweenJoint(headWeld, CF(0, 1.5, 0), nil, Sine, S.stanceSettings.Speed)
4187 elseif onDeselected or (not S.stanceSettings.Anim) then
4188 ABWeld.C0 = CF()
4189 LLegWeld.C0 = legC0.Stand[1]
4190 RLegWeld.C0 = legC0.Stand[2]
4191 LHip.C0, LHip.C1 = CF(-1, -1, 0) * CFANG(0, RAD(-90), 0), CF(-0.5, 1, 0) * CFANG(0, RAD(-90), 0)
4192 RHip.C0, RHip.C1 = CF(1, -1, 0) * CFANG(RAD(-180), RAD(90), 0), CF(0.5, 1, 0) * CFANG(RAD(-180), RAD(90), 0)
4193 Root.C0 = CFANG(RAD(-90), 0, RAD(180))
4194 headWeld.C0 = CF(0, 1.5, 0)
4195 end
4196end
4197
4198function Crouch()
4199 local LHip = Torso["Left Hip"]
4200 local RHip = Torso["Right Hip"]
4201 LHip.Part1 = nil
4202 LLegWeld.Part1 = LLeg
4203 RHip.Part1 = nil
4204 RLegWeld.Part1 = RLeg
4205 Stance = 1
4206 spreadStance = "Crouch"
4207 baseSpread = S.spreadSettings[spreadZoom][spreadStance][spreadMotion]
4208 if S.stanceSettings.Anim then
4209 spawn(function()
4210 local prevStanceSway = stanceSway
4211 local X = 0
4212 local Increment = 1.5 / S.stanceSettings.Speed
4213 while true do
4214 RS.RenderStepped:wait()
4215 local newX = X + Increment
4216 X = (newX > 90 and 90 or newX)
4217 if Stance ~= 1 then break end
4218 stanceSway = numLerp(prevStanceSway, 0.75, Sine(X))
4219 if X == 90 then break end
4220 end
4221 end)
4222 tweenJoint(ABWeld, CF(0, 0, -0.05), nil, Sine, S.stanceSettings.Speed)
4223 tweenJoint(LLegWeld, legC0.Crouch[1], nil, Sine, S.stanceSettings.Speed)
4224 tweenJoint(RLegWeld, legC0.Crouch[2], nil, Sine, S.stanceSettings.Speed)
4225 tweenJoint(LHip, CF(-1, -0.5, 0) * CFANG(0, RAD(-90), 0), CF(-0.5, 0.5, 1) * CFANG(0, RAD(-90), RAD(-90)), Sine, S.stanceSettings.Speed)
4226 tweenJoint(RHip, CF(1, -0.5, 0.25) * CFANG(RAD(-180), RAD(90), 0), CF(0.5, 0.5, 1) * CFANG(RAD(-180), RAD(90), 0), Sine, S.stanceSettings.Speed)
4227 tweenJoint(Root, CF(0, -1, 0) * CFANG(RAD(-90), 0, RAD(180)), nil, Sine, S.stanceSettings.Speed)
4228 tweenJoint(headWeld, CF(0, 1.5, 0), nil, Sine, S.stanceSettings.Speed)
4229 else
4230 ABWeld.C0 = CF(0, 0, -1 / 16)
4231 LLegWeld.C0 = legC0.Crouch[1]
4232 RLegWeld.C0 = legC0.Crouch[2]
4233 LHip.C0, LHip.C1 = CF(-1, -0.5, 0) * CFANG(0, RAD(-90), 0), CF(-0.5, 0.5, 1) * CFANG(0, RAD(-90), RAD(-90))
4234 RHip.C0, RHip.C1 = CF(1, -0.5, 0.25) * CFANG(RAD(-180), RAD(90), 0), CF(0.5, 0.5, 1) * CFANG(RAD(-180), RAD(90), 0)
4235 Root.C0 = CF(0, -1, 0) * CFANG(RAD(-90), 0, RAD(180))
4236 headWeld.C0 = CF(0, 1.5, 0)
4237 end
4238end
4239
4240function Prone()
4241 local LHip = Torso["Left Hip"]
4242 local RHip = Torso["Right Hip"]
4243 LHip.Part1 = nil
4244 LLegWeld.Part1 = LLeg
4245 RHip.Part1 = nil
4246 RLegWeld.Part1 = RLeg
4247 Stance = 2
4248 spreadStance = "Prone"
4249 baseSpread = S.spreadSettings[spreadZoom][spreadStance][spreadMotion]
4250 if S.stanceSettings.Anim then
4251 spawn(function()
4252 local prevStanceSway = stanceSway
4253 local X = 0
4254 local Increment = 1.5 / S.stanceSettings.Speed
4255 while true do
4256 RS.RenderStepped:wait()
4257 local newX = X + Increment
4258 X = (newX > 90 and 90 or newX)
4259 if Stance ~= 2 then break end
4260 stanceSway = numLerp(prevStanceSway, 0.5, Sine(X))
4261 if X == 90 then break end
4262 end
4263 end)
4264 tweenJoint(ABWeld, CF(0, 0, -0.1), nil, Sine, S.stanceSettings.Speed)
4265 tweenJoint(LLegWeld, legC0.Prone[1], nil, Sine, S.stanceSettings.Speed)
4266 tweenJoint(RLegWeld, legC0.Prone[2], nil, Sine, S.stanceSettings.Speed)
4267 tweenJoint(Root, CF(0, -2.5, 1) * CFANG(RAD(180), 0, RAD(180)), nil, Sine, S.stanceSettings.Speed)
4268 tweenJoint(headWeld, CF(0, 1, 1) * CFANG(RAD(90), 0, 0), nil, Sine, S.stanceSettings.Speed)
4269 else
4270 ABWeld.C0 = CF(0, 0, -1 / 8)
4271 LLegWeld.C0 = legC0.Prone[1]
4272 RLegWeld.C0 = legC0.Prone[2]
4273 Root.C0 = CF(0, -2.5, 1) * CFANG(RAD(180), 0, RAD(180))
4274 headWeld.C0 = CF(0, 1, 1) * CFANG(RAD(90), 0, 0)
4275 end
4276end
4277
4278function Dive()
4279 onGround = false
4280 local diveDirection = (HRP.CFrame * CFANG(S.diveSettings.Angle, 0, 0)).lookVector * S.walkSpeeds.Sprinting * S.diveSettings.Force
4281 local BF = Instance.new("BodyForce")
4282 BF.force = diveDirection + Vector3.new(0, playerMass * 196.2, 0)
4283 BF.Parent = HRP
4284 --[[spawn(function()
4285 HRP.Velocity = HRP.CFrame.lookVector * 60 + V3(0, 40, 0)
4286 wait(0.1)
4287 HRP.Velocity = HRP.CFrame.lookVector * 70 + V3(0, 30, 0)
4288 wait(0.4)
4289 HRP.Velocity = HRP.CFrame.lookVector * 30 + V3(0, -10, 0)
4290 end)]]
4291 delay(0.05, function()
4292 spawn(function()
4293 while true do
4294 local newRay = Ray.new(HRP.Position, V3(0, -3.1, 0))
4295 local H, _ = workspace:FindPartOnRayWithIgnoreList(newRay, Ignore)
4296 if H then
4297 onGround = true
4298 break
4299 end
4300 wait()
4301 end
4302 end)
4303 Prone()
4304 wait(0.1)
4305 BF:Destroy()
4306 end)
4307end
4308
4309--------------------[ MOUSE FUNCTIONS ]-----------------------------------------------
4310
4311function onMB1Down()
4312 MB1Down = true
4313 firstShot = true
4314 if fireFunction then
4315 fireFunction()
4316 end
4317end
4318
4319function onMB1Up()
4320 MB1Down = false
4321 lowerSpread()
4322end
4323
4324function onMB2Down()
4325 if S.aimSettings.holdToADS then
4326 if (not AimingIn) and (not Aimed) then
4327 AimingIn = true
4328 aimGun()
4329 AimingIn = false
4330 end
4331 else
4332 if Aimed then
4333 unAimGun()
4334 else
4335 aimGun()
4336 end
4337 end
4338end
4339
4340function onMB2Up()
4341 if S.aimSettings.holdToADS then
4342 if (not AimingOut) and Aimed then
4343 AimingOut = true
4344 unAimGun()
4345 AimingOut = false
4346 end
4347 end
4348end
4349
4350function onScrollUp()
4351 local newAimSensitivity = aimSensitivity + S.sensitivitySettings.Increment
4352 aimSensitivity = (
4353 newAimSensitivity < S.sensitivitySettings.Min and S.sensitivitySettings.Min or
4354 newAimSensitivity > S.sensitivitySettings.Max and S.sensitivitySettings.Max or
4355 newAimSensitivity
4356 )
4357 mouseSensitivity = (Aimed and aimSensitivity or mouseSensitivity)
4358
4359 Sens.Text = "S: "..aimSensitivity
4360 if mainGUI:IsDescendantOf(game) then
4361 Sens.Visible = true
4362 local t0 = tick()
4363 lastSensUpdate = t0
4364
4365 wait(0.3)
4366
4367 if lastSensUpdate <= t0 then
4368 Sens.Visible = true
4369 end
4370 end
4371end
4372
4373function onScrollDown()
4374 local newAimSensitivity = aimSensitivity - S.sensitivitySettings.Increment
4375 aimSensitivity = (
4376 newAimSensitivity < S.sensitivitySettings.Min and S.sensitivitySettings.Min or
4377 newAimSensitivity > S.sensitivitySettings.Max and S.sensitivitySettings.Max or
4378 newAimSensitivity
4379 )
4380 mouseSensitivity = (Aimed and aimSensitivity or mouseSensitivity)
4381
4382 Sens.Text = "S: "..aimSensitivity
4383 if mainGUI:IsDescendantOf(game) then
4384 Sens.Visible = true
4385 local t0 = tick()
4386 lastSensUpdate = t0
4387
4388 wait(0.3)
4389
4390 if lastSensUpdate <= t0 then
4391 Sens.Visible = true
4392 end
4393 end
4394end
4395
4396--------------------[ KEYBOARD FUNCTIONS ]--------------------------------------------
4397
4398function keyDown(K)
4399 local Key = string.lower(K)
4400
4401 if Key == S.Keys.lowerStance and S.canChangeStance then
4402 if (not Running) then
4403 if Stance == 0 then
4404 if S.stanceSettings.Stances.Crouch then
4405 Crouch()
4406 elseif S.stanceSettings.Stances.Prone then
4407 Prone()
4408 end
4409 elseif Stance == 1 then
4410 if S.stanceSettings.Stances.Prone then
4411 Prone()
4412 end
4413 end
4414 elseif S.dolphinDive then
4415 wait()
4416 if Humanoid:GetState() ~= Enum.HumanoidStateType.Freefall and (not UIS:IsKeyDown("Space")) and runReady then
4417 local tempConnection = Humanoid.Changed:connect(function()
4418 Humanoid.Jump = false
4419 end)
4420 runReady = false
4421 Dive()
4422 Running = false
4423 wait(S.diveSettings.rechargeTime)
4424 tempConnection:disconnect()
4425 runReady = true
4426 end
4427 end
4428 end
4429
4430 if Key == S.Keys.raiseStance and S.canChangeStance then
4431 if (not Running) then
4432 if Stance == 2 then
4433 if S.stanceSettings.Stances.Crouch then
4434 Crouch()
4435 else
4436 Stand()
4437 end
4438 elseif Stance == 1 then
4439 Stand()
4440 end
4441 end
4442 end
4443
4444 if Key == S.Keys.ADS then
4445 if S.aimSettings.holdToADS then
4446 if (not AimingIn) and (not Aimed) then
4447 AimingIn = true
4448 aimGun()
4449 AimingIn = false
4450 end
4451 else
4452 if Aimed then
4453 unAimGun()
4454 else
4455 aimGun()
4456 end
4457 end
4458 end
4459
4460 if Key == S.Keys.selectFire and S.selectFire then
4461 if canSelectFire then
4462 canSelectFire = false
4463 rawFireMode = rawFireMode + 1
4464 modeGUI.Text = Modes[((rawFireMode - 1) % numModes) + 1]
4465 if modeGUI.Text == "AUTO" then
4466 fireFunction = autoFire
4467 elseif modeGUI.Text == "BURST" then
4468 fireFunction = burstFire
4469 elseif modeGUI.Text == "SEMI" then
4470 fireFunction = semiFire
4471 else
4472 fireFunction = nil
4473 end
4474 local speedAlpha = S.selectFireSettings.animSpeed / 0.6
4475 if S.selectFireSettings.GUI then
4476 spawn(function()
4477 fireSelect.Visible = true
4478 local prevRawFireMode = rawFireMode
4479 local Increment = 1.5 / (speedAlpha * 0.25)
4480 local X = 0
4481 wait(speedAlpha * 0.1)
4482 while true do
4483 RS.RenderStepped:wait()
4484 local newX = X + Increment
4485 X = (newX > 90 and 90 or newX)
4486 if prevRawFireMode ~= rawFireMode then break end
4487 updateModeLabels(rawFireMode - 1, rawFireMode, X)
4488 if X == 90 then break end
4489 end
4490 wait(speedAlpha * 0.25)
4491 fireSelect.Visible = false
4492 end)
4493 end
4494 if S.selectFireSettings.Animation and (not Aimed) and (not isRunning) and (not isCrawling) then
4495 spawn(function()
4496 local sequenceTable = {
4497 function()
4498 tweenJoint(RWeld2, nil, CFANG(0, RAD(5), 0), Sine, speedAlpha * 0.15)
4499 tweenJoint(LWeld, armC0[1], CF(0.1, 1, -0.3) * CFANG(RAD(-7), 0, RAD(-65)), Linear, speedAlpha * 0.15)
4500 wait(speedAlpha * 0.2)
4501 end;
4502
4503 function()
4504 tweenJoint(LWeld, armC0[1], CF(0.1, 1, -0.3) * CFANG(RAD(-10), 0, RAD(-65)), Linear, speedAlpha * 0.1)
4505 wait(speedAlpha * 0.2)
4506 end;
4507
4508 function()
4509 tweenJoint(RWeld2, nil, CF(), Sine, speedAlpha * 0.2)
4510 tweenJoint(LWeld, armC0[1], S.unAimedC1.leftArm, Sine, speedAlpha * 0.2)
4511 wait(speedAlpha * 0.2)
4512 end;
4513 }
4514
4515 for _, F in pairs(sequenceTable) do
4516 if Aimed or isRunning or isCrawling or Reloading then
4517 break
4518 end
4519 F()
4520 end
4521 end)
4522 end
4523 if S.selectFireSettings.Animation or S.selectFireSettings.GUI then
4524 wait(S.selectFireSettings.animSpeed)
4525 end
4526 canSelectFire = true
4527 end
4528 end
4529
4530 if Key == S.Keys.Reload then
4531 if (not Reloading) and (not isCrawling) then
4532 Reload()
4533 end
4534 end
4535
4536 if Key == S.Keys.Sprint then
4537 runKeyPressed = true
4538 if runReady then
4539 if (not Idling) and Walking and (not Running) and (not Knifing) and (not (Aimed and S.guiScope and S.Keys.Sprint == S.Keys.scopeSteady)) then
4540 monitorStamina()
4541 end
4542 end
4543 end
4544
4545 if Key == S.Keys.scopeSteady then
4546 steadyKeyPressed = true
4547 if Aimed and (not Aiming) then
4548 takingBreath = false
4549 steadyCamera()
4550 end
4551 end
4552
4553 for _, PTable in pairs(Plugins.KeyDown) do
4554 if Key == string.lower(PTable.Key) then
4555 spawn(function()
4556 PTable.Plugin()
4557 end)
4558 end
4559 end
4560end
4561
4562function keyUp(K)
4563 local Key = string.lower(K)
4564
4565 if Key == S.Keys.ADS then
4566 if S.aimSettings.holdToADS then
4567 if (not AimingOut) and Aimed then
4568 AimingOut = true
4569 unAimGun()
4570 AimingOut = false
4571 end
4572 end
4573 end
4574
4575 if Key == S.Keys.Sprint then
4576 runKeyPressed = false
4577 Running = false
4578 if (not chargingStamina) then
4579 rechargeStamina()
4580 end
4581 end
4582
4583 if Key == S.Keys.scopeSteady then
4584 steadyKeyPressed = false
4585 end
4586
4587 for _, PTable in pairs(Plugins.KeyUp) do
4588 if Key == string.lower(PTable.Key) then
4589 spawn(function()
4590 PTable.Plugin()
4591 end)
4592 end
4593 end
4594end
4595
4596--------------------[ END FUNCTIONS ]-------------------------------------------------
4597
4598--------------------------------------------------------------------------------------
4599--------------------[ PRE-CONNECTIONS ]-----------------------------------------------
4600--------------------------------------------------------------------------------------
4601
4602local function updateAnimVars()
4603 wait()
4604 Forward = (UIS:IsKeyDown("W") or UIS:IsKeyDown("Up"))
4605 Backward = (UIS:IsKeyDown("S") or UIS:IsKeyDown("Down"))
4606 local Right = UIS:IsKeyDown("D")
4607 local Left = UIS:IsKeyDown("A")
4608
4609 local walkingForward = (Forward and (not Backward))
4610 local walkingBackward = ((not Forward) and Backward)
4611 local walkingRight = (Right and (not Left))
4612 local walkingLeft = ((not Right) and Left)
4613
4614 if (Forward or Backward or Right or Left) then
4615 Walking, Idling = true, false
4616 if (not Running) and (not Aimed) then
4617 spreadMotion = "Moving"
4618 baseSpread = S.spreadSettings[spreadZoom][spreadStance][spreadMotion]
4619 end
4620 elseif (not (Forward and Backward and Right and Left)) then
4621 Walking, Idling = false, true
4622 if (not Aimed) then
4623 spreadMotion = "Idling"
4624 baseSpread = S.spreadSettings[spreadZoom][spreadStance][spreadMotion]
4625 end
4626 end
4627
4628 local newArmTilt = (
4629 ((walkingForward or walkingBackward) and walkingRight) and 2.5 or
4630 ((walkingForward or walkingBackward) and walkingLeft) and -2.5 or
4631 ((not (walkingForward and walkingBackward)) and walkingRight) and 5 or
4632 ((not (walkingForward and walkingBackward)) and walkingLeft) and -5 or 0
4633 )
4634 local newMoveAng = (
4635 (walkingForward and (not (walkingRight or walkingLeft))) and 0 or
4636 (walkingForward and walkingRight) and RAD(-45) or
4637 ((not (walkingForward or walkingBackward)) and walkingRight) and RAD(-90) or
4638 (walkingBackward and walkingRight) and RAD(-135) or
4639 (walkingBackward and (not (walkingRight or walkingLeft))) and (moveAng < 0 and RAD(-180) or RAD(180)) or
4640 (walkingBackward and walkingLeft) and RAD(135) or
4641 ((not (walkingForward or walkingBackward)) and walkingLeft) and RAD(90) or
4642 (walkingForward and walkingLeft) and RAD(45) or 0
4643 )
4644
4645 local newAnimCode = math.random(-1e9, 1e9)
4646 animCode = newAnimCode
4647 local startTilt = armTilt
4648 local startAng = (ABS(moveAng) == RAD(180)) and (newMoveAng > 0 and RAD(180) or RAD(-180)) or moveAng
4649 local Increment = (startTilt == newArmTilt and 1.5 / 0.7 or 1.5 / (0.35 * ABS(startTilt - newArmTilt) / 5))
4650 local X = 0
4651 while true do
4652 RS.RenderStepped:wait()
4653 local newX = X + Increment
4654 X = (newX > 90 and 90 or newX)
4655 if animCode ~= newAnimCode then break end
4656 armTilt = numLerp(startTilt, newArmTilt, Sine(X))
4657 moveAng = numLerp(startAng, newMoveAng, Sine(X))
4658 if X == 90 then break end
4659 end
4660end
4661
4662M2.KeyDown:connect(updateAnimVars)
4663M2.KeyUp:connect(updateAnimVars)
4664updateAnimVars()
4665
4666--------------------------------------------------------------------------------------
4667--------------------[ TOOL SELECTION AND DESELECTION ]--------------------------------
4668--------------------------------------------------------------------------------------
4669
4670function onEquipped()
4671 wait()
4672 if Humanoid.Health ~= 0 and (not Selected) and Gun.Parent == Char then
4673 Selected = true
4674 breakReload = false
4675 equipAnimPlaying = true
4676
4677 math.randomseed(tick()) --This sets a new seed for the random function each time you select the gun
4678
4679 --------------------[ FAILSAFE RESETING ]-------------------------------------
4680
4681 for _, GM in pairs(ignoreModel:GetChildren()) do
4682 if GM.Name == "gunIgnore_"..Player.Name then
4683 GM:Destroy()
4684 end
4685 end
4686
4687 for _, c in pairs(Connections) do
4688 c:disconnect()
4689 end
4690
4691 Connections = {}
4692
4693 --------------------[ REMOTE GUN SETUP ]--------------------------------------
4694
4695 --[[local Vars = {
4696 ignoreModel = ignoreModel;
4697 Humanoid = Humanoid;
4698 Shoulders = Shoulders;
4699 Torso = Torso;
4700 Head = Head;
4701 armC0 = armC0;
4702 leftArmC1 = S.equipSettings.leftArmC1;
4703 rightArmC1 = S.equipSettings.rightArmC1;
4704 LArm = LArm;
4705 RArm = RArm;
4706 gunParts = gunParts;
4707 Handle = Handle;
4708 }
4709 gunIgnore, playerFolder, headWeld, headWeld2, animWeld, ABWeld, LWeld, RWeld, LWeld2, RWeld2, LLegWeld, RLegWeld, gunParts2 = gunSetup:InvokeServer(Vars)]]
4710
4711 --------------------[ CREATING IGNORE MODELS ]--------------------------------
4712
4713 gunIgnore = Instance.new("Model")
4714 gunIgnore.Name = "gunIgnore_"..Player.Name
4715 gunIgnore.Parent = ignoreModel
4716
4717 --------------------[ MODIFYING THE PLAYER ]----------------------------------
4718
4719 Player.CameraMode = Enum.CameraMode.LockFirstPerson
4720 Cam.CameraType = Enum.CameraType.Scriptable
4721 Cam.FieldOfView = 80
4722 UIS.MouseBehavior = Enum.MouseBehavior.LockCenter
4723 UIS.MouseIconEnabled = false
4724
4725 local initialX, initialY = getYawPitch(Cam.CoordinateFrame)
4726 camAng = -VEC2(initialX, initialY)
4727
4728 mainGUI.Parent = Player.PlayerGui
4729
4730 setUpGUI()
4731 updateHealth()
4732
4733 if S.selectFire then
4734 local currentMode = Modes[((rawFireMode - 1) % numModes) + 1]
4735 if currentMode == "AUTO" then
4736 fireFunction = autoFire
4737 elseif currentMode == "BURST" then
4738 fireFunction = burstFire
4739 elseif currentMode == "SEMI" then
4740 fireFunction = semiFire
4741 else
4742 fireFunction = nil
4743 end
4744 else
4745 if S.gunType.Semi then
4746 fireFunction = semiFire
4747 elseif S.gunType.Auto then
4748 fireFunction = autoFire
4749 elseif S.gunType.Burst then
4750 fireFunction = burstFire
4751 else
4752 fireFunction = nil
4753 end
4754 end
4755
4756 changePlayerTrans(Char, 1)
4757
4758 Humanoid.AutoRotate = false
4759
4760 Shoulders.Right.Part1 = nil
4761 Shoulders.Left.Part1 = nil
4762
4763 playerFolder = Instance.new("Model")
4764 playerFolder.Name = "playerFolder"
4765 playerFolder.Parent = gunIgnore
4766
4767 local headBase = Instance.new("Part")
4768 headBase.Transparency = 1
4769 headBase.Name = "headBase"
4770 headBase.CanCollide = false
4771 headBase.FormFactor = Enum.FormFactor.Custom
4772 headBase.Size = V3(0.2, 0.2, 0.2)
4773 headBase.BottomSurface = Enum.SurfaceType.Smooth
4774 headBase.TopSurface = Enum.SurfaceType.Smooth
4775 headBase.Parent = playerFolder
4776
4777 headWeld = Instance.new("Weld")
4778 headWeld.Part0 = Torso
4779 headWeld.Part1 = headBase
4780 headWeld.C0 = CF(0, 1.5, 0)
4781 headWeld.Parent = Torso
4782
4783 headWeld2 = Instance.new("Weld")
4784 headWeld2.Part0 = headBase
4785 headWeld2.Part1 = Head
4786 headWeld2.Parent = headBase
4787
4788 neckClone = Neck:Clone()
4789
4790 --[[local stanceBase = Instance.new("Part")
4791 stanceBase.Transparency = 1
4792 stanceBase.Name = "stanceBase"
4793 stanceBase.CanCollide = false
4794 stanceBase.FormFactor = Enum.FormFactor.Custom
4795 stanceBase.Size = V3(0.2, 0.2, 0.2)
4796 stanceBase.BottomSurface = Enum.SurfaceType.Smooth
4797 stanceBase.TopSurface = Enum.SurfaceType.Smooth
4798 stanceBase.Parent = playerFolder
4799
4800 stanceWeld = Instance.new("Weld")
4801 stanceWeld.Part0 = stanceBase
4802 stanceWeld.Part1 = Torso
4803 stanceWeld.Parent = stanceBase]]
4804
4805 local animBase = Instance.new("Part")
4806 animBase.Transparency = 1
4807 animBase.Name = "animBase"
4808 animBase.CanCollide = false
4809 animBase.FormFactor = Enum.FormFactor.Custom
4810 animBase.Size = V3(0.2, 0.2, 0.2)
4811 animBase.BottomSurface = Enum.SurfaceType.Smooth
4812 animBase.TopSurface = Enum.SurfaceType.Smooth
4813 animBase.Parent = playerFolder
4814
4815 animWeld = Instance.new("Weld")
4816 animWeld.Part0 = animBase
4817 animWeld.Part1 = headBase
4818 animWeld.Parent = animBase
4819
4820 local ArmBase = Instance.new("Part")
4821 ArmBase.Transparency = 1
4822 ArmBase.Name = "ArmBase"
4823 ArmBase.CanCollide = false
4824 ArmBase.FormFactor = Enum.FormFactor.Custom
4825 ArmBase.Size = V3(0.2, 0.2, 0.2)
4826 ArmBase.BottomSurface = Enum.SurfaceType.Smooth
4827 ArmBase.TopSurface = Enum.SurfaceType.Smooth
4828 ArmBase.Parent = playerFolder
4829
4830 ABWeld = Instance.new("Weld")
4831 ABWeld.Part0 = ArmBase
4832 ABWeld.Part1 = animBase
4833 ABWeld.Parent = ArmBase
4834
4835 local LArmBase = Instance.new("Part")
4836 LArmBase.Transparency = 1
4837 LArmBase.Name = "LArmBase"
4838 LArmBase.CanCollide = false
4839 LArmBase.FormFactor = Enum.FormFactor.Custom
4840 LArmBase.Size = V3(0.2, 0.2, 0.2)
4841 LArmBase.BottomSurface = Enum.SurfaceType.Smooth
4842 LArmBase.TopSurface = Enum.SurfaceType.Smooth
4843 LArmBase.Parent = playerFolder
4844
4845 local RArmBase = Instance.new("Part")
4846 RArmBase.Transparency = 1
4847 RArmBase.Name = "RArmBase"
4848 RArmBase.CanCollide = false
4849 RArmBase.FormFactor = Enum.FormFactor.Custom
4850 RArmBase.Size = V3(0.2, 0.2, 0.2)
4851 RArmBase.BottomSurface = Enum.SurfaceType.Smooth
4852 RArmBase.TopSurface = Enum.SurfaceType.Smooth
4853 RArmBase.Parent = playerFolder
4854
4855 LWeld = Instance.new("Weld")
4856 LWeld.Name = "LWeld"
4857 LWeld.Part0 = ArmBase
4858 LWeld.Part1 = LArmBase
4859 LWeld.C0 = armC0[1]
4860 LWeld.C1 = S.equipSettings.leftArmC1
4861 LWeld.Parent = ArmBase
4862
4863 RWeld = Instance.new("Weld")
4864 RWeld.Name = "RWeld"
4865 RWeld.Part0 = ArmBase
4866 RWeld.Part1 = RArmBase
4867 RWeld.C0 = armC0[2]
4868 RWeld.C1 = S.equipSettings.rightArmC1
4869 RWeld.Parent = ArmBase
4870
4871 LWeld2 = Instance.new("Weld")
4872 LWeld2.Name = "LWeld"
4873 LWeld2.Part0 = LArmBase
4874 LWeld2.Part1 = LArm
4875 LWeld2.Parent = LArmBase
4876
4877 RWeld2 = Instance.new("Weld")
4878 RWeld2.Name = "RWeld"
4879 RWeld2.Part0 = RArmBase
4880 RWeld2.Part1 = RArm
4881 RWeld2.Parent = RArmBase
4882
4883 LLegWeld = Instance.new("Weld")
4884 LLegWeld.Name = "LLegWeld"
4885 LLegWeld.Part0 = Torso
4886 LLegWeld.Part1 = nil
4887 LLegWeld.C0 = CF(-0.5, -2, 0)
4888 LLegWeld.Parent = Torso
4889
4890 RLegWeld = Instance.new("Weld")
4891 RLegWeld.Name = "RLegWeld"
4892 RLegWeld.Part0 = Torso
4893 RLegWeld.Part1 = nil
4894 RLegWeld.C0 = CF(0.5, -2, 0)
4895 RLegWeld.Parent = Torso
4896
4897 if S.playerArms then
4898 armModel = Instance.new("Model", workspace.FilteringEnabled and playerFolder or Cam)
4899
4900 fakeLArm = LArm:Clone()
4901 fakeLArm.Parent = armModel
4902 fakeLArm.Transparency = S.fakeArmSettings.Transparency
4903 fakeLArm.CanCollide = false
4904 fakeLArm.Size = S.fakeArmSettings.armSize
4905 fakeLArm:BreakJoints()
4906
4907 --LArm.Transparency = 1
4908
4909 local fakeLWeld = Instance.new("Weld")
4910 fakeLWeld.Part0 = fakeLArm
4911 fakeLWeld.Part1 = LArm
4912 fakeLWeld.Parent = fakeLArm
4913
4914 fakeRArm = RArm:Clone()
4915 fakeRArm.Parent = armModel
4916 fakeRArm.Transparency = S.fakeArmSettings.Transparency
4917 fakeRArm.CanCollide = false
4918 fakeRArm.Size = S.fakeArmSettings.armSize
4919 fakeRArm:BreakJoints()
4920
4921 --RArm.Transparency = 1
4922
4923 local fakeRWeld = Instance.new("Weld")
4924 fakeRWeld.Part0 = fakeRArm
4925 fakeRWeld.Part1 = RArm
4926 fakeRWeld.Parent = fakeRArm
4927
4928 Instance.new("Humanoid", armModel)
4929
4930 if S.fakeArmSettings.characterMeshes then
4931 for _,Obj in pairs(Char:GetChildren()) do
4932 if Obj:IsA("CharacterMesh") then
4933 Obj:Clone().Parent = armModel
4934 end
4935 end
4936 end
4937 for _,Obj in pairs(Char:GetChildren()) do
4938 if Obj:IsA("Shirt") then
4939 Obj:Clone().Parent = armModel
4940 end
4941 end
4942 else
4943 armTable = createArms()
4944 if workspace.FilteringEnabled then
4945 armTable[1].Model.Parent = playerFolder
4946 armTable[2].Model.Parent = playerFolder
4947 else
4948 armTable[1].Model.Parent = Cam--playerFolder
4949 armTable[2].Model.Parent = Cam--playerFolder
4950 end
4951
4952 fakeLArm = armTable[1].armPart
4953
4954 --LArm.Transparency = 1
4955
4956 local fakeLWeld = Instance.new("Weld")
4957 fakeLWeld.Part0 = fakeLArm
4958 fakeLWeld.Part1 = LArm
4959 fakeLWeld.Parent = fakeLArm
4960
4961 fakeRArm = armTable[2].armPart
4962
4963 --RArm.Transparency = 1
4964
4965 local fakeRWeld = Instance.new("Weld")
4966 fakeRWeld.Part0 = fakeRArm
4967 fakeRWeld.Part1 = RArm
4968 fakeRWeld.Parent = fakeRArm
4969 end
4970
4971 --------------------[ MODIFYING THE GUN ]-------------------------------------
4972
4973 for _, Tab in pairs(gunParts) do
4974 local Weld = Instance.new("Weld")
4975 Weld.Name = "MainWeld"
4976 Weld.Part0 = Handle
4977 Weld.Part1 = Tab.Obj
4978 Weld.C0 = Tab.Obj.weldCF.Value
4979 Weld.Parent = Handle
4980 Tab.Weld = Weld
4981 end
4982
4983 Grip = RArm:WaitForChild("RightGrip")
4984
4985 local handleCF = Torso.CFrame * CF(0, 0.5, 0) * armC0[2] * S.aimedC1.rightArm:inverse() * Grip.C0
4986 local handleOffset = AimPart.CFrame:toObjectSpace(Handle.CFrame)
4987 aimedGripCF = ((Torso.CFrame * CF(headOffset.X, headOffset.Y, 0)) * handleOffset):toObjectSpace(handleCF)
4988
4989 Grip.C1 = S.equipSettings.GripC1
4990
4991 --------------------[ RUNNING PLUGINS ]---------------------------------------
4992
4993 for _, Plugin in pairs(Plugins.OnEquipped) do
4994 spawn(function()
4995 Plugin()
4996 end)
4997 end
4998
4999 --------------------[ GETTING PLAYER MASS ]-----------------------------------
5000
5001 local connectedParts = HRP:GetConnectedParts(true)
5002 for _, v in pairs(connectedParts) do
5003 if v:IsA("BasePart") then
5004 playerMass = playerMass + v:GetMass()
5005 end
5006 end
5007
5008 --------------------[ CONNECTIONS ]-------------------------------------------
5009
5010 INSERT(Connections, Humanoid.Died:connect(function()
5011 onUnequipped(true)
5012 end))
5013
5014 INSERT(Connections, Humanoid.Jumping:connect(function()
5015 if Stance ~= 0 then
5016 Stand()
5017 end
5018 end))
5019
5020 INSERT(Connections, Humanoid.StateChanged:connect(onHumanoidStateChanged))
5021
5022 INSERT(Connections, Humanoid.HealthChanged:connect(updateHealth))
5023
5024 INSERT(Connections, M2.Button1Down:connect(onMB1Down))
5025
5026 INSERT(Connections, M2.Button1Up:connect(onMB1Up))
5027
5028 INSERT(Connections, M2.Button2Down:connect(onMB2Down))
5029
5030 INSERT(Connections, M2.Button2Up:connect(onMB2Up))
5031
5032 INSERT(Connections, M2.KeyDown:connect(keyDown))
5033
5034 INSERT(Connections, M2.KeyUp:connect(keyUp))
5035
5036 if S.sensitivitySettings.scrollToChange then
5037 INSERT(Connections, M2.WheelForward:connect(onScrollUp))
5038 INSERT(Connections, M2.WheelBackward:connect(onScrollDown))
5039 end
5040
5041 if S.AutoKnife then
5042 INSERT(Connections, RS.Stepped:connect(function()
5043 local H, P = AdvRayCast(Head.CFrame.p, Head.CFrame.lookVector, S.AutoKnifeDist, nil)
5044 if H then
5045 local HitHuman = findFirstClass(H.Parent, "Humanoid")
5046 if HitHuman and isEnemy(HitHuman) and HitHuman.Health ~= 0 then
5047 Knife()
5048 end
5049 end
5050 end))
5051 end
5052
5053 INSERT(Connections, UIS.InputChanged:connect(function(inputObj)
5054 if inputObj.UserInputType == Enum.UserInputType.MouseMovement then
5055 local rawCamAng = camAng - (VEC2(RAD(inputObj.Delta.x), RAD(inputObj.Delta.y)) * mouseSensitivity * 0.25)
5056 camAng = VEC2(rawCamAng.x, (rawCamAng.y > RAD(80) and RAD(80) or rawCamAng.y < RAD(-80) and RAD(-80) or rawCamAng.y))
5057
5058 desiredXOffset = math.min(math.max(inputObj.Delta.x, -S.momentumSettings.maxInput), S.momentumSettings.maxInput)
5059 desiredYOffset = math.min(math.max(inputObj.Delta.y, -S.momentumSettings.maxInput), S.momentumSettings.maxInput)
5060 end
5061 end))
5062
5063 INSERT(Connections, M2.Idle:connect(function(inputObj)
5064 desiredXOffset = 0
5065 desiredYOffset = 0
5066 end))
5067
5068 INSERT(Connections, RS.Stepped:connect(function()
5069 if tick() - lastBeat > (Humanoid.Health / 75) then
5070 lastBeat = tick()
5071 HUD.Health.Tray.Beat:TweenPosition(
5072 UDim2.new(0, -21, 0, 0),
5073 Enum.EasingDirection.Out,
5074 Enum.EasingStyle.Linear,
5075 0.7 - ((100 - Humanoid.Health) / 400),
5076 false,
5077 function()
5078 HUD.Health.Tray.Beat.Position = UDim2.new(1, 0, 0, 0)
5079 end
5080 )
5081 end
5082 end))
5083
5084 INSERT(Connections, RS.RenderStepped:connect(function()
5085 --Main animation
5086 local animC0, animC1 = getAnimCF()
5087 animWeld.C0 = animC0
5088 animWeld.C1 = animC1
5089
5090 --Camera updating
5091 renderCamera()
5092 end))
5093
5094 --------------------[ ANIMATE GUN ]-------------------------------------------
5095
5096 tweenJoint(LWeld, nil, S.unAimedC1.leftArm, Sine, S.equipSettings.Time)
5097 tweenJoint(RWeld, nil, S.unAimedC1.rightArm, Sine, S.equipSettings.Time)
5098 tweenJoint(Grip, nil, S.unAimedC1.Grip, Sine, S.equipSettings.Time)
5099 spawn(function()
5100 local T = tick()
5101 while true do
5102 if tick() - T > S.equipSettings.Time then break end
5103 if (not Selected) then break end
5104 wait()
5105 end
5106 equipAnimPlaying = false
5107 end)
5108
5109 Animate()
5110 end
5111end
5112
5113function onUnequipped(deleteTool)
5114 if Selected then
5115 Selected = false
5116
5117 breakReload = true
5118
5119 --------------------[ RUNNING PLUGINS ]---------------------------------------
5120
5121 for _, Plugin in pairs(Plugins.OnUnEquipped) do
5122 spawn(function()
5123 Plugin()
5124 end)
5125 end
5126
5127 --------------------[ MODIFYING THE PLAYER ]----------------------------------
5128
5129 Cam.FieldOfView = 70
5130 Cam.CameraType = Enum.CameraType.Custom
5131
5132 UIS.MouseBehavior = Enum.MouseBehavior.Default
5133 UIS.MouseIconEnabled = true
5134
5135 Player.CameraMode = Enum.CameraMode.Classic
5136
5137 if armTable then
5138 armTable[1].Model:Destroy()
5139 armTable[2].Model:Destroy()
5140 elseif armModel then
5141 armModel:Destroy()
5142 end
5143
5144 LLegWeld:Destroy()
5145 RLegWeld:Destroy()
5146
5147 changePlayerTrans(Char, 0)
5148
5149 mainGUI.Parent = script
5150
5151 Shoulders.Right.Part1 = RArm
5152 Shoulders.Left.Part1 = LArm
5153
5154 neckClone.Parent = Torso
5155 headWeld:Destroy()
5156
5157 Humanoid.WalkSpeed = 16
5158 Humanoid.AutoRotate = true
5159
5160 --------------------[ RESETING THE TOOL ]-------------------------------------
5161
5162 gunIgnore:Destroy()
5163
5164 mouseSensitivity = S.sensitivitySettings.Default
5165
5166 MB1Down = false
5167
5168 playerMass = 0
5169
5170 Aimed = false
5171
5172 camOffsets = {
5173 guiScope = {
5174 Rot = V3();
5175 };
5176 Reload = {
5177 Rot = V3();
5178 Code = nil;
5179 };
5180 Recoil = {
5181 Rot = V3();
5182 Code = nil;
5183 };
5184 }
5185
5186 recoilAnim = {
5187 Pos = V3();
5188 Rot = V3();
5189 Code = nil;
5190 }
5191
5192 --Setting the aim variables to unaimed
5193 spreadZoom = "unAimed"
5194 scopeMain.Visible = false
5195 scopeSteady.Visible = false
5196 aimAlpha = 0
5197 aimHeadOffset = 0
5198 jumpAnimMultiplier = 1
5199 translationDivisor = 7
5200 rotationMultiplier = S.momentumSettings.Amplitude.unAimed
5201 armTiltMultiplier = 1
5202 Scope.BackgroundTransparency = 1
5203 if S.guiScope then
5204 spawn(function()
5205 for _, Obj in pairs(Gun:GetChildren()) do
5206 if Obj:IsA("BasePart") then
5207 Obj.LocalTransparencyModifier = 0
5208 end
5209 end
5210 end)
5211 end
5212
5213 onGround = true
5214
5215 for _, Tab in pairs(gunParts) do
5216 Tab.Weld:Destroy()
5217 Tab.Weld = nil
5218 end
5219
5220 for _,c in pairs(Connections) do
5221 c:disconnect()
5222 end
5223
5224 Connections = {}
5225
5226 if deleteTool then
5227 Cam:ClearAllChildren()
5228 Gun:Destroy()
5229 end
5230
5231 wait() --This is here in case you dolphin dived and deselected the tool instantly
5232
5233 if S.stanceSettings.standOnDeselect and Stance ~= 0 then
5234 crawlCamRot = 0
5235 isCrawling = false
5236 stanceSway = 1
5237 spreadStance = "Stand"
5238 Stand(true)
5239 end
5240 baseSpread = S.spreadSettings[spreadZoom][spreadStance][spreadMotion]
5241 end
5242end
5243
5244Gun.Equipped:connect(onEquipped)
5245Gun.Unequipped:connect(function() onUnequipped(false) end)
5246
5247--------------------------------------------------------------------------------------
5248--------------------[ END PROGRAM ]---------------------------------------------------
5249--------------------------------------------------------------------------------------
5250end))IntValue39.Name = "ignoreCode"
5251IntValue39.Parent = LocalScript38
5252Folder40.Name = "Server_Scripts"
5253Folder40.Parent = LocalScript38
5254ModuleScript41.Name = "Spring"
5255ModuleScript41.Parent = LocalScript38
5256table.insert(cors,sandbox(ModuleScript41,function()
5257local Spring = {}
5258
5259function Spring.new(Initial)
5260 local t0 = tick()
5261 local p0 = Initial or 0
5262 local v0 = Initial and Vector3.new() or 0
5263 local t = Initial or 0
5264 local d = 1
5265 local s = 1
5266
5267 local function positionVelocity(Tick)
5268 local x = Tick - t0
5269 local c0 = p0 - t
5270 if s == 0 then
5271 return p0, 0
5272 elseif d < 1 then
5273 local c = math.sqrt(1 - d ^ 2)
5274 local c1 = (v0 / s + d * c0) / c
5275 local co = math.cos(c * s * x)
5276 local si = math.sin(c * s * x)
5277 local e = math.exp(d * s * x)
5278 local p = t + (c0 * co + c1 * si) / e
5279 local v = s * ((c * c1 - d * c0) * co - (c * c0 + d * c1) * si) / e
5280 return p, v
5281 else
5282 local c1 = v0 / s + c0
5283 local e = math.exp(s * x)
5284 local p = t + (c0 + c1 * s * x) / e
5285 local v = s * (c1 - c0 - c1 * s * x) / e
5286 return p, v
5287 end
5288 end
5289
5290 return setmetatable(
5291 {
5292 accelerate = function(_, acceleration)
5293 local T = tick()
5294 local p, v = positionVelocity(T)
5295 p0 = p
5296 v0 = v + acceleration
5297 t0 = T
5298 end;
5299 },
5300 {
5301 __index = function(_, index)
5302 if index == "value" or index == "position" or index == "p" then
5303 local p, v = positionVelocity(tick())
5304 return p
5305 elseif index == "velocity" or index == "v" then
5306 local p, v = positionVelocity(tick())
5307 return v
5308 elseif index == "acceleration" or index == "a" then
5309 local x = tick() - t0
5310 local c0 = p0 - t
5311 if s == 0 then
5312 return 0
5313 elseif d < 1 then
5314 local c = math.sqrt(1 - d ^ 2)
5315 local c1 = (v0 / s + d * c0) / c
5316 local cs = (c0 * d ^ 2 - 2 * c * d * c1 - c0 * c ^ 2) * math.cos(c * s * x)
5317 local sn = (c1 * d ^ 2 + 2 * c * d * c0 - c1 * c ^ 2) * math.sin(c * s * x)
5318 return s ^ 2 *(cs + sn) / math.exp(d * s * x)
5319 else
5320 local c1 = v0 / s + c0
5321 return s ^ 2 * (c0 - 2 * c1 + c1 * s * x) / math.exp(s * x)
5322 end
5323 elseif index == "target" or index == "t" then
5324 return t
5325 elseif index == "damper" or index == "d" then
5326 return d
5327 elseif index == "speed" or index == "s" then
5328 return s
5329 elseif index == "magnitude" or index == "m" then
5330 local p, v = positionVelocity(tick())
5331 return p.magnitude
5332 else
5333 error(index.." is not a valid member of spring", 0)
5334 end
5335 end;
5336
5337 __newindex = function(_, index, value)
5338 local T = tick()
5339 if index == "value" or index == "position" or index == "p" then
5340 local p, v = positionVelocity(T)
5341 p0, v0 = value, v
5342 elseif index == "velocity" or index == "v" then
5343 local p, v = positionVelocity(T)
5344 p0, v0 = p, value
5345 elseif index == "acceleration" or index == "a" then
5346 local p, v = positionVelocity(T)
5347 p0, v0 = p, v + value
5348 elseif index == "target" or index == "t" then
5349 p0, v0 = positionVelocity(T)
5350 t = value
5351 elseif index == "damper" or index == "d" then
5352 p0, v0 = positionVelocity(T)
5353 d = value < 0 and 0 or value < 1 and value or 1
5354 elseif index == "speed" or index == "s" then
5355 p0, v0 = positionVelocity(T)
5356 s = value < 0 and 0 or value
5357 else
5358 error(index.." is not a valid member of spring", 0)
5359 end
5360 t0 = T
5361 end;
5362 }
5363 )
5364end
5365
5366return Spring
5367end))
5368ModuleScript42.Name = "Particle"
5369ModuleScript42.Parent = LocalScript38
5370table.insert(cors,sandbox(ModuleScript42,function()
5371---------------------------------------------------------------------------------------------------------
5372--[[
5373
5374 AUTHOR: TurboFusion
5375 DATE CREATED: 4/8/16
5376
5377 DESCRIPTION: This is a module that creates gui particles which simulates physical parts
5378
5379 function Particle.new(Prop)
5380
5381 ARGUMENT: Table {
5382 Table rayIgnore; --This table contains objects that the visiblity checking ray should ignore (DEFAULT: {})
5383 Color3 Color; --This color3 value is what color the particle will be (DEFAULT: Color3.new(1, 1, 1))
5384 float Length; --This float value is how long the particle will be in world space (DEFAULT: 1)
5385 float Width; --This float value is how wide the particle will be in world space (DEFAULT: 1)
5386 Vector3 p0; --This Vector3 value is the initial position of the particle (Must exist)
5387 Vector3 v0; --This Vector3 value is the initial velocity of the particle (Must exist)
5388 Vector3 a0; --This Vector3 value is the initial acceleration of the particle (Must exist)
5389 }
5390
5391 RETURNS: Metatable
5392
5393 EDITABLE PROPERTIES:
5394 Particle.t = float Time --Sets a time value in seconds which is used to figure out where to render the particle (t=0 will be initial conditions)
5395
5396 READ-ONLY PROPERTIES:
5397 Particle.p or Particle.position --Returns a world position of the particle
5398 Particle.v or Particle.velocity --Returns a world velocity of the particle
5399 Particle.obj or Particle.object --Returns the particle frame itself
5400
5401 METHODS:
5402 Particle:delete() --This method deletes the particle and stops rendering calculations (use this instead of directly destroying the frame itself)
5403
5404 EXAMPLE CODE:
5405 local t = 0
5406 local Particle = Particle.new(
5407 {
5408 Color = Color3.new(1, 1, 0);
5409 Width = 1;
5410 p0 = Vector3.new();
5411 v0 = Vector3.new(0, 100, 100);
5412 a0 = Vector3.new(0, -196.2, 0);
5413 }
5414 )
5415 Particle.obj.Parent = screenGui
5416 while true do
5417 Particle.t = t
5418 t = t + 1/30
5419 wait()
5420 end
5421
5422--]]
5423---------------------------------------------------------------------------------------------------------
5424
5425local Particle = {}
5426
5427function Particle.new(Prop)
5428 ----------[ CONSTANTS ]--------------------
5429
5430 local Cam = workspace.CurrentCamera
5431 local rayIgnore = Prop.rayIgnore or {} --If the property doesn't exist, then set it to it's default
5432 local Color = Prop.Color or Color3.new(1, 1, 1)
5433 local Length = Prop.Length or 1
5434 local Width = Prop.Width or 1
5435 local p0 = Prop.p0 or error("Particle.new requires a p0 (origin position) property!", 0) --Give an error message if you don't this
5436 local v0 = Prop.v0 or error("Particle.new requires a v0 (initial velocity) property!", 0)
5437 local a0 = Prop.a0 or error("Particle.new requires an a0 (initial acceleration) property!", 0)
5438
5439 ----------[ VARIABLES ]--------------------
5440
5441 local Deleted = false
5442 local p = p0 --Set the position, velocity, and acceleration as the intial conditions
5443 local v = v0
5444 local a = a0
5445 local t = 0
5446
5447 ----------[ FUNCTIONS ]--------------------
5448
5449 local function worldWidthToScreenWidth(Width, Depth) --A function I made that gives you a screen width given a world width and depth
5450 local Center = Cam.CoordinateFrame * CFrame.new(0, 0, -Depth)
5451 local wp1 = (Center * CFrame.new(0, Width / 2, 0)).p
5452 local wp2 = (Center * CFrame.new(0, -Width / 2, 0)).p
5453 local sp1 = Cam:WorldToScreenPoint(wp1) --Use the WorldToScreenPoint method of the camera to get the screen width from the world width
5454 local sp2 = Cam:WorldToScreenPoint(wp2)
5455 return (sp1 - sp2).magnitude
5456 end
5457
5458 ----------[ MAIN PROGRAM ]-----------------
5459
5460 local Container = Instance.new("Frame")
5461 Container.BackgroundTransparency = 1
5462 Container.Position = UDim2.new()
5463 Container.Size = UDim2.new()
5464 local Line = Instance.new("Frame")
5465 Line.BackgroundColor3 = Color
5466 Line.BorderSizePixel = 0
5467 Line.Position = UDim2.new()
5468 Line.Size = UDim2.new()
5469 Line.Parent = Container
5470
5471 return setmetatable(
5472 {
5473 delete = function() --This function safely removes the particle
5474 Container:Destroy()
5475 Deleted = true
5476 end
5477 },
5478 {
5479 __index = function(_, Index)
5480 if Index == "p" or Index == "position" then --Return the world position of the particle
5481 return (Deleted and nil or p)
5482 elseif Index == "v" or Index == "velocity" then --Return the world velocity of the particle
5483 return (Deleted and nil or v)
5484 elseif Index == "obj" or Index == "object" then --Return the particle frame itself
5485 return (Deleted and nil or Container)
5486 else
5487 error(Index.." is not a member of Particle!", 0) --Give an error message if any other index is called
5488 end
5489 end;
5490
5491 __newindex = function(_, Index, Value)
5492 if Index == "t" or Index == "time" and (not Deleted) then --Render the particle given a time value
5493 t = Value
5494 p = p0 + (v0 * t) + (0.5 * a0 * t * t) --update the position given the time
5495 v = v0 + (a0 * t) --update the velocity given the time
5496
5497 local testRay1 = Ray.new(Cam.CoordinateFrame.p, (p + (v.unit * Length) / 2) - Cam.CoordinateFrame.p)
5498 local testRay2 = Ray.new(Cam.CoordinateFrame.p, (p - (v.unit * Length) / 2) - Cam.CoordinateFrame.p)
5499 local H1, _ = workspace:FindPartOnRayWithIgnoreList(testRay1, rayIgnore)
5500 local H2, _ = workspace:FindPartOnRayWithIgnoreList(testRay2, rayIgnore)
5501
5502 if H1 and H2 then
5503 Line.Visible = false
5504 else
5505 local face1 = Cam:WorldToScreenPoint(p + (v.unit * Length) / 2) --Get the 2 endpoints of the particle in screen space
5506 local face2 = Cam:WorldToScreenPoint(p - (v.unit * Length) / 2)
5507 local Center, isVisible = Cam:WorldToScreenPoint(p) --Get the center of the particle in screen space
5508
5509 local screenLength = (face1 - face2).magnitude
5510 local screenWidth = worldWidthToScreenWidth(Width, Center.Z)
5511 local Ang = math.atan2(face1.Y - face2.Y, face1.X - face2.X) --Get the angle the particle needs to be at in order to line up
5512
5513 Line.Position = UDim2.new(0, 0, 0, -screenWidth / 2)
5514 Line.Size = UDim2.new(1, 0, 0, screenWidth)
5515 Line.Visible = isVisible --Make the particle invisible if the world point isn't on screen
5516
5517 Container.Position = UDim2.new(
5518 0,
5519 face2.X + (math.cos(Ang) - 1) * screenLength / 2, --Yay trig!
5520 0,
5521 face2.Y + math.sin(Ang) * screenLength / 2
5522 )
5523 Container.Size = UDim2.new(0, screenLength, 0, 0)
5524 Container.Rotation = math.deg(Ang)
5525 end
5526 else
5527 error(Index.." is not a member of Particle!", 0) --Give an error message if any other index is being changed
5528 end
5529 end
5530 }
5531 )
5532end
5533
5534return Particle
5535end))
5536ScreenGui43.Name = "mainGUI"
5537ScreenGui43.Parent = LocalScript38
5538ImageLabel44.Name = "Hex"
5539ImageLabel44.Parent = ScreenGui43
5540ImageLabel44.Position = UDim2.new(1, -166, 1, -166)
5541ImageLabel44.Size = UDim2.new(0, 160, 0, 160)
5542ImageLabel44.BackgroundColor = BrickColor.new("Institutional white")
5543ImageLabel44.BackgroundColor3 = Color3.new(1, 1, 1)
5544ImageLabel44.BackgroundTransparency = 1
5545ImageLabel44.BorderSizePixel = 0
5546ImageLabel44.SizeConstraint = Enum.SizeConstraint.RelativeXX
5547ImageLabel44.Image = "rbxassetid://562251151"
5548ImageLabel44.ImageColor3 = Color3.new(0.333333, 0.666667, 1)
5549ImageLabel44.ImageTransparency = 0.20000000298023
5550Script45.Parent = ImageLabel44
5551table.insert(cors,sandbox(Script45,function()
5552while wait(.01) do
5553script.Parent.Rotation = script.Parent.Rotation + 1
5554end
5555end))
5556Frame46.Name = "HUD"
5557Frame46.Parent = ScreenGui43
5558Frame46.Position = UDim2.new(1, -166, 1, -166)
5559Frame46.Size = UDim2.new(0, 160, 0, 160)
5560Frame46.BackgroundColor = BrickColor.new("Institutional white")
5561Frame46.BackgroundColor3 = Color3.new(1, 1, 1)
5562Frame46.BackgroundTransparency = 1
5563Frame47.Name = "Ammo"
5564Frame47.Parent = Frame46
5565Frame47.Position = UDim2.new(0, 5, 0, 60)
5566Frame47.Size = UDim2.new(0, 135, 0, 40)
5567Frame47.BackgroundTransparency = 1
5568Frame47.ZIndex = 10
5569TextLabel48.Name = "Slash"
5570TextLabel48.Parent = Frame47
5571TextLabel48.Position = UDim2.new(0, 92, 0, -12)
5572TextLabel48.Size = UDim2.new(0, 0, 0, 45)
5573TextLabel48.BackgroundTransparency = 1
5574TextLabel48.ZIndex = 10
5575TextLabel48.Font = Enum.Font.SciFi
5576TextLabel48.FontSize = Enum.FontSize.Size24
5577TextLabel48.Text = "//"
5578TextLabel48.TextColor = BrickColor.new("Institutional white")
5579TextLabel48.TextColor3 = Color3.new(1, 1, 1)
5580TextLabel48.TextSize = 24
5581TextLabel49.Name = "Stored"
5582TextLabel49.Parent = Frame47
5583TextLabel49.Position = UDim2.new(0, 100, 0, -35)
5584TextLabel49.Size = UDim2.new(1, 0, 0, 85)
5585TextLabel49.BackgroundTransparency = 1
5586TextLabel49.ZIndex = 10
5587TextLabel49.Font = Enum.Font.SciFi
5588TextLabel49.FontSize = Enum.FontSize.Size28
5589TextLabel49.Text = "999"
5590TextLabel49.TextColor = BrickColor.new("Institutional white")
5591TextLabel49.TextColor3 = Color3.new(1, 1, 1)
5592TextLabel49.TextSize = 25
5593TextLabel49.TextXAlignment = Enum.TextXAlignment.Left
5594TextLabel50.Name = "Background"
5595TextLabel50.Parent = TextLabel49
5596TextLabel50.Size = UDim2.new(1, 0, 1, 0)
5597TextLabel50.BackgroundTransparency = 1
5598TextLabel50.ZIndex = 10
5599TextLabel50.Font = Enum.Font.SciFi
5600TextLabel50.FontSize = Enum.FontSize.Size28
5601TextLabel50.Text = "000"
5602TextLabel50.TextColor = BrickColor.new("Sand violet metallic")
5603TextLabel50.TextColor3 = Color3.new(0.588235, 0.588235, 0.588235)
5604TextLabel50.TextSize = 25
5605TextLabel50.TextTransparency = 0.80000001192093
5606TextLabel50.TextWrap = true
5607TextLabel50.TextWrapped = true
5608TextLabel50.TextXAlignment = Enum.TextXAlignment.Left
5609TextLabel51.Name = "Clip"
5610TextLabel51.Parent = Frame47
5611TextLabel51.Position = UDim2.new(0, 0, 0, -5)
5612TextLabel51.Size = UDim2.new(0, 85, 1, 0)
5613TextLabel51.BackgroundTransparency = 1
5614TextLabel51.ZIndex = 10
5615TextLabel51.Font = Enum.Font.SciFi
5616TextLabel51.FontSize = Enum.FontSize.Size48
5617TextLabel51.Text = "999"
5618TextLabel51.TextColor = BrickColor.new("Institutional white")
5619TextLabel51.TextColor3 = Color3.new(1, 1, 1)
5620TextLabel51.TextSize = 48
5621TextLabel51.TextWrap = true
5622TextLabel51.TextWrapped = true
5623TextLabel51.TextXAlignment = Enum.TextXAlignment.Right
5624TextLabel52.Name = "Background"
5625TextLabel52.Parent = TextLabel51
5626TextLabel52.Size = UDim2.new(1, 0, 1, 0)
5627TextLabel52.BackgroundTransparency = 1
5628TextLabel52.ZIndex = 10
5629TextLabel52.Font = Enum.Font.SciFi
5630TextLabel52.FontSize = Enum.FontSize.Size48
5631TextLabel52.Text = "000"
5632TextLabel52.TextColor = BrickColor.new("Sand violet metallic")
5633TextLabel52.TextColor3 = Color3.new(0.588235, 0.588235, 0.588235)
5634TextLabel52.TextSize = 48
5635TextLabel52.TextTransparency = 0.80000001192093
5636TextLabel52.TextXAlignment = Enum.TextXAlignment.Right
5637Frame53.Name = "Controls"
5638Frame53.Parent = Frame46
5639Frame53.Position = UDim2.new(0, 0, 0, -200)
5640Frame53.Visible = false
5641Frame53.Size = UDim2.new(1, 0, 0, 120)
5642Frame53.BackgroundColor = BrickColor.new("Black")
5643Frame53.BackgroundColor3 = Color3.new(0.156863, 0.156863, 0.156863)
5644Frame53.BackgroundTransparency = 0.30000001192093
5645Frame53.BorderColor3 = Color3.new(0.156863, 0.156863, 0.156863)
5646Frame53.BorderSizePixel = 5
5647Frame53.ZIndex = 10
5648TextLabel54.Name = "Title"
5649TextLabel54.Parent = Frame53
5650TextLabel54.Size = UDim2.new(1, 0, 0, 15)
5651TextLabel54.BackgroundColor = BrickColor.new("Institutional white")
5652TextLabel54.BackgroundColor3 = Color3.new(1, 1, 1)
5653TextLabel54.BackgroundTransparency = 1
5654TextLabel54.ZIndex = 10
5655TextLabel54.Font = Enum.Font.SourceSansBold
5656TextLabel54.FontSize = Enum.FontSize.Size14
5657TextLabel54.Text = "CONTROLS"
5658TextLabel54.TextColor = BrickColor.new("Institutional white")
5659TextLabel54.TextColor3 = Color3.new(1, 1, 1)
5660TextLabel54.TextSize = 14
5661TextLabel55.Name = "Line"
5662TextLabel55.Parent = TextLabel54
5663TextLabel55.Position = UDim2.new(0, 0, 1, 1)
5664TextLabel55.Size = UDim2.new(1, 0, 0, 2)
5665TextLabel55.BackgroundColor = BrickColor.new("New Yeller")
5666TextLabel55.BackgroundColor3 = Color3.new(1, 1, 0)
5667TextLabel55.BorderSizePixel = 0
5668TextLabel55.ZIndex = 10
5669TextLabel55.Font = Enum.Font.SourceSans
5670TextLabel55.FontSize = Enum.FontSize.Size14
5671TextLabel55.Text = ""
5672TextLabel55.TextSize = 14
5673Frame56.Name = "Grenades"
5674Frame56.Parent = Frame46
5675Frame56.Position = UDim2.new(0, 0, 0, 90)
5676Frame56.Visible = false
5677Frame56.Size = UDim2.new(0, 175, 0, 25)
5678Frame56.BackgroundTransparency = 1
5679Frame56.ZIndex = 10
5680Frame57.Name = "Lethals"
5681Frame57.Parent = Frame56
5682Frame57.Size = UDim2.new(0.5, -2, 1, 0)
5683Frame57.BackgroundColor = BrickColor.new("Institutional white")
5684Frame57.BackgroundColor3 = Color3.new(1, 1, 1)
5685Frame57.BorderSizePixel = 0
5686Frame57.ZIndex = 10
5687ImageLabel58.Name = "Icon"
5688ImageLabel58.Parent = Frame57
5689ImageLabel58.Position = UDim2.new(0, 7, 0, 2)
5690ImageLabel58.Size = UDim2.new(0, 21, 0, 21)
5691ImageLabel58.BackgroundColor = BrickColor.new("Institutional white")
5692ImageLabel58.BackgroundColor3 = Color3.new(1, 1, 1)
5693ImageLabel58.BackgroundTransparency = 1
5694ImageLabel58.ZIndex = 10
5695TextLabel59.Name = "Mult"
5696TextLabel59.Parent = Frame57
5697TextLabel59.Position = UDim2.new(0.5, -10, 0, 0)
5698TextLabel59.Size = UDim2.new(0, 20, 1, 0)
5699TextLabel59.BackgroundColor = BrickColor.new("Institutional white")
5700TextLabel59.BackgroundColor3 = Color3.new(1, 1, 1)
5701TextLabel59.BackgroundTransparency = 1
5702TextLabel59.BorderSizePixel = 0
5703TextLabel59.ZIndex = 10
5704TextLabel59.Font = Enum.Font.ArialBold
5705TextLabel59.FontSize = Enum.FontSize.Size18
5706TextLabel59.Text = "X"
5707TextLabel59.TextColor = BrickColor.new("Really black")
5708TextLabel59.TextColor3 = Color3.new(0, 0, 0)
5709TextLabel59.TextSize = 18
5710TextLabel60.Name = "Num"
5711TextLabel60.Parent = Frame57
5712TextLabel60.Position = UDim2.new(1, -7, 0, 0)
5713TextLabel60.Size = UDim2.new(0, 0, 1, 0)
5714TextLabel60.BackgroundColor = BrickColor.new("Institutional white")
5715TextLabel60.BackgroundColor3 = Color3.new(1, 1, 1)
5716TextLabel60.BackgroundTransparency = 1
5717TextLabel60.ZIndex = 10
5718TextLabel60.Font = Enum.Font.ArialBold
5719TextLabel60.FontSize = Enum.FontSize.Size18
5720TextLabel60.Text = "0"
5721TextLabel60.TextColor = BrickColor.new("Really black")
5722TextLabel60.TextColor3 = Color3.new(0, 0, 0)
5723TextLabel60.TextSize = 18
5724TextLabel60.TextXAlignment = Enum.TextXAlignment.Right
5725Frame61.Name = "Tacticals"
5726Frame61.Parent = Frame56
5727Frame61.Position = UDim2.new(0.5, 2, 0, 0)
5728Frame61.Size = UDim2.new(0.5, -2, 1, 0)
5729Frame61.BackgroundColor = BrickColor.new("Institutional white")
5730Frame61.BackgroundColor3 = Color3.new(1, 1, 1)
5731Frame61.BorderSizePixel = 0
5732Frame61.ZIndex = 10
5733ImageLabel62.Name = "Icon"
5734ImageLabel62.Parent = Frame61
5735ImageLabel62.Position = UDim2.new(0, 7, 0, 2)
5736ImageLabel62.Size = UDim2.new(0, 21, 0, 21)
5737ImageLabel62.BackgroundColor = BrickColor.new("Institutional white")
5738ImageLabel62.BackgroundColor3 = Color3.new(1, 1, 1)
5739ImageLabel62.BackgroundTransparency = 1
5740ImageLabel62.ZIndex = 10
5741TextLabel63.Name = "Num"
5742TextLabel63.Parent = Frame61
5743TextLabel63.Position = UDim2.new(1, -7, 0, 0)
5744TextLabel63.Size = UDim2.new(0, 0, 1, 0)
5745TextLabel63.BackgroundColor = BrickColor.new("Institutional white")
5746TextLabel63.BackgroundColor3 = Color3.new(1, 1, 1)
5747TextLabel63.BackgroundTransparency = 1
5748TextLabel63.ZIndex = 10
5749TextLabel63.Font = Enum.Font.ArialBold
5750TextLabel63.FontSize = Enum.FontSize.Size18
5751TextLabel63.Text = "0"
5752TextLabel63.TextColor = BrickColor.new("Really black")
5753TextLabel63.TextColor3 = Color3.new(0, 0, 0)
5754TextLabel63.TextSize = 18
5755TextLabel63.TextXAlignment = Enum.TextXAlignment.Right
5756TextLabel64.Name = "Mult"
5757TextLabel64.Parent = Frame61
5758TextLabel64.Position = UDim2.new(0.5, -10, 0, 0)
5759TextLabel64.Size = UDim2.new(0, 20, 1, 0)
5760TextLabel64.BackgroundColor = BrickColor.new("Institutional white")
5761TextLabel64.BackgroundColor3 = Color3.new(1, 1, 1)
5762TextLabel64.BackgroundTransparency = 1
5763TextLabel64.BorderSizePixel = 0
5764TextLabel64.ZIndex = 10
5765TextLabel64.Font = Enum.Font.ArialBold
5766TextLabel64.FontSize = Enum.FontSize.Size18
5767TextLabel64.Text = "X"
5768TextLabel64.TextColor = BrickColor.new("Really black")
5769TextLabel64.TextColor3 = Color3.new(0, 0, 0)
5770TextLabel64.TextSize = 18
5771Frame65.Name = "Health"
5772Frame65.Parent = Frame46
5773Frame65.Position = UDim2.new(0, 25, 0, 20)
5774Frame65.Visible = false
5775Frame65.Size = UDim2.new(0.400000006, 0, 0, 25)
5776Frame65.BackgroundColor = BrickColor.new("Dirt brown")
5777Frame65.BackgroundColor3 = Color3.new(0.247059, 0.247059, 0.247059)
5778Frame65.BackgroundTransparency = 1
5779Frame65.BorderColor3 = Color3.new(0.156863, 0.156863, 0.156863)
5780Frame65.BorderSizePixel = 0
5781Frame65.Draggable = true
5782Frame65.ZIndex = 10
5783TextLabel66.Name = "Num"
5784TextLabel66.Parent = Frame65
5785TextLabel66.Position = UDim2.new(1, -50, 0, 0)
5786TextLabel66.Size = UDim2.new(0, 50, 1, 0)
5787TextLabel66.BackgroundColor = BrickColor.new("Really black")
5788TextLabel66.BackgroundColor3 = Color3.new(0, 0, 0)
5789TextLabel66.BackgroundTransparency = 1
5790TextLabel66.BorderColor = BrickColor.new("Really black")
5791TextLabel66.BorderColor3 = Color3.new(0, 0, 0)
5792TextLabel66.BorderSizePixel = 0
5793TextLabel66.ZIndex = 10
5794TextLabel66.Font = Enum.Font.SourceSansBold
5795TextLabel66.FontSize = Enum.FontSize.Size24
5796TextLabel66.Text = "100%"
5797TextLabel66.TextColor = BrickColor.new("Institutional white")
5798TextLabel66.TextColor3 = Color3.new(1, 1, 1)
5799TextLabel66.TextSize = 24
5800TextLabel66.TextStrokeColor3 = Color3.new(0.745098, 0.745098, 0.745098)
5801TextLabel66.TextXAlignment = Enum.TextXAlignment.Right
5802Frame67.Name = "Tray"
5803Frame67.Parent = Frame65
5804Frame67.Position = UDim2.new(0, 2, 0.5, -10)
5805Frame67.Visible = false
5806Frame67.Size = UDim2.new(1, -60, 0, 20)
5807Frame67.BackgroundColor = BrickColor.new("Really black")
5808Frame67.BackgroundColor3 = Color3.new(0, 0, 0)
5809Frame67.BackgroundTransparency = 1
5810Frame67.BorderColor = BrickColor.new("Really black")
5811Frame67.BorderColor3 = Color3.new(0, 0, 0)
5812Frame67.BorderSizePixel = 0
5813Frame67.ClipsDescendants = true
5814Frame67.ZIndex = 10
5815Frame68.Name = "Beat"
5816Frame68.Parent = Frame67
5817Frame68.Position = UDim2.new(1, 0, 0, 0)
5818Frame68.Size = UDim2.new(0, 21, 1, 0)
5819Frame68.BackgroundColor = BrickColor.new("Really black")
5820Frame68.BackgroundColor3 = Color3.new(0, 0, 0)
5821Frame68.BackgroundTransparency = 1
5822Frame68.BorderColor = BrickColor.new("Really black")
5823Frame68.BorderColor3 = Color3.new(0, 0, 0)
5824Frame68.BorderSizePixel = 0
5825Frame68.ZIndex = 10
5826Frame69.Name = "00"
5827Frame69.Parent = Frame68
5828Frame69.Position = UDim2.new(0, 0, 0.5, -2)
5829Frame69.Size = UDim2.new(0.0476190485, 0, 0, 3)
5830Frame69.BackgroundColor = BrickColor.new("Institutional white")
5831Frame69.BackgroundColor3 = Color3.new(1, 1, 1)
5832Frame69.BorderColor = BrickColor.new("Really black")
5833Frame69.BorderColor3 = Color3.new(0, 0, 0)
5834Frame69.BorderSizePixel = 0
5835Frame69.ZIndex = 10
5836Frame70.Name = "01"
5837Frame70.Parent = Frame68
5838Frame70.Position = UDim2.new(0.0476190485, 0, 0.423076928, -2)
5839Frame70.Size = UDim2.new(0.0476190485, 0, 0, 4)
5840Frame70.BackgroundColor = BrickColor.new("Institutional white")
5841Frame70.BackgroundColor3 = Color3.new(1, 1, 1)
5842Frame70.BorderColor = BrickColor.new("Really black")
5843Frame70.BorderColor3 = Color3.new(0, 0, 0)
5844Frame70.BorderSizePixel = 0
5845Frame70.ZIndex = 10
5846Frame71.Name = "02"
5847Frame71.Parent = Frame68
5848Frame71.Position = UDim2.new(0.095238097, 0, 0.346153855, -2)
5849Frame71.Size = UDim2.new(0.0476190485, 0, 0, 4)
5850Frame71.BackgroundColor = BrickColor.new("Institutional white")
5851Frame71.BackgroundColor3 = Color3.new(1, 1, 1)
5852Frame71.BorderColor = BrickColor.new("Really black")
5853Frame71.BorderColor3 = Color3.new(0, 0, 0)
5854Frame71.BorderSizePixel = 0
5855Frame71.ZIndex = 10
5856Frame72.Name = "03"
5857Frame72.Parent = Frame68
5858Frame72.Position = UDim2.new(0.142857149, 0, 0.269230783, -2)
5859Frame72.Size = UDim2.new(0.0476190485, 0, 0, 4)
5860Frame72.BackgroundColor = BrickColor.new("Institutional white")
5861Frame72.BackgroundColor3 = Color3.new(1, 1, 1)
5862Frame72.BorderColor = BrickColor.new("Really black")
5863Frame72.BorderColor3 = Color3.new(0, 0, 0)
5864Frame72.BorderSizePixel = 0
5865Frame72.ZIndex = 10
5866Frame73.Name = "04"
5867Frame73.Parent = Frame68
5868Frame73.Position = UDim2.new(0.190476194, 0, 0.192307696, -2)
5869Frame73.Size = UDim2.new(0.0476190485, 0, 0, 4)
5870Frame73.BackgroundColor = BrickColor.new("Institutional white")
5871Frame73.BackgroundColor3 = Color3.new(1, 1, 1)
5872Frame73.BorderColor = BrickColor.new("Really black")
5873Frame73.BorderColor3 = Color3.new(0, 0, 0)
5874Frame73.BorderSizePixel = 0
5875Frame73.ZIndex = 10
5876Frame74.Name = "05"
5877Frame74.Parent = Frame68
5878Frame74.Position = UDim2.new(0.238095239, 0, 0.115384616, -2)
5879Frame74.Size = UDim2.new(0.0476190485, 0, 0, 4)
5880Frame74.BackgroundColor = BrickColor.new("Institutional white")
5881Frame74.BackgroundColor3 = Color3.new(1, 1, 1)
5882Frame74.BorderColor = BrickColor.new("Really black")
5883Frame74.BorderColor3 = Color3.new(0, 0, 0)
5884Frame74.BorderSizePixel = 0
5885Frame74.ZIndex = 10
5886Frame75.Name = "06"
5887Frame75.Parent = Frame68
5888Frame75.Position = UDim2.new(0.285714298, 0, 0.0384615399, -2)
5889Frame75.Size = UDim2.new(0.0476190485, 0, 0, 4)
5890Frame75.BackgroundColor = BrickColor.new("Institutional white")
5891Frame75.BackgroundColor3 = Color3.new(1, 1, 1)
5892Frame75.BorderColor = BrickColor.new("Really black")
5893Frame75.BorderColor3 = Color3.new(0, 0, 0)
5894Frame75.BorderSizePixel = 0
5895Frame75.ZIndex = 10
5896Frame76.Name = "07"
5897Frame76.Parent = Frame68
5898Frame76.Position = UDim2.new(0.333333343, 0, 0, -2)
5899Frame76.Size = UDim2.new(0.0476190485, 0, 0, 4)
5900Frame76.BackgroundColor = BrickColor.new("Institutional white")
5901Frame76.BackgroundColor3 = Color3.new(1, 1, 1)
5902Frame76.BorderColor = BrickColor.new("Really black")
5903Frame76.BorderColor3 = Color3.new(0, 0, 0)
5904Frame76.BorderSizePixel = 0
5905Frame76.ZIndex = 10
5906Frame77.Name = "08"
5907Frame77.Parent = Frame68
5908Frame77.Position = UDim2.new(0.380952388, 0, 0.142857149, -2)
5909Frame77.Size = UDim2.new(0.0476190485, 0, 0, 4)
5910Frame77.BackgroundColor = BrickColor.new("Institutional white")
5911Frame77.BackgroundColor3 = Color3.new(1, 1, 1)
5912Frame77.BorderColor = BrickColor.new("Really black")
5913Frame77.BorderColor3 = Color3.new(0, 0, 0)
5914Frame77.BorderSizePixel = 0
5915Frame77.ZIndex = 10
5916Frame78.Name = "09"
5917Frame78.Parent = Frame68
5918Frame78.Position = UDim2.new(0.428571433, 0, 0.285714298, -2)
5919Frame78.Size = UDim2.new(0.0476190485, 0, 0, 4)
5920Frame78.BackgroundColor = BrickColor.new("Institutional white")
5921Frame78.BackgroundColor3 = Color3.new(1, 1, 1)
5922Frame78.BorderColor = BrickColor.new("Really black")
5923Frame78.BorderColor3 = Color3.new(0, 0, 0)
5924Frame78.BorderSizePixel = 0
5925Frame78.ZIndex = 10
5926Frame79.Name = "10"
5927Frame79.Parent = Frame68
5928Frame79.Position = UDim2.new(0.476190478, 0, 0.428571433, -2)
5929Frame79.Size = UDim2.new(0.0476190485, 0, 0, 4)
5930Frame79.BackgroundColor = BrickColor.new("Institutional white")
5931Frame79.BackgroundColor3 = Color3.new(1, 1, 1)
5932Frame79.BorderColor = BrickColor.new("Really black")
5933Frame79.BorderColor3 = Color3.new(0, 0, 0)
5934Frame79.BorderSizePixel = 0
5935Frame79.ZIndex = 10
5936Frame80.Name = "11"
5937Frame80.Parent = Frame68
5938Frame80.Position = UDim2.new(0.523809552, 0, 0.571428597, -2)
5939Frame80.Size = UDim2.new(0.0476190485, 0, 0, 4)
5940Frame80.BackgroundColor = BrickColor.new("Institutional white")
5941Frame80.BackgroundColor3 = Color3.new(1, 1, 1)
5942Frame80.BorderColor = BrickColor.new("Really black")
5943Frame80.BorderColor3 = Color3.new(0, 0, 0)
5944Frame80.BorderSizePixel = 0
5945Frame80.ZIndex = 10
5946Frame81.Name = "12"
5947Frame81.Parent = Frame68
5948Frame81.Position = UDim2.new(0.571428597, 0, 0.714285731, -2)
5949Frame81.Size = UDim2.new(0.0476190485, 0, 0, 4)
5950Frame81.BackgroundColor = BrickColor.new("Institutional white")
5951Frame81.BackgroundColor3 = Color3.new(1, 1, 1)
5952Frame81.BorderColor = BrickColor.new("Really black")
5953Frame81.BorderColor3 = Color3.new(0, 0, 0)
5954Frame81.BorderSizePixel = 0
5955Frame81.ZIndex = 10
5956Frame82.Name = "13"
5957Frame82.Parent = Frame68
5958Frame82.Position = UDim2.new(0.619047642, 0, 0.857142866, -2)
5959Frame82.Size = UDim2.new(0.0476190485, 0, 0, 4)
5960Frame82.BackgroundColor = BrickColor.new("Institutional white")
5961Frame82.BackgroundColor3 = Color3.new(1, 1, 1)
5962Frame82.BorderColor = BrickColor.new("Really black")
5963Frame82.BorderColor3 = Color3.new(0, 0, 0)
5964Frame82.BorderSizePixel = 0
5965Frame82.ZIndex = 10
5966Frame83.Name = "14"
5967Frame83.Parent = Frame68
5968Frame83.Position = UDim2.new(0.666666687, 0, 0.916666687, -2)
5969Frame83.Size = UDim2.new(0.0476190485, 0, 0, 4)
5970Frame83.BackgroundColor = BrickColor.new("Institutional white")
5971Frame83.BackgroundColor3 = Color3.new(1, 1, 1)
5972Frame83.BorderColor = BrickColor.new("Really black")
5973Frame83.BorderColor3 = Color3.new(0, 0, 0)
5974Frame83.BorderSizePixel = 0
5975Frame83.ZIndex = 10
5976Frame84.Name = "15"
5977Frame84.Parent = Frame68
5978Frame84.Position = UDim2.new(0.714285731, 0, 0.833333313, -2)
5979Frame84.Size = UDim2.new(0.0476190485, 0, 0, 4)
5980Frame84.BackgroundColor = BrickColor.new("Institutional white")
5981Frame84.BackgroundColor3 = Color3.new(1, 1, 1)
5982Frame84.BorderColor = BrickColor.new("Really black")
5983Frame84.BorderColor3 = Color3.new(0, 0, 0)
5984Frame84.BorderSizePixel = 0
5985Frame84.ZIndex = 10
5986Frame85.Name = "16"
5987Frame85.Parent = Frame68
5988Frame85.Position = UDim2.new(0.761904776, 0, 0.75, -2)
5989Frame85.Size = UDim2.new(0.0476190485, 0, 0, 4)
5990Frame85.BackgroundColor = BrickColor.new("Institutional white")
5991Frame85.BackgroundColor3 = Color3.new(1, 1, 1)
5992Frame85.BorderColor = BrickColor.new("Really black")
5993Frame85.BorderColor3 = Color3.new(0, 0, 0)
5994Frame85.BorderSizePixel = 0
5995Frame85.ZIndex = 10
5996Frame86.Name = "17"
5997Frame86.Parent = Frame68
5998Frame86.Position = UDim2.new(0.809523821, 0, 0.666666687, -2)
5999Frame86.Size = UDim2.new(0.0476190485, 0, 0, 4)
6000Frame86.BackgroundColor = BrickColor.new("Institutional white")
6001Frame86.BackgroundColor3 = Color3.new(1, 1, 1)
6002Frame86.BorderColor = BrickColor.new("Really black")
6003Frame86.BorderColor3 = Color3.new(0, 0, 0)
6004Frame86.BorderSizePixel = 0
6005Frame86.ZIndex = 10
6006Frame87.Name = "18"
6007Frame87.Parent = Frame68
6008Frame87.Position = UDim2.new(0.857142866, 0, 0.583333313, -2)
6009Frame87.Size = UDim2.new(0.0476190485, 0, 0, 4)
6010Frame87.BackgroundColor = BrickColor.new("Institutional white")
6011Frame87.BackgroundColor3 = Color3.new(1, 1, 1)
6012Frame87.BorderColor = BrickColor.new("Really black")
6013Frame87.BorderColor3 = Color3.new(0, 0, 0)
6014Frame87.BorderSizePixel = 0
6015Frame87.ZIndex = 10
6016Frame88.Name = "19"
6017Frame88.Parent = Frame68
6018Frame88.Position = UDim2.new(0.90476191, 0, 0.5, -2)
6019Frame88.Size = UDim2.new(0.0476190485, 0, 0, 4)
6020Frame88.BackgroundColor = BrickColor.new("Institutional white")
6021Frame88.BackgroundColor3 = Color3.new(1, 1, 1)
6022Frame88.BorderColor = BrickColor.new("Really black")
6023Frame88.BorderColor3 = Color3.new(0, 0, 0)
6024Frame88.BorderSizePixel = 0
6025Frame88.ZIndex = 10
6026Frame89.Name = "20"
6027Frame89.Parent = Frame68
6028Frame89.Position = UDim2.new(0.952000022, 0, 0.49000001, -2)
6029Frame89.Size = UDim2.new(0.0476190485, 0, 0, 4)
6030Frame89.BackgroundColor = BrickColor.new("Institutional white")
6031Frame89.BackgroundColor3 = Color3.new(1, 1, 1)
6032Frame89.BorderColor = BrickColor.new("Really black")
6033Frame89.BorderColor3 = Color3.new(0, 0, 0)
6034Frame89.BorderSizePixel = 0
6035Frame89.ZIndex = 10
6036Frame90.Name = "Line"
6037Frame90.Parent = Frame68
6038Frame90.Position = UDim2.new(1, 0, 0.5, -2)
6039Frame90.Size = UDim2.new(0, 200, 0, 3)
6040Frame90.BackgroundColor = BrickColor.new("Institutional white")
6041Frame90.BackgroundColor3 = Color3.new(1, 1, 1)
6042Frame90.BorderColor = BrickColor.new("Really black")
6043Frame90.BorderColor3 = Color3.new(0, 0, 0)
6044Frame90.BorderSizePixel = 0
6045Frame90.ZIndex = 10
6046Frame91.Name = "Line"
6047Frame91.Parent = Frame68
6048Frame91.Position = UDim2.new(0, -200, 0.5, -2)
6049Frame91.Size = UDim2.new(0, 200, 0, 3)
6050Frame91.BackgroundColor = BrickColor.new("Institutional white")
6051Frame91.BackgroundColor3 = Color3.new(1, 1, 1)
6052Frame91.BorderColor = BrickColor.new("Really black")
6053Frame91.BorderColor3 = Color3.new(0, 0, 0)
6054Frame91.BorderSizePixel = 0
6055Frame91.ZIndex = 10
6056Frame92.Name = "Mode"
6057Frame92.Parent = Frame46
6058Frame92.Position = UDim2.new(0, 37, 1, -70)
6059Frame92.Size = UDim2.new(0, 85, 0, 20)
6060Frame92.BackgroundColor = BrickColor.new("Institutional white")
6061Frame92.BackgroundColor3 = Color3.new(1, 1, 1)
6062Frame92.BackgroundTransparency = 1
6063Frame92.ZIndex = 10
6064TextLabel93.Name = "Bracket"
6065TextLabel93.Parent = Frame92
6066TextLabel93.Size = UDim2.new(0, 5, 0, 20)
6067TextLabel93.BackgroundTransparency = 1
6068TextLabel93.ZIndex = 10
6069TextLabel93.Font = Enum.Font.ArialBold
6070TextLabel93.FontSize = Enum.FontSize.Size18
6071TextLabel93.Text = "["
6072TextLabel93.TextColor = BrickColor.new("Institutional white")
6073TextLabel93.TextColor3 = Color3.new(1, 1, 1)
6074TextLabel93.TextSize = 18
6075TextLabel93.TextXAlignment = Enum.TextXAlignment.Left
6076TextLabel94.Name = "Bracket"
6077TextLabel94.Parent = Frame92
6078TextLabel94.Position = UDim2.new(1, -5, 0, 0)
6079TextLabel94.Size = UDim2.new(0, 5, 0, 20)
6080TextLabel94.BackgroundTransparency = 1
6081TextLabel94.ZIndex = 10
6082TextLabel94.Font = Enum.Font.ArialBold
6083TextLabel94.FontSize = Enum.FontSize.Size18
6084TextLabel94.Text = "]"
6085TextLabel94.TextColor = BrickColor.new("Institutional white")
6086TextLabel94.TextColor3 = Color3.new(1, 1, 1)
6087TextLabel94.TextSize = 18
6088TextLabel94.TextXAlignment = Enum.TextXAlignment.Left
6089TextLabel95.Name = "Main"
6090TextLabel95.Parent = Frame92
6091TextLabel95.Size = UDim2.new(1, 0, 0, 20)
6092TextLabel95.BackgroundTransparency = 1
6093TextLabel95.ZIndex = 10
6094TextLabel95.Font = Enum.Font.SourceSansItalic
6095TextLabel95.FontSize = Enum.FontSize.Size18
6096TextLabel95.Text = "Auto"
6097TextLabel95.TextColor = BrickColor.new("Institutional white")
6098TextLabel95.TextColor3 = Color3.new(1, 1, 1)
6099TextLabel95.TextSize = 18
6100TextLabel95.TextWrap = true
6101TextLabel95.TextWrapped = true
6102Frame96.Name = "gunName"
6103Frame96.Parent = Frame46
6104Frame96.Size = UDim2.new(1, 0, 0, 36)
6105Frame96.BackgroundColor = BrickColor.new("Dark grey metallic")
6106Frame96.BackgroundColor3 = Color3.new(0.352941, 0.352941, 0.352941)
6107Frame96.BackgroundTransparency = 1
6108Frame96.ZIndex = 10
6109TextLabel97.Name = "Title"
6110TextLabel97.Parent = Frame96
6111TextLabel97.Position = UDim2.new(0, 35, 0, 23)
6112TextLabel97.Size = UDim2.new(0, 90, 1, 0)
6113TextLabel97.BackgroundColor = BrickColor.new("Institutional white")
6114TextLabel97.BackgroundColor3 = Color3.new(1, 1, 1)
6115TextLabel97.BackgroundTransparency = 1
6116TextLabel97.ZIndex = 10
6117TextLabel97.Font = Enum.Font.SciFi
6118TextLabel97.FontSize = Enum.FontSize.Size36
6119TextLabel97.Text = "GUN NAME"
6120TextLabel97.TextColor = BrickColor.new("Institutional white")
6121TextLabel97.TextColor3 = Color3.new(1, 1, 1)
6122TextLabel97.TextScaled = true
6123TextLabel97.TextSize = 36
6124TextLabel97.TextStrokeColor3 = Color3.new(0.745098, 0.745098, 0.745098)
6125TextLabel97.TextWrap = true
6126TextLabel97.TextWrapped = true
6127TextLabel98.Name = "Version"
6128TextLabel98.Parent = Frame46
6129TextLabel98.Position = UDim2.new(1, 10, 1, 0)
6130TextLabel98.Size = UDim2.new(1, 0, 0, 15)
6131TextLabel98.BackgroundColor = BrickColor.new("Institutional white")
6132TextLabel98.BackgroundColor3 = Color3.new(1, 1, 1)
6133TextLabel98.BackgroundTransparency = 1
6134TextLabel98.ZIndex = 10
6135TextLabel98.Font = Enum.Font.ArialBold
6136TextLabel98.FontSize = Enum.FontSize.Size14
6137TextLabel98.Text = "V0.4 - REMAKE"
6138TextLabel98.TextColor = BrickColor.new("Institutional white")
6139TextLabel98.TextColor3 = Color3.new(1, 1, 1)
6140TextLabel98.TextSize = 14
6141TextLabel98.TextStrokeColor3 = Color3.new(0.745098, 0.745098, 0.745098)
6142TextLabel98.TextStrokeTransparency = 0.60000002384186
6143TextLabel98.TextTransparency = 0.60000002384186
6144TextLabel98.TextWrap = true
6145TextLabel98.TextWrapped = true
6146TextLabel98.TextXAlignment = Enum.TextXAlignment.Right
6147ImageLabel99.Name = "hitMarker"
6148ImageLabel99.Parent = ScreenGui43
6149ImageLabel99.Position = UDim2.new(0.5, -13, 0.5, -31)
6150ImageLabel99.Visible = false
6151ImageLabel99.Size = UDim2.new(0, 26, 0, 26)
6152ImageLabel99.BackgroundTransparency = 1
6153ImageLabel99.ZIndex = 10
6154ImageLabel99.Image = "http://www.roblox.com/asset/?id=121173757"
6155NumberValue100.Name = "lastMark"
6156NumberValue100.Parent = ImageLabel99
6157Frame101.Name = "crossHair"
6158Frame101.Parent = ScreenGui43
6159Frame101.Position = UDim2.new(0.5, 0, 0.5, -18)
6160Frame101.Visible = false
6161Frame101.BackgroundColor = BrickColor.new("Institutional white")
6162Frame101.BackgroundColor3 = Color3.new(1, 1, 1)
6163Frame101.BorderColor = BrickColor.new("Really black")
6164Frame101.BorderColor3 = Color3.new(0, 0, 0)
6165Frame101.BorderSizePixel = 0
6166ImageLabel102.Parent = Frame101
6167ImageLabel102.Position = UDim2.new(0, -150, 0, -150)
6168ImageLabel102.Visible = false
6169ImageLabel102.Size = UDim2.new(0, 300, 0, 300)
6170ImageLabel102.BackgroundColor = BrickColor.new("Institutional white")
6171ImageLabel102.BackgroundColor3 = Color3.new(1, 1, 1)
6172ImageLabel102.BackgroundTransparency = 1
6173ImageLabel102.ZIndex = 2
6174ImageLabel102.Image = "http://www.roblox.com/asset/?id=68308747"
6175TextLabel103.Name = "Reload"
6176TextLabel103.Parent = Frame101
6177TextLabel103.Position = UDim2.new(0, -50, 0, 70)
6178TextLabel103.Visible = false
6179TextLabel103.Size = UDim2.new(0, 100, 0, 20)
6180TextLabel103.BackgroundColor = BrickColor.new("Institutional white")
6181TextLabel103.BackgroundColor3 = Color3.new(1, 1, 1)
6182TextLabel103.BackgroundTransparency = 1
6183TextLabel103.ZIndex = 2
6184TextLabel103.Font = Enum.Font.SourceSansBold
6185TextLabel103.FontSize = Enum.FontSize.Size18
6186TextLabel103.Text = "RELOADING..."
6187TextLabel103.TextColor = BrickColor.new("Institutional white")
6188TextLabel103.TextColor3 = Color3.new(1, 1, 1)
6189TextLabel103.TextSize = 18
6190TextLabel103.TextStrokeTransparency = 0.5
6191Frame104.Name = "C"
6192Frame104.Parent = Frame101
6193Frame104.Position = UDim2.new(0, -2, 0, 0)
6194Frame104.Size = UDim2.new(0, 4, 0, 500)
6195Frame104.BackgroundColor = BrickColor.new("Institutional white")
6196Frame104.BackgroundColor3 = Color3.new(1, 1, 1)
6197Frame104.BackgroundTransparency = 1
6198Frame104.ClipsDescendants = true
6199TextLabel105.Name = "Line"
6200TextLabel105.Parent = Frame104
6201TextLabel105.Position = UDim2.new(0.5, -1, 0, 10)
6202TextLabel105.Size = UDim2.new(0, 2, 0, 15)
6203TextLabel105.BackgroundColor = BrickColor.new("Institutional white")
6204TextLabel105.BackgroundColor3 = Color3.new(1, 1, 1)
6205TextLabel105.BorderColor = BrickColor.new("Dark stone grey")
6206TextLabel105.BorderColor3 = Color3.new(0.392157, 0.392157, 0.392157)
6207TextLabel105.Font = Enum.Font.SourceSans
6208TextLabel105.FontSize = Enum.FontSize.Size14
6209TextLabel105.Text = ""
6210TextLabel105.TextSize = 14
6211Frame106.Name = "A"
6212Frame106.Parent = Frame101
6213Frame106.Position = UDim2.new(0, -2, 0, -500)
6214Frame106.Size = UDim2.new(0, 4, 0, 500)
6215Frame106.BackgroundColor = BrickColor.new("Institutional white")
6216Frame106.BackgroundColor3 = Color3.new(1, 1, 1)
6217Frame106.BackgroundTransparency = 1
6218Frame106.ClipsDescendants = true
6219TextLabel107.Name = "Line"
6220TextLabel107.Parent = Frame106
6221TextLabel107.Position = UDim2.new(0.5, -1, 1, -25)
6222TextLabel107.Size = UDim2.new(0, 2, 0, 15)
6223TextLabel107.BackgroundColor = BrickColor.new("Institutional white")
6224TextLabel107.BackgroundColor3 = Color3.new(1, 1, 1)
6225TextLabel107.BorderColor = BrickColor.new("Dark stone grey")
6226TextLabel107.BorderColor3 = Color3.new(0.392157, 0.392157, 0.392157)
6227TextLabel107.Font = Enum.Font.SourceSans
6228TextLabel107.FontSize = Enum.FontSize.Size14
6229TextLabel107.Text = ""
6230TextLabel107.TextSize = 14
6231Frame108.Name = "B"
6232Frame108.Parent = Frame101
6233Frame108.Position = UDim2.new(0, 0, 0, -2)
6234Frame108.Size = UDim2.new(0, 500, 0, 4)
6235Frame108.BackgroundColor = BrickColor.new("Institutional white")
6236Frame108.BackgroundColor3 = Color3.new(1, 1, 1)
6237Frame108.BackgroundTransparency = 1
6238Frame108.ClipsDescendants = true
6239TextLabel109.Name = "Line"
6240TextLabel109.Parent = Frame108
6241TextLabel109.Position = UDim2.new(0, 10, 0.5, -1)
6242TextLabel109.Size = UDim2.new(0, 15, 0, 2)
6243TextLabel109.BackgroundColor = BrickColor.new("Institutional white")
6244TextLabel109.BackgroundColor3 = Color3.new(1, 1, 1)
6245TextLabel109.BorderColor = BrickColor.new("Dark stone grey")
6246TextLabel109.BorderColor3 = Color3.new(0.392157, 0.392157, 0.392157)
6247TextLabel109.Font = Enum.Font.SourceSans
6248TextLabel109.FontSize = Enum.FontSize.Size14
6249TextLabel109.Text = ""
6250TextLabel109.TextSize = 14
6251Frame110.Name = "D"
6252Frame110.Parent = Frame101
6253Frame110.Position = UDim2.new(0, -500, 0, -2)
6254Frame110.Size = UDim2.new(0, 500, 0, 4)
6255Frame110.BackgroundColor = BrickColor.new("Institutional white")
6256Frame110.BackgroundColor3 = Color3.new(1, 1, 1)
6257Frame110.BackgroundTransparency = 1
6258Frame110.ClipsDescendants = true
6259TextLabel111.Name = "Line"
6260TextLabel111.Parent = Frame110
6261TextLabel111.Position = UDim2.new(1, -25, 0.5, -1)
6262TextLabel111.Size = UDim2.new(0, 15, 0, 2)
6263TextLabel111.BackgroundColor = BrickColor.new("Institutional white")
6264TextLabel111.BackgroundColor3 = Color3.new(1, 1, 1)
6265TextLabel111.BorderColor = BrickColor.new("Dark stone grey")
6266TextLabel111.BorderColor3 = Color3.new(0.392157, 0.392157, 0.392157)
6267TextLabel111.Font = Enum.Font.SourceSans
6268TextLabel111.FontSize = Enum.FontSize.Size14
6269TextLabel111.Text = ""
6270TextLabel111.TextSize = 14
6271TextLabel112.Name = "Sens"
6272TextLabel112.Parent = ScreenGui43
6273TextLabel112.Position = UDim2.new(1, -136, 1, -58)
6274TextLabel112.Size = UDim2.new(0, 100, 0, 20)
6275TextLabel112.BackgroundColor = BrickColor.new("Institutional white")
6276TextLabel112.BackgroundColor3 = Color3.new(1, 1, 1)
6277TextLabel112.BackgroundTransparency = 1
6278TextLabel112.ZIndex = 10
6279TextLabel112.Font = Enum.Font.SciFi
6280TextLabel112.FontSize = Enum.FontSize.Size28
6281TextLabel112.Text = "S: 0.3"
6282TextLabel112.TextColor = BrickColor.new("Institutional white")
6283TextLabel112.TextColor3 = Color3.new(1, 1, 1)
6284TextLabel112.TextSize = 28
6285ImageLabel113.Name = "Hex"
6286ImageLabel113.Parent = ScreenGui43
6287ImageLabel113.Position = UDim2.new(1, -166, 1, -166)
6288ImageLabel113.Size = UDim2.new(0, 160, 0, 160)
6289ImageLabel113.BackgroundColor = BrickColor.new("Institutional white")
6290ImageLabel113.BackgroundColor3 = Color3.new(1, 1, 1)
6291ImageLabel113.BackgroundTransparency = 1
6292ImageLabel113.BorderSizePixel = 0
6293ImageLabel113.SizeConstraint = Enum.SizeConstraint.RelativeXX
6294ImageLabel113.Image = "rbxassetid://562251151"
6295ImageLabel113.ImageColor3 = Color3.new(0.333333, 0.666667, 1)
6296ImageLabel113.ImageTransparency = 0.20000000298023
6297Script114.Parent = ImageLabel113
6298table.insert(cors,sandbox(Script114,function()
6299while wait(.01) do
6300script.Parent.Rotation = script.Parent.Rotation - 1
6301end
6302end))
6303Frame115.Name = "Scope"
6304Frame115.Parent = ScreenGui43
6305Frame115.Position = UDim2.new(0, 0, 0, -36)
6306Frame115.Visible = false
6307Frame115.Size = UDim2.new(1, 0, 1, 36)
6308Frame115.BackgroundColor = BrickColor.new("Really black")
6309Frame115.BackgroundColor3 = Color3.new(0, 0, 0)
6310Frame115.BackgroundTransparency = 1
6311TextLabel116.Name = "Steady"
6312TextLabel116.Parent = Frame115
6313TextLabel116.Position = UDim2.new(0.5, -60, 0.5, 50)
6314TextLabel116.Visible = false
6315TextLabel116.Size = UDim2.new(0, 120, 0, 20)
6316TextLabel116.BackgroundColor = BrickColor.new("Institutional white")
6317TextLabel116.BackgroundColor3 = Color3.new(1, 1, 1)
6318TextLabel116.BackgroundTransparency = 1
6319TextLabel116.ZIndex = 9
6320TextLabel116.Font = Enum.Font.ArialBold
6321TextLabel116.FontSize = Enum.FontSize.Size14
6322TextLabel116.Text = ""
6323TextLabel116.TextColor = BrickColor.new("New Yeller")
6324TextLabel116.TextColor3 = Color3.new(1, 1, 0)
6325TextLabel116.TextSize = 14
6326TextLabel116.TextStrokeTransparency = 0
6327Frame117.Name = "Main"
6328Frame117.Parent = Frame115
6329Frame117.Size = UDim2.new(1, 0, 1, 0)
6330Frame117.BackgroundColor = BrickColor.new("Institutional white")
6331Frame117.BackgroundColor3 = Color3.new(1, 1, 1)
6332Frame117.BackgroundTransparency = 1
6333ImageLabel118.Name = "ScopeImg2"
6334ImageLabel118.Parent = Frame117
6335ImageLabel118.Position = UDim2.new(0.5, -10, 0, -10)
6336ImageLabel118.Size = UDim2.new(0, 20, 0, 20)
6337ImageLabel118.BackgroundColor = BrickColor.new("Really black")
6338ImageLabel118.BackgroundColor3 = Color3.new(0, 0, 0)
6339ImageLabel118.BackgroundTransparency = 1
6340ImageLabel118.Image = "http://www.roblox.com/asset/?id=184922644"
6341ImageLabel119.Name = "ScopeImg1"
6342ImageLabel119.Parent = Frame117
6343ImageLabel119.Position = UDim2.new(0.5, -10, 0, -10)
6344ImageLabel119.Size = UDim2.new(0, 20, 0, 20)
6345ImageLabel119.BackgroundColor = BrickColor.new("Really black")
6346ImageLabel119.BackgroundColor3 = Color3.new(0, 0, 0)
6347ImageLabel119.BackgroundTransparency = 1
6348ImageLabel119.Image = "http://www.roblox.com/asset/?id=72002022"
6349Frame120.Name = "F2"
6350Frame120.Parent = Frame117
6351Frame120.Position = UDim2.new(0, -10, 0, -10)
6352Frame120.Size = UDim2.new(0, 0, 1, 20)
6353Frame120.BackgroundColor = BrickColor.new("Really black")
6354Frame120.BackgroundColor3 = Color3.new(0, 0, 0)
6355Frame120.BorderColor = BrickColor.new("Really black")
6356Frame120.BorderColor3 = Color3.new(0, 0, 0)
6357Frame120.BorderSizePixel = 0
6358Frame121.Name = "F1"
6359Frame121.Parent = Frame117
6360Frame121.Position = UDim2.new(0, -10, 0, -10)
6361Frame121.Size = UDim2.new(0, 0, 1, 20)
6362Frame121.BackgroundColor = BrickColor.new("Really black")
6363Frame121.BackgroundColor3 = Color3.new(0, 0, 0)
6364Frame121.BorderColor = BrickColor.new("Really black")
6365Frame121.BorderColor3 = Color3.new(0, 0, 0)
6366Frame121.BorderSizePixel = 0
6367LocalScript122.Name = "Update"
6368LocalScript122.Parent = Frame117
6369table.insert(cors,sandbox(LocalScript122,function()
6370local GUI = script.Parent
6371
6372function updateScopeDimension()
6373 GUI.ScopeImg1.Position = UDim2.new(0.5, -10 - (GUI.AbsoluteSize.y / 2), 0, -10)
6374 GUI.ScopeImg1.Size = UDim2.new(0, 20 + GUI.AbsoluteSize.y, 0, 20 + GUI.AbsoluteSize.y)
6375 GUI.ScopeImg2.Position = UDim2.new(0.5, -10 - (GUI.AbsoluteSize.y / 2), 0, -10)
6376 GUI.ScopeImg2.Size = UDim2.new(0, 20 + GUI.AbsoluteSize.y, 0, 20 + GUI.AbsoluteSize.y)
6377 GUI.F1.Size = UDim2.new(0, 20 + ((GUI.AbsoluteSize.x - GUI.AbsoluteSize.y) / 2), 1, 20)
6378 GUI.F2.Size = UDim2.new(0, 20 + ((GUI.AbsoluteSize.x - GUI.AbsoluteSize.y) / 2), 1, 20)
6379 GUI.F2.Position = UDim2.new(1, -10 - ((GUI.AbsoluteSize.x - GUI.AbsoluteSize.y) / 2), 0, -10)
6380end
6381
6382wait()
6383
6384GUI.Changed:connect(updateScopeDimension)
6385
6386updateScopeDimension()
6387end))
6388Frame123.Name = "fireSelect"
6389Frame123.Parent = ScreenGui43
6390Frame123.Position = UDim2.new(0.5, 0, 0.5, -18)
6391Frame123.Visible = false
6392Frame123.BackgroundColor = BrickColor.new("Institutional white")
6393Frame123.BackgroundColor3 = Color3.new(1, 1, 1)
6394Frame123.BackgroundTransparency = 1
6395Frame124.Name = "Modes"
6396Frame124.Parent = Frame123
6397Frame124.BackgroundColor = BrickColor.new("Institutional white")
6398Frame124.BackgroundColor3 = Color3.new(1, 1, 1)
6399Frame124.BackgroundTransparency = 1
6400ImageLabel125.Name = "Circle"
6401ImageLabel125.Parent = Frame123
6402ImageLabel125.Position = UDim2.new(0, -60, 0, -60)
6403ImageLabel125.Size = UDim2.new(0, 120, 0, 120)
6404ImageLabel125.BackgroundColor = BrickColor.new("Institutional white")
6405ImageLabel125.BackgroundColor3 = Color3.new(1, 1, 1)
6406ImageLabel125.BackgroundTransparency = 1
6407ImageLabel125.Image = "http://www.roblox.com/asset/?id=55754953"
6408ImageLabel125.ImageTransparency = 0.5
6409ImageLabel126.Name = "Arrow"
6410ImageLabel126.Parent = Frame123
6411ImageLabel126.Position = UDim2.new(0, -20, 0, -140)
6412ImageLabel126.Size = UDim2.new(0, 40, 0, 20)
6413ImageLabel126.BackgroundColor = BrickColor.new("Institutional white")
6414ImageLabel126.BackgroundColor3 = Color3.new(1, 1, 1)
6415ImageLabel126.BackgroundTransparency = 1
6416ImageLabel126.Image = "http://www.roblox.com/asset/?id=126877530"
6417TextLabel127.Name = "Co"
6418TextLabel127.Parent = ScreenGui43
6419TextLabel127.Size = UDim2.new(1, 0, 0, 20)
6420TextLabel127.BackgroundColor = BrickColor.new("Institutional white")
6421TextLabel127.BackgroundColor3 = Color3.new(1, 1, 1)
6422TextLabel127.BackgroundTransparency = 1
6423TextLabel127.ZIndex = 10
6424TextLabel127.Font = Enum.Font.SourceSansItalic
6425TextLabel127.FontSize = Enum.FontSize.Size18
6426TextLabel127.Text = "tEhYuM yB ekameR & noisuFobruT yB tiK"
6427TextLabel127.TextColor = BrickColor.new("Institutional white")
6428TextLabel127.TextColor3 = Color3.new(1, 1, 1)
6429TextLabel127.TextSize = 18
6430TextLabel127.TextStrokeColor3 = Color3.new(1, 1, 1)
6431TextLabel127.TextStrokeTransparency = 0.89999997615814
6432TextLabel127.TextTransparency = 0.89999997615814
6433ModuleScript128.Name = "ANIMATIONS"
6434ModuleScript128.Parent = Tool0
6435table.insert(cors,sandbox(ModuleScript128,function()
6436local Animations = {
6437
6438 Reload = function(S)
6439 local W1 = nil
6440 local W2 = nil
6441 local animSpeed = S.isMagEmpty() and S.reloadTimeEmpty / 1.3 or S.reloadTimeLoaded / 0.9
6442 return {
6443 function()
6444 if (not S.isNewMag()) then
6445 if S.isMagVisible() then
6446 local Mag1, magTable1 = S.createMag("Mag1")
6447
6448 Mag1.Parent = S.gunIgnore
6449
6450 W1 = Instance.new("Weld")
6451 W1.Part0 = magTable1[1].magClone
6452 W1.Part1 = S.Handle
6453 W1.C0 = magTable1[1].Original.CFrame:toObjectSpace(S.Handle.CFrame)
6454 W1.Parent = magTable1[1].magClone
6455
6456 S.tweenJoint(S.LWeld, nil, S.CF(-1, 1.2, -.8) * S.CFANG(S.RAD(-15), 0, S.RAD(-25)), S.Sine, 0.2 * animSpeed)
6457 S.tweenJoint(S.RWeld, nil, S.CF(0.3, 0.2, -0.31) * S.CFANG(S.RAD(-12), 0, S.RAD(25)), S.Sine, 0.2 * animSpeed)
6458 S.tweenJoint(S.Grip, nil, S.CFANG(0, S.RAD(20), S.RAD(10)), S.Sine, 0.1 * animSpeed)
6459 wait(0.2 * animSpeed)
6460 end
6461 end
6462 end;
6463
6464 function()
6465 if (not S.isNewMag()) then
6466 if S.isMagVisible() then
6467 S.makeMagInvisible()
6468 W1:Destroy()
6469 local Mag1, magTable1 = S.getMag("Mag1")
6470 magTable1[1].magClone.Velocity = S.Handle.Velocity + S.Handle.CFrame:vectorToWorldSpace(S.V3(0, -1, 0)) * 20
6471
6472 S.tweenJoint(S.RWeld, nil, S.CF(0.3, 0.2, -0.5) * S.CFANG(S.RAD(-20), S.RAD(10), S.RAD(25)), S.Sine, 0.25 * animSpeed)
6473 S.tweenJoint(S.Grip, nil, S.CFANG(0, S.RAD(20), S.RAD(10)), S.Sine, 0.2 * animSpeed)
6474 else
6475 S.tweenJoint(S.RWeld, nil, S.CF(0.6, 0.2, -0.61) * S.CFANG(S.RAD(-12), S.RAD(20), S.RAD(25)), S.Sine, 0.2 * animSpeed)
6476 S.tweenJoint(S.Grip, nil, S.CFANG(S.RAD(-10), S.RAD(20), S.RAD(10)), S.Sine, 0.2 * animSpeed)
6477 end
6478
6479 S.tweenJoint(S.LWeld, nil, S.CF(0, 0.5, 0) * S.CFANG(S.RAD(95), 0, S.RAD(-25)), S.Sine, 0.2 * animSpeed)
6480
6481 wait(0.25 * animSpeed)
6482 end
6483 end;
6484
6485 function()
6486 if (not S.isNewMag()) then
6487 local Mag1, magTable1 = S.getMag("Mag1")
6488 if Mag1 then Mag1:Destroy() end
6489
6490 local Mag2, magTable2 = S.createMag("Mag2")
6491
6492 Mag2.Parent = S.gunIgnore
6493
6494 local LArmCF = S.LWeld.Part0.CFrame * S.LWeld.C0 * (S.CF(0.58, 1.63, -1.4) * S.CFANG(S.RAD(-22), S.RAD(20), S.RAD(-60))):inverse()
6495 local RArmCF = S.RWeld.Part0.CFrame * S.RWeld.C0 * (S.CF(0.6, 0.2, -0.61) * S.CFANG(S.RAD(-15), S.RAD(20), S.RAD(25))):inverse()
6496 local handleOffsetCF = S.RArm.CFrame:toObjectSpace(S.RArm.CFrame * S.Grip.C0 * (S.CFANG(S.RAD(-10), S.RAD(20), S.RAD(10))):inverse())
6497 local originalMagOffsetCF = S.Handle.CFrame:toObjectSpace(magTable2[1].Original.CFrame)
6498 local newMagC0 = LArmCF:toObjectSpace(RArmCF * handleOffsetCF * originalMagOffsetCF)
6499
6500 W2 = Instance.new("Weld")
6501 W2.Part0 = S.LArm
6502 W2.Part1 = magTable2[1].magClone
6503 W2.C0 = newMagC0
6504 W2.Parent = magTable2[1].magClone
6505
6506 S.tweenJoint(S.LWeld, nil, S.CF(0.55, 1, -2.4) * S.CFANG(S.RAD(-20), S.RAD(20), S.RAD(-60)), S.Sine, 0.2 * animSpeed)--0.25
6507 S.tweenJoint(S.RWeld, nil, S.CF(0.6, 0.2, -0.61) * S.CFANG(S.RAD(-12), S.RAD(20), S.RAD(25)), S.Sine, 0.2 * animSpeed)
6508 S.tweenJoint(S.Grip, nil, S.CFANG(S.RAD(-10), S.RAD(20), S.RAD(10)), S.Sine, 0.2 * animSpeed)
6509 wait(0.2 * animSpeed)
6510 end
6511 end;
6512
6513 function()
6514 if (not S.isNewMag()) then
6515 S.tweenJoint(S.Grip, nil, S.CFANG(S.RAD(-10), S.RAD(20), S.RAD(10)), S.Sine, 0.15 * animSpeed)
6516 S.tweenJoint(S.LWeld, nil, S.CF(0.58, 1.63, -1.4) * S.CFANG(S.RAD(-22), S.RAD(20), S.RAD(-60)), S.Sine, 0.15 * animSpeed)--0.25
6517 S.tweenJoint(S.RWeld, nil, S.CF(0.6, 0.2, -0.61) * S.CFANG(S.RAD(-15), S.RAD(20), S.RAD(25)), S.Sine, 0.2 * animSpeed)
6518
6519 wait(0.2 * animSpeed)
6520 end
6521 end;
6522
6523 function()
6524 if (not S.isNewMag()) then
6525 local Mag1, _ = S.getMag("Mag1")
6526 local Mag2, _ = S.getMag("Mag2")
6527 S.makeMagVisible()
6528 S.setNewMag()
6529 if Mag1 then Mag1:Destroy() end
6530 Mag2:Destroy()
6531 end
6532 end;
6533
6534 function()
6535 if S.isMagEmpty() then
6536 if S.isNewMag() then
6537 S.tweenJoint(S.Grip, nil, S.CFANG(S.RAD(-10), S.RAD(20), S.RAD(10)), S.Sine, 0.15 * animSpeed)
6538 S.tweenJoint(S.LWeld, nil, S.CF(0.58, 1.63, -1.4) * S.CFANG(S.RAD(-22), S.RAD(20), S.RAD(-60)), S.Sine, 0.15 * animSpeed)--0.25
6539 S.tweenJoint(S.RWeld, nil, S.CF(0.6, 0.2, -0.61) * S.CFANG(S.RAD(-15), S.RAD(20), S.RAD(25)), S.Sine, 0.2 * animSpeed)
6540 end
6541 S.tweenJoint(S.LWeld, nil, S.CF(0, 1.3, -0.55) * S.CFANG(S.RAD(-26), 0, 0), S.Sine, 0.2 * animSpeed)
6542
6543 wait(0.2 * animSpeed)
6544 end
6545 end;
6546
6547 function()
6548 if S.isMagEmpty() then
6549 S.tweenJoint(S.LWeld, nil, S.CF(0.4, 1.6, -0.55) * S.CFANG(S.RAD(-23), 0, S.RAD(-60)), S.Sine, 0.1 * animSpeed)
6550
6551 wait(0.05 * animSpeed)
6552 end
6553 end;
6554
6555 function()
6556 if S.isMagEmpty() then
6557 S.tweenJoint(S.RWeld, nil, S.CF(0.6, 0.2, -0.61) * S.CFANG(S.RAD(-15), S.RAD(20), S.RAD(20)), S.Sine, 0.05 * animSpeed)
6558
6559 wait(0.15 * animSpeed)
6560 end
6561 end;
6562 }
6563 end;
6564
6565 Cocking = function(S)
6566
6567 end;
6568
6569 Crawling = function(X, moveDirection, moveSpeed)
6570 return {
6571 leftArm = CFrame.Angles(
6572 0,
6573 math.rad(90),
6574 math.rad(-10)
6575 ) * CFrame.new(
6576 math.sin(moveDirection) * (math.sin(X * 6) / 4) - 0.2,
6577 math.cos(moveDirection) * (math.sin(X * 6) / 2) - 0.1,
6578 math.max(math.cos(X * 6) / 4, 0) - 0.1
6579 ) * CFrame.Angles(
6580 -math.max(math.cos(X * 6) / 4, 0),
6581 0,
6582 0
6583 );
6584 leftLeg = CFrame.new(
6585 math.sin(moveDirection) * (-math.sin(X * 6) / 4) - 0.2,
6586 math.cos(moveDirection) * (math.sin(X * 6) / 2) + 0.3,
6587 math.max(math.cos(X * 6) / 4, 0) - 0.1
6588 ):inverse() * CFrame.Angles(
6589 0,
6590 0,
6591 -math.rad(15) - math.cos(moveDirection) * (math.rad(15) * math.sin(X * 6))
6592 );
6593 rightArm = CFrame.Angles(
6594 0,
6595 math.rad(-5),
6596 math.rad(10)
6597 ) * CFrame.new(
6598 math.sin(moveDirection) * (-math.sin(X * 6) / 4) + 0.2,
6599 math.cos(moveDirection) * (-math.sin(X * 6) / 5) - 0.2,
6600 math.max(math.cos((X + math.rad(30)) * 6) / 10, 0) - 0.1
6601 ) * CFrame.Angles(
6602 -math.max(math.cos((X + math.rad(30)) * 6) / 10, 0),
6603 0,
6604 0
6605 );
6606 rightLeg = CFrame.new(
6607 math.sin(moveDirection) * (math.sin(X * 6) / 4) + 0.2,
6608 math.cos(moveDirection) * (-math.sin(X * 6) / 2) + 0.3,
6609 math.max(math.cos((X + math.rad(30)) * 6) / 4, 0) - 0.1
6610 ):inverse() * CFrame.Angles(
6611 0,
6612 0,
6613 math.rad(15) - math.cos(moveDirection) * (math.rad(15) * math.sin(X * 6))
6614 );
6615 Grip = CFrame.Angles(
6616 math.max(math.cos((X + math.rad(30)) * 6) / 7, 0),
6617 math.rad(5),
6618 0
6619 );
6620 Camera = 1.5 * math.rad(math.cos((X + math.rad(30)) * 6)) + math.rad(0.5); --This is what the roll of the camera will be when you're crawling
6621 }
6622 end;
6623
6624 Idling = {
6625
6626 unAimed = function(X)
6627 return {
6628 Pos = Vector3.new(
6629 math.sin(X / 2) / 70,
6630 math.sin(X * 5 / 4) / 70,
6631 math.sin(X * 3 / 4) / 70
6632 );
6633 Rot = Vector3.new(
6634 0,
6635 0,
6636 0
6637 );
6638 }
6639 end;
6640
6641 Aimed = function(X)
6642 return {
6643 Pos = Vector3.new(
6644 math.sin(X * 3 / 8) / 140,
6645 math.sin(X * 15 / 16) / 140,
6646 0
6647 );
6648 Rot = Vector3.new(
6649 0,
6650 0,
6651 0
6652 );
6653 }
6654 end;
6655
6656 };
6657
6658 Walking = {
6659
6660 unAimed = function(X)
6661 return {
6662 Pos = Vector3.new(
6663 4 * math.sin(X * 4.5) / 50,
6664 1.5 * math.sin(X * 9) / 50,
6665 0
6666 );
6667 Rot = Vector3.new(
6668 0,
6669 0,
6670 math.rad(math.sin(X * 4.5)) * 2
6671 );
6672 }
6673 end;
6674
6675 Aimed = function(X)
6676 return {
6677 Pos = Vector3.new(
6678 2 * math.sin(X * 3) / 150,
6679 0.75 * math.sin(X * 6) / 150,
6680 0
6681 );
6682 Rot = Vector3.new(
6683 0,
6684 0,
6685 math.rad(math.sin(X * 3)) / 3
6686 );
6687 }
6688 end;
6689
6690 };
6691
6692 Running = function(X)
6693 return {
6694 Pos = Vector3.new(
6695 4 * math.sin(X * 4.5 * 1.5) / 30,
6696 1.5 * math.sin(X * 9 * 1.5) / 40 + 0.2,
6697 0
6698 );
6699 Rot = Vector3.new(
6700 0,
6701 -math.rad(math.sin(X * 4.5 * 1.5)) * 5 + math.rad(3),
6702 math.rad(math.sin(X * 4.5 * 1.5)) * 5
6703 );
6704 }
6705 end;
6706
6707}
6708
6709return Animations
6710end))
6711Camera129.Name = "ThumbnailCamera"
6712Camera129.Parent = Tool0
6713Camera129.CFrame = CFrame.new(10.2673683, 0.434827238, -4.0644474, -0.748482466, 0.0398561135, 0.661955833, -0, 0.99819237, -0.0601007789, -0.663154662, -0.0449843779, -0.74712944)
6714Camera129.CoordinateFrame = CFrame.new(10.2673683, 0.434827238, -4.0644474, -0.748482466, 0.0398561135, 0.661955833, -0, 0.99819237, -0.0601007789, -0.663154662, -0.0449843779, -0.74712944)
6715Camera129.FieldOfView = 29.999997769916
6716Camera129.Focus = CFrame.new(8.94345665, 0.555028796, -2.57018852, 1, 0, 0, 0, 1, 0, 0, 0, 1)
6717Camera129.focus = CFrame.new(8.94345665, 0.555028796, -2.57018852, 1, 0, 0, 0, 1, 0, 0, 0, 1)
6718for i,v in pairs(mas:GetChildren()) do
6719 v.Parent = workspace
6720 pcall(function() v:MakeJoints() end)
6721end
6722mas:Destroy()
6723for i,v in pairs(cors) do
6724 spawn(function()
6725 pcall(v)
6726 end)
6727end