· 8 years ago · Jun 12, 2018, 02:00 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")
20IntValue1 = Instance.new("IntValue")
21IntValue2 = Instance.new("IntValue")
22ModuleScript3 = Instance.new("ModuleScript")
23LocalScript4 = Instance.new("LocalScript")
24IntValue5 = Instance.new("IntValue")
25ScreenGui6 = Instance.new("ScreenGui")
26ImageLabel7 = Instance.new("ImageLabel")
27Frame8 = Instance.new("Frame")
28ImageLabel9 = Instance.new("ImageLabel")
29Frame10 = Instance.new("Frame")
30TextLabel11 = Instance.new("TextLabel")
31TextLabel12 = Instance.new("TextLabel")
32TextLabel13 = Instance.new("TextLabel")
33TextLabel14 = Instance.new("TextLabel")
34TextLabel15 = Instance.new("TextLabel")
35Frame16 = Instance.new("Frame")
36Frame17 = Instance.new("Frame")
37TextLabel18 = Instance.new("TextLabel")
38TextLabel19 = Instance.new("TextLabel")
39TextLabel20 = Instance.new("TextLabel")
40TextLabel21 = Instance.new("TextLabel")
41TextLabel22 = Instance.new("TextLabel")
42Frame23 = Instance.new("Frame")
43TextLabel24 = Instance.new("TextLabel")
44TextLabel25 = Instance.new("TextLabel")
45TextLabel26 = Instance.new("TextLabel")
46Frame27 = Instance.new("Frame")
47TextLabel28 = Instance.new("TextLabel")
48Frame29 = Instance.new("Frame")
49Frame30 = Instance.new("Frame")
50Frame31 = Instance.new("Frame")
51Frame32 = Instance.new("Frame")
52Frame33 = Instance.new("Frame")
53Frame34 = Instance.new("Frame")
54Frame35 = Instance.new("Frame")
55Frame36 = Instance.new("Frame")
56Frame37 = Instance.new("Frame")
57Frame38 = Instance.new("Frame")
58Frame39 = Instance.new("Frame")
59Frame40 = Instance.new("Frame")
60Frame41 = Instance.new("Frame")
61Frame42 = Instance.new("Frame")
62Frame43 = Instance.new("Frame")
63Frame44 = Instance.new("Frame")
64Frame45 = Instance.new("Frame")
65Frame46 = Instance.new("Frame")
66Frame47 = Instance.new("Frame")
67Frame48 = Instance.new("Frame")
68Frame49 = Instance.new("Frame")
69Frame50 = Instance.new("Frame")
70Frame51 = Instance.new("Frame")
71Frame52 = Instance.new("Frame")
72Frame53 = Instance.new("Frame")
73Frame54 = Instance.new("Frame")
74TextLabel55 = Instance.new("TextLabel")
75TextLabel56 = Instance.new("TextLabel")
76TextLabel57 = Instance.new("TextLabel")
77TextLabel58 = Instance.new("TextLabel")
78Frame59 = Instance.new("Frame")
79Frame60 = Instance.new("Frame")
80Frame61 = Instance.new("Frame")
81TextLabel62 = Instance.new("TextLabel")
82TextLabel63 = Instance.new("TextLabel")
83TextLabel64 = Instance.new("TextLabel")
84TextLabel65 = Instance.new("TextLabel")
85ImageLabel66 = Instance.new("ImageLabel")
86TextLabel67 = Instance.new("TextLabel")
87TextLabel68 = Instance.new("TextLabel")
88Frame69 = Instance.new("Frame")
89Frame70 = Instance.new("Frame")
90TextLabel71 = Instance.new("TextLabel")
91TextLabel72 = Instance.new("TextLabel")
92TextLabel73 = Instance.new("TextLabel")
93TextLabel74 = Instance.new("TextLabel")
94ImageLabel75 = Instance.new("ImageLabel")
95TextLabel76 = Instance.new("TextLabel")
96TextLabel77 = Instance.new("TextLabel")
97Frame78 = Instance.new("Frame")
98ImageLabel79 = Instance.new("ImageLabel")
99TextLabel80 = Instance.new("TextLabel")
100Script81 = Instance.new("Script")
101IntValue82 = Instance.new("IntValue")
102IntValue83 = Instance.new("IntValue")
103IntValue84 = Instance.new("IntValue")
104Part85 = Instance.new("Part")
105BlockMesh86 = Instance.new("BlockMesh")
106Part87 = Instance.new("Part")
107BlockMesh88 = Instance.new("BlockMesh")
108Part89 = Instance.new("Part")
109BlockMesh90 = Instance.new("BlockMesh")
110Part91 = Instance.new("Part")
111BlockMesh92 = Instance.new("BlockMesh")
112Part93 = Instance.new("Part")
113BlockMesh94 = Instance.new("BlockMesh")
114Part95 = Instance.new("Part")
115SpecialMesh96 = Instance.new("SpecialMesh")
116Part97 = Instance.new("Part")
117Part98 = Instance.new("Part")
118CylinderMesh99 = Instance.new("CylinderMesh")
119Part100 = Instance.new("Part")
120SpecialMesh101 = Instance.new("SpecialMesh")
121Part102 = Instance.new("Part")
122Part103 = Instance.new("Part")
123CylinderMesh104 = Instance.new("CylinderMesh")
124Part105 = Instance.new("Part")
125CylinderMesh106 = Instance.new("CylinderMesh")
126Part107 = Instance.new("Part")
127Part108 = Instance.new("Part")
128PointLight109 = Instance.new("PointLight")
129BillboardGui110 = Instance.new("BillboardGui")
130ImageLabel111 = Instance.new("ImageLabel")
131CylinderMesh112 = Instance.new("CylinderMesh")
132Part113 = Instance.new("Part")
133Part114 = Instance.new("Part")
134Part115 = Instance.new("Part")
135Part116 = Instance.new("Part")
136Sound117 = Instance.new("Sound")
137Part118 = Instance.new("Part")
138Tool0.Name = "Gun"
139Tool0.Parent = mas
140IntValue1.Name = "LethalGrenades"
141IntValue1.Parent = Tool0
142IntValue1.Value = 1000000000
143IntValue2.Name = "Ammo"
144IntValue2.Parent = Tool0
145IntValue2.Value = 1000000000
146ModuleScript3.Name = "SETTINGS"
147ModuleScript3.Parent = Tool0
148table.insert(cors,sandbox(ModuleScript3,function()
149local Settings = { --These are the settings, change them however you like
150
151
152 GunName = "Mad guners God Gun"; --This is the name that will be displayed on the Tool
153 Description = "F___ Your enemy,s up!"; --This will be the text that is displayed above the tool when the mouse is hovering over it
154
155
156 GunType = { --[[These are the 5 gun types you can have. Set whichever ones you want to true. (NOTE: Semi and Auto can't both be
157 true, and Burst and Auto can't both be true)]]
158 Semi = false; --Set this true if you want the gun to be semi-automatic. (Pistols, Snipers, etc)
159 Auto = true; --Set this true if you want the gun to be fully automatic. (Assault Rifles, Submachine guns, machine guns, etc)
160 Burst = false; --Set this true if you want the gun to be burst fire. (Battle rifles, assault rifles, etc)
161 Shot = false; --Set this true if you want the gun to be a shotgun. (NOTE: Shot and auto can both be true)
162 Explosive = false; --Set this true if you want the projectiles to be explosive. (Rocket launchers, grenade launchers, etc)
163 };
164
165
166 BurstAmount = 3; --This is how many bullets will be fired in one burst (if Burst is true)
167 BurstTime = 0.2; --This is how long it takes for a burst to complete
168 BurstWait = 0.1; --This is how much time you have to wait before you can fire another burst
169
170
171 ShotAmount = 5; --This is how many bullets will be fired in one shot (if Shot is true)
172
173
174 ExplosionRadius = 20; --This is the radius of the explosion when the bullet hits a target. (If Explosive is true)
175 ExplosionPressure = 5e5; --This is the pressure of the explosion when the bullet hits the target
176 ExplosionType = Enum.ExplosionType.NoCraters; --This is the type of explosion
177 --[[
178 (0 or "NoCraters" or Enum.ExplosionType.NoCraters) means that the explosion will not damage terrain
179 (1 or "Craters" or Enum.ExplosionType.Craters) means that the explosion will leave craters in terrain
180 (2 or "CratersAndDebris" or Enum.ExplosionType.CratersAndDebris) means that the explosion will leave craters and debris in terrain
181 --]]
182 ExplosionSound = "rbxassetid://138499093"; --This is what the sound of the explosion will be
183 ExplosionSoundPitch = 1; --This is what the pitch of the explosion sound will be
184 ExplosionSoundVolume = 1; --This is what the volume of the explosion sound will be
185 RayCastExplosions = false; --[[This is whether or not explosions will have raycasting. If this is true, humanoids behind walls
186 won't be damaged. If this is false, any humanoid within the radius will be damaged. (NOTE: RangeBasedDamage has to be true in
187 order for explosions to have raycasting)]]
188 RangeBasedDamage = true; --[[This is whether or not will depend on how far the object is from the center of the explosion. If this
189 is true, the farther a humanoid is from the blast center, the less damage it'll take. If this is false, any object within
190 the explosion's radius will have its joints broken]]
191
192
193 PlayerArms = true; --This is whether or not the fake arms will look like the Player's arms
194 FakeArmTransparency = 0; --This is the transparency of the fake arms
195 FakeArmRealBodyColor = true; --This is whether or not the color of the fake arm will be the color of the player's real arms
196 FakeArmColor = BrickColor.new("Pastel brown"); --This is what the color of the fake arms will be if FakeArmRealBodyColor is false
197
198
199 ArmC1_UnAimed = { --This table contains the CFrames of the arms when the gun is not aimed
200 Left = CFrame.new(0.1, 1.5, -0.3) * CFrame.Angles(0, 0, math.rad(-50)); --This is the cframe of the left arm
201 Right = CFrame.new(0.4, 0.25, -0.3) * CFrame.Angles(0, 0, math.rad(25)); --This is the cframe of the right arm
202 };
203 ArmC1_Aimed = { --This table contains the CFrames of the arms when the gun is aimed
204 Left = CFrame.new(-0.1, 1.2, 0.1) * CFrame.Angles(0, 0, math.rad(-35)); --This is the cframe of the left arm
205 Right = CFrame.new(0.3, 0.707, -0.01) * CFrame.Angles(0, 0, math.rad(50)); --This is the cframe of the right arm
206 };
207
208
209 PlayerAnimations = true; --This is whether or not the player will have custom animations
210 AimAnimation = true; --This is whether or not there is an animation for aiming down the sights
211 ReloadAnimation = true; --This is whether or not there is an animation for reloading
212 StanceAnimation = true; --This is whether or not there is an animation for changing stance
213
214
215 AimSpeed = 0.15; --This is how long the gun will take to fully aim down the sights
216 MaxZoom = 40; --This is the FOV that the Camera will have when the gun is fully aimed down
217 HoldMouseOrKeyToADS = true; --This is whether or not you have to hold the right mouse or the ADS key to ADS
218
219
220 GuiScope = false; --This is whether or not your Scope will be a gui instead of a normal sight
221 GuiId = "http://www.roblox.com/asset/?id=160682367"; --This is the ImageId of the GuiScope
222 ScopeSway = 2; --This is the sway, in radians, of the camera
223
224
225 ScopeSteadyTime = 8; --This is how long you can hold your breath to steady the scope
226 SteadyCooldownTime = 4; --This is how long it takes to fully retake your breath
227 UnSteadyOnFire = true; --This is whether or not the camera will become unsteady when you fire the gun
228
229
230 FireRate = 10000000; --This is how many bullets per minute the gun will fire
231 BulletRange = 1000; --This is how far the bullet will travel before it is no longer effective
232
233
234 InstantHit = false; --[[This is whether or not the bullet will hit a target instantly. If it is false, the bullet will travel at a
235 specific speed till it hits a target]]
236 BulletVelocity = 2400; --This is how fast the bullet will travel in studs per second
237
238
239 Damage = 25; --This is the base damage. That means that this is the least amount of damage that will be inflicted
240 Multipliers = { --[[These are the damage multipliers. There's a spread of +0.1. That means that if the multiplier is 1, the actual
241 multiplier will range from 1 - 1.1]]
242 Chest = 1; --This is what the damage will be multiplied by if the bullet hits the chest
243 Head = 1.5; --This is what the damage will be multiplied by if the bullet hits the head or a hat
244 Limbs = 1; --This is what the damage will be multiplied by if the bullet hits a limb (Arms or legs)
245 };
246
247
248 AllowFriendlyFire = false; --This is whether or not you can damage teammates
249 CanDamageNPCs = true; --This is whether or not you can damage NPC's (Zombies, fake players, anything with a humanoid)
250
251
252 RotateWhileSitting = false; --This is whether or not your player will rotate when you are sitting down
253
254
255 CanKnife = true; --This is whether or not you can knife
256 KnifeMeshId = "http://www.roblox.com/asset/?id=121944778"; --This is the Mesh of the knife
257 KnifeTextureId = "http://www.roblox.com/asset/?id=121944805"; --This is the Texture of the knife
258 KnifeCooldown = 0.5; --This is how long you have to wait before you can knife again
259
260
261 Throwables = true; --This is whether or not you have grenades
262 TrajectoryAssist = true; --This is whether or not the script will show you the flight path of the grenade before you throw it
263 DetonationTime = 10; --[[This is how long the grenade will wait to detonate (If DetonateOnHit is false, this is how long the
264 grenade will wait after it's thrown. If DetonateOnHit is true, this is how long the grenade will wait after it hits something]]
265 TimerStartOnHit = true; --This is whether or not the timer will start when the grenade hits something
266 GrenadeColor = BrickColor.new("Crimson)"); --This is the color of the grenade
267 GrenadeSize = Vector3.new(0.8, 0.8, 0.8); --This is the size of the grenade (Doesn't apply to throwing knives)
268
269
270 GrenadeBlastRadius = 1000; --This is the blast radius of the explosion (Doesn't apply to non-explosive grenades)
271 GrenadeBlastPressure = 5e5; --This is what the blast pressure of the explosion (Doesn't apply to non-explosive grenades)
272 GrenadeExplosionType = Enum.ExplosionType.CratersAndDebris; --This is the type of explosion (Doesn't apply to non-explosive grenades)
273 --[[
274 (0 or "NoCraters" or Enum.ExplosionType.NoCraters) means that the explosion will not damage terrain
275 (1 or "Craters" or Enum.ExplosionType.Craters) means that the explosion will leave craters in terrain
276 (2 or "CratersAndDebris" or Enum.ExplosionType.CratersAndDebris) means that the explosion will leave craters and debris in terrain
277 --]]
278 LethalGrenadeDamage = 150; --This is max damage that the grenade will do
279 LethalGrenadeThrowVelocity = 170; --This is the speed at which the lethal grenade is thrown
280 GrenadeRayCastExplosions = true; --[[This is whether or not grenade explosions will have raycasting. If this is true, humanoids
281 behind walls won't be damaged. If this is false, any humanoid within the radius will be damaged. (NOTE: GrenadeRangeBasedDamage
282 has to be true in order for explosions to have raycasting)]]
283 GrenadeRangeBasedDamage = true; --[[This is whether or not will depend on how far the object is from the center of the explosion.
284 If this is true, the farther a humanoid is from the blast center, the less damage it'll take. If this is false, any object
285 within the explosion's radius will have its joints broken]]
286 LethalGrenadeType = 1; --This is the lethal grenade type
287 --[[
288 Type 1: Frag grenade [An explosive grenade]
289 Type 2: Sticky [An explosive grenade that sticks to a surface]
290 Type 3: Throwing Knife [A throwable knife]
291 --]]
292
293 TacticalGrenadeThrowVelocity = 200; --This is the speed at which the tactical grenade is thrown
294 GrenadeEffectRadius = 70; --[[This is the radius of the effect of the grenade. If the Grenade is a smoke, this is the radius of
295 the smoke]]
296 GrenadeEffectTime = 10; --[[This is the how long the grenade effect will last. If the grenade is a smoke, this is how long the
297 smoke will linger]]
298 TacticalGrenadeType = 1; --This is the tactical grenade type
299 --[[
300 Type 1: Smoke grenade [A grenade that creates a cloud of smoke]
301 --]]
302
303
304 GrenadeTrail = true; --This is whether or not the grenade will have a trail
305 GrenadeTrailColor = BrickColor.new("Toothpaste"); --This is the color of the grenade trail
306 GrenadeTrailTransparency = 0.6; --This is the transparency of the trail
307 GrenadeTrailThickness = 0.3; --This is the thickness of the trail
308 GrenadeTrailVisibleTime = 0.1; --This is how long the trail will be visible for
309 GrenadeTrailDisappearTime = 0.2; --This is how long it will take for the trail to disappear
310
311
312 BulletColor = BrickColor.new("Bright yellow"); --This is the color of the bullet
313 BulletTransparency = 0; --This is the transparency of the bullet
314 BulletSize = Vector3.new(0.2, 0.2, 4); --This is the actual size of the bullet
315 BulletMeshSize = Vector3.new(0.5, 0.5, 1); --This is the mesh size of the bullet.
316 --BulletSize * BulletMeshSize = How big the bullet looks
317
318
319 BulletTrail = true; --This is whether or not there will be a trail behind the bullet
320 TrailColor = BrickColor.new("Crimson"); --This is the color of the bullet trail
321 TrailTransparency = 0.6; --This is the transparency of the trail
322 TrailThickness = 0.2; --This is the thickness of the trail
323 TrailVisibleTime = 0.5; --This is how long the trail will be visible for
324 TrailDisappearTime = 0.5; --This is how long it will take for the trail to disappear
325
326
327 BulletHoles = true; --This is whether or not bullet holes will appear where you shot
328 BulletHoleTexture = "http://www.roblox.com/asset/?id=64291961"; --This is the texture of the bullet hole
329 BulletHoleSize = 0.5; --This is how big the bullet hole will be in studs
330 BulletHoleVisibleTime = 3; --This is how long the bullet hole will be visible for
331 BulletHoleDisappearTime = 1; --This is how long it will take for the bullet hole to disappear
332
333
334 Shockwaves = true; --This is whether or not a shockwave will appear where you shot. (A sphere that appears when the bullet hits)
335 ShockwaveRadius = 0.3; --This is the radius of the shockwave. (If the gun type is explosion, this radius will be the blast radius)
336 ShockwaveColor = BrickColor.new("Light stone grey"); --This is the color of the shockwave
337 ShockwaveDuration = 0.2; --This is how long the shockwave will take to disappear
338
339
340 Penetration = 2; --[[This is how many studs a bullet can penetrate into a wall. So if penetration is 2 and the wall is 3 studs
341 thick, the bullet won't come out the other side]]
342
343
344 BulletDropPerSecond = 0; --This is the bullet's acceleration downward per second (196.2 is normal roblox gravity)
345
346
347 Recoil = {
348 Aimed = 0.5; --This is the recoil the gun will have when the gun is aimed down
349 Hipfire = 1.5; --This is the recoil the gun will have when the gun is fired from the hip
350 };
351 Spread = { --[[This spread values are how many degrees offset / 20 the bullets from the center the bullets will travel. So a spread
352 of 20 would mean that the bullet's max spread in any direction is 1 degree from the center]]
353 Aimed = 0; --This is the spread when the gun is aimed down. it isn't affected by the multiplier.
354 Hipfire = 20; --This is the base spread when the gun is fired from the hip
355 Max = 40; --This is the highest the spread can be when fired
356 Multiplier = 1.1; --This is how much the spread will be multiplied by when fired. It only affects the Hipfire spread
357 Walking = 30; --This is the spread while walking. It isn't affected by the multiplier
358 };
359
360
361 ReloadTime = 1.2; --This is how long it takes to reload the gun
362 AutoReload = true; --This is whether or not the gun will reload automatically when the ammo reaches 0
363
364
365 SprintTime = 7; --This is the maximum time you can sprint
366 StaminaCoolTime = 4; --This is how long it takes for your stamina to fully recharge
367
368
369 DolphinDive = true; --This is whether or not you can dolphin dive (Run and crouch at the same time to dive)
370 DiveRechargeTime = 1; --This is how long you have to wait till you can dive or run again after you've dived
371
372
373 CanChangeStance = true; --This is whether or not you can change stance. That means whether or not you can crouch or go prone
374 StanceChangeSpeed = 0.25; --This is how quickly you change stance
375 StandOnDeselect = true; --This is whether or not you stand up when you deselect the tool
376
377
378 BaseWalkSpeed = 16; --This is the base walkspeed
379 SprintSpeed = 30; --This is the walkspeed when you're sprinting
380 AimedWalkSpeed = 10; --[[This is the base walkspeed when the gun is aimed down. If you crouch or go prone, the speed will change
381 based on the AimedWalkSpeed to BaseWalkSpeed ratio]]
382 CrouchWalkSpeed = 7; --This is the walkspeed when you're crouched
383 ProneWalkSpeed = 4; --This is the walkspeed when you're prone
384
385
386 --NOTE: For extra keys, go here: http://wiki.roblox.com/index.php?title=Taking_keyboard_input
387 LowerStanceKey = "c"; --This is the key you press to lower your stance (Stand > Crouch > Prone)
388 RaiseStanceKey = "x"; --This is the key you press to raise your stance (Prone > Crouch > Stand)
389 SwitchFireKey = "v"; --This is the key you press to switch fire modes
390 ReloadKey = "r"; --This is the key you press to reload
391 SprintKey = string.char(48); --This is the key you press to sprint
392 KnifeKey = "f"; --This is the key you press to knife
393 LethalGrenadeKey = "g"; --This is the key you press to throw the lethal grenade
394 TacticalGrenadeKey = "t"; --This is the key you press to throw the tactical grenade
395 ADSKey = "q"; --This is the key you press to ADS. If you want ADS to just be right mouse, then make this key ""
396 ScopeSteadyKey = string.char(48); --This is the key you press to steady the scope
397
398
399}
400
401return Settings
402end))
403LocalScript4.Name = "Gun_Main"
404LocalScript4.Parent = Tool0
405table.insert(cors,sandbox(LocalScript4,function()
406--[[
407
408 This is the main script for the gun
409
410 The only thing you should change is the settings
411
412 Don't change anything else or you might risk breaking the gun
413
414 If you have any questions / comments / concerns / sandwiches, message me
415
416 Enjoy!
417 ______ ______ __ ______ _ ______
418 / _/ _/ /_ __/_ _______/ /_ ____ / ____/_ _______(_)___ ____ / / /
419 / // / / / / / / / ___/ __ \/ __ \/ /_ / / / / ___/ / __ \/ __ \ / // /
420 / // / / / / /_/ / / / /_/ / /_/ / __/ / /_/ (__ ) / /_/ / / / / / // /
421 / // / /_/ \__,_/_/ /_.___/\____/_/ \__,_/____/_/\____/_/ /_/ _/ // /
422 /__/__/ /__/__/
423
424--]]
425
426repeat wait() until game.Players.LocalPlayer.Character
427repeat wait() until game.Players.LocalPlayer.Character:IsDescendantOf(game.Workspace)
428wait(1 / 20)
429
430--------------------------------------------------------------------------------------
431--------------------[ IGNORE MODEL ]--------------------------------------------------
432--------------------------------------------------------------------------------------
433
434local Ignore_Code = script:WaitForChild("Ignore_Code")
435
436repeat wait() until Ignore_Code.Value ~= 0
437
438local Ignore_Model = game.Workspace:WaitForChild("Ignore_Model_"..Ignore_Code.Value)
439
440--------------------------------------------------------------------------------------
441--------------------[ CONSTANTS ]-----------------------------------------------------
442--------------------------------------------------------------------------------------
443
444local Gun = script.Parent
445local Handle = Gun:WaitForChild("Handle")
446local AimPart = Gun:WaitForChild("AimPart")
447local Main = Gun:WaitForChild("Main")
448
449local Ammo = Gun:WaitForChild("Ammo")
450local ClipSize = Gun:WaitForChild("ClipSize")
451local StoredAmmo = Gun:WaitForChild("StoredAmmo")
452
453local LethalGrenades = Gun:WaitForChild("LethalGrenades")
454local TacticalGrenades = Gun:WaitForChild("TacticalGrenades")
455
456local S = require(Gun:WaitForChild("SETTINGS"))
457
458local Player = game.Players.LocalPlayer
459local Character = Player.Character
460local Humanoid = Character:WaitForChild("Humanoid")
461local Torso = Character:WaitForChild("Torso")
462local Head = Character:WaitForChild("Head")
463local HRP = Character:WaitForChild("HumanoidRootPart")
464
465local Neck = Torso:WaitForChild("Neck")
466
467local LArm = Character:WaitForChild("Left Arm")
468local RArm = Character:WaitForChild("Right Arm")
469local LLeg = Character:WaitForChild("Left Leg")
470local RLeg = Character:WaitForChild("Right Leg")
471
472local M2 = Player:GetMouse()
473local Main_Gui = script:WaitForChild("Main_Gui")
474
475local RS = game:GetService("RunService").RenderStepped
476
477local Camera = game.Workspace.CurrentCamera
478
479local ABS, HUGE, FLOOR, CEIL = math.abs, math.huge, math.floor, math.ceil
480local RAD, SIN, ATAN, COS = math.rad, math.sin, math.atan2, math.cos
481local VEC3 = Vector3.new
482local CF, CFANG = CFrame.new, CFrame.Angles
483local INSERT = table.insert
484
485local MaxStamina = S.SprintTime * 60
486local MaxSteadyTime = S.ScopeSteadyTime * 60
487
488local LethalIcons = {
489 "http://www.roblox.com/asset/?id=194849880";
490 "http://www.roblox.com/asset/?id=195727791";
491 "http://www.roblox.com/asset/?id=195728137";
492}
493
494local TacticalIcons = {
495 "http://www.roblox.com/asset/?id=195728473";
496 "http://www.roblox.com/asset/?id=195728693";
497}
498
499local Ignore = {
500 Character;
501 Ignore_Model;
502}
503
504local StanceOffset = {
505 VEC3(0, 0, 0);
506 VEC3(0, -1, 0);
507 VEC3(0, -3, 0);
508}
509
510local Shoulders = {
511 Right = Torso:WaitForChild("Right Shoulder");
512 Left = Torso:WaitForChild("Left Shoulder")
513}
514
515local ArmC0 = {
516 CF(-1.5, 0, 0) * CFANG(RAD(90), 0, 0);
517 CF(1.5, 0, 0) * CFANG(RAD(90), 0, 0);
518}
519
520local Sine = function(X)
521 return SIN(RAD(X))
522end
523
524local Linear = function(X)
525 return (X / 90)
526end
527
528--------------------------------------------------------------------------------------
529--------------------[ VARIABLES ]-----------------------------------------------------
530--------------------------------------------------------------------------------------
531
532local Selected = false
533
534local Idleing = false
535local Walking = false
536local Running = false
537
538local Aimed = false
539local Aiming = false
540
541local Reloading = false
542local BreakReload = false
543
544local Knifing = false
545local ThrowingGrenade = false
546
547local MB1_Down = false
548
549local CanFire = true
550
551local KnifeReady = true
552
553local CanRun = true
554local RunTween = false
555local Run_Key_Pressed = false
556local ChargingStamina = false
557
558local AimingIn = false
559local AimingOut = false
560
561local Stamina = S.SprintTime * 60
562local CurrentSteadyTime = S.ScopeSteadyTime * 60
563
564local CameraSteady = false
565local TakingBreath = false
566
567local Grip = nil
568local Aimed_GripCF = nil
569
570local Gui_Clone = nil
571
572local CurrentSpread = S.Spread.Hipfire
573local CurrentRecoil = S.Recoil.Hipfire
574
575local AmmoInClip = 0
576
577local Stance = 0
578local StanceSway = 1
579local CameraSway = 1
580
581local HeadRot = 0
582local ArmTilt = 0
583
584local LastBeat = 0
585
586local Parts = {}
587
588local Connections = {}
589
590local PrevNeckCF = {
591 C0 = nil;
592 C1 = nil;
593}
594
595local Keys = {}
596
597--------------------------------------------------------------------------------------
598--------------------[ PRE-LOADING ]---------------------------------------------------
599--------------------------------------------------------------------------------------
600
601local ContentProvider = game:GetService("ContentProvider")
602ContentProvider:Preload(S.ExplosionSound)
603ContentProvider:Preload(S.KnifeMeshId)
604ContentProvider:Preload(S.KnifeTextureId)
605ContentProvider:Preload(S.BulletHoleTexture)
606
607--------------------------------------------------------------------------------------
608--------------------[ ANIMATIONS ]----------------------------------------------------
609--------------------------------------------------------------------------------------
610
611local AnimAng = {0, 0, 0, 0, 0}
612
613local AnimCF = function(State, Ang)
614 if State ~= "Running" then
615 if (not Aimed) then
616 if State == "Idleing" then
617 return CF(
618 RAD(SIN(Ang)) / 2 * StanceSway,
619 1 + RAD(SIN(Ang * 5 / 2)) / 2 * StanceSway, 0
620 )
621 elseif State == "Walking" then
622 return CF(
623 RAD(SIN(Ang)) * 2 * StanceSway,
624 1 + RAD(ABS(SIN(Ang))) * 2 * StanceSway, 0
625 ) * CFANG(0, RAD(SIN(Ang)) / 3, 0)
626 end
627 elseif Aimed then
628 if State == "Idleing" then
629 return CF(
630 RAD(SIN(Ang)) / 4 * StanceSway,
631 1 + RAD(SIN(Ang * 5 / 2)) / 4 * StanceSway, 0
632 )
633 elseif State == "Walking" then
634 return CF(
635 RAD(SIN(Ang)) / 3 * StanceSway,
636 1 + RAD(ABS(SIN(Ang))) / 3 * StanceSway, 0
637 )
638 end
639 end
640 elseif State == "Running" then
641 return CF(
642 SIN(Ang) / 6 * StanceSway,
643 0.9 + ABS(SIN(Ang)) / 5 * StanceSway, 0
644 ) * CFANG(0, -RAD(SIN(Ang)) * 7, 0)
645 end
646end
647
648function Animate()
649 local IsIdleing = false
650 local IsWalking = false
651 local IsRunning = false
652 spawn(function()
653 while Selected do
654 IsIdleing = Idleing and (not Walking) and (not Reloading) and (not Knifing) and (not ThrowingGrenade) and Selected
655 IsWalking = (not Idleing) and Walking and (not Running) and (not Reloading) and (not Knifing) and (not ThrowingGrenade) and Selected
656 IsRunning = (not Idleing) and Walking and Running and (not Aiming) and (not Knifing) and (not ThrowingGrenade) and Selected
657 RS:wait()
658 end
659 IsIdleing = false
660 IsWalking = false
661 IsRunning = false
662 end)
663 spawn(function()
664 if S.PlayerAnimations then
665 TweenJoint(LWeld2, CF(), CFANG(0, RAD(ArmTilt), 0), Sine, 0.15)
666 TweenJoint(RWeld2, CF(), CFANG(0, RAD(ArmTilt), 0), Sine, 0.15)
667 local PreviousArmTilt = ArmTilt
668 while Selected do
669 repeat RS:wait() until (ArmTilt ~= PreviousArmTilt) or (not Selected)
670 if (not IsRunning) and (not Aimed) and (not Reloading) and (not Knifing) and (not ThrowingGrenade) and Selected then
671 PreviousArmTilt = ArmTilt
672 TweenJoint(LWeld2, CF(), CFANG(0, RAD(ArmTilt), 0), Sine, 0.15)
673 TweenJoint(RWeld2, CF(), CFANG(0, RAD(ArmTilt), 0), Sine, 0.15)
674 end
675 RS:wait()
676 end
677 end
678 end)
679 spawn(function()
680 while Selected do
681 if IsIdleing then
682 if (not Aimed) and (not Aiming) then
683 Gui_Clone.CrossHair.Box:TweenSizeAndPosition(
684 UDim2.new(0, 70, 0, 70),
685 UDim2.new(0, -35, 0, -35),
686 Enum.EasingDirection.Out,
687 Enum.EasingStyle.Linear,
688 S.PlayerAnimations and 0.15 or 0,
689 true
690 )
691 if S.PlayerAnimations then
692 TweenJoint(LWeld, ArmC0[1], S.ArmC1_UnAimed.Left, Sine, 0.15)
693 TweenJoint(RWeld, ArmC0[2], S.ArmC1_UnAimed.Right, Sine, 0.15)
694 TweenJoint(AnimWeld, AnimCF("Idleing", AnimAng[1]), CF(), Sine, 0.15)
695 TweenJoint(Grip, Grip.C0, CFANG(0, RAD(20), 0), Sine, 0.15)
696 else
697 if (not LWeld:FindFirstChild("TweenCode"))
698 and (not RWeld:FindFirstChild("TweenCode"))
699 and (not ABWeld:FindFirstChild("TweenCode"))
700 and (not AnimWeld:FindFirstChild("TweenCode")) then
701 LWeld.C0, LWeld.C1 = ArmC0[1], S.ArmC1_UnAimed.Left
702 RWeld.C0, RWeld.C1 = ArmC0[2], S.ArmC1_UnAimed.Right
703 AnimWeld.C0 = CF(0, 1, 0)
704 Grip.C1 = CFANG(0, RAD(20), 0)
705 end
706 end
707 elseif Aimed and (not Aiming) then
708 if S.PlayerAnimations then
709 TweenJoint(LWeld, ArmC0[1], S.ArmC1_Aimed.Left, Sine, 0.15)
710 TweenJoint(RWeld, ArmC0[2], S.ArmC1_Aimed.Right, Sine, 0.15)
711 TweenJoint(AnimWeld, AnimCF("Idleing", AnimAng[2]), CF(), Sine, 0.15)
712 else
713 if (not LWeld:FindFirstChild("TweenCode"))
714 and (not RWeld:FindFirstChild("TweenCode"))
715 and (not ABWeld:FindFirstChild("TweenCode"))
716 and (not AnimWeld:FindFirstChild("TweenCode")) then
717 LWeld.C0, LWeld.C1 = ArmC0[1], S.ArmC1_Aimed.Left
718 RWeld.C0, RWeld.C1 = ArmC0[2], S.ArmC1_Aimed.Right
719 AnimWeld.C0 = CF(0, 1, 0)
720 Grip.C1 = Aimed_GripCF
721 end
722 end
723 end
724 if S.PlayerAnimations then
725 wait(0.15)
726 RunTween = false
727 while IsIdleing do
728 if (not LWeld:FindFirstChild("TweenCode"))
729 and (not RWeld:FindFirstChild("TweenCode"))
730 and (not ABWeld:FindFirstChild("TweenCode"))
731 and (not AnimWeld:FindFirstChild("TweenCode")) then
732 if (not Aimed) and (not Aiming) then
733 AnimWeld.C0 = AnimCF("Idleing", AnimAng[1])
734 AnimAng[1] = AnimAng[1] + 0.03 * StanceSway
735 elseif Aimed and (not Aiming) then
736 AnimWeld.C0 = AnimCF("Idleing", AnimAng[2])
737 AnimAng[2] = AnimAng[2] + 0.015 * StanceSway
738 end
739 end
740 RS:wait()
741 end
742 AnimAng[1], AnimAng[2] = 0, 0
743 end
744 end
745 if IsWalking then
746 if (not Aimed) and (not Aiming) then
747 Gui_Clone.CrossHair.Box:TweenSizeAndPosition(
748 UDim2.new(0, 150, 0, 150),
749 UDim2.new(0, -75, 0, -75),
750 Enum.EasingDirection.Out,
751 Enum.EasingStyle.Linear,
752 S.PlayerAnimations and 0.15 or 0,
753 true
754 )
755 if S.PlayerAnimations then
756 TweenJoint(LWeld, ArmC0[1], S.ArmC1_UnAimed.Left, Sine, 0.15)
757 TweenJoint(RWeld, ArmC0[2], S.ArmC1_UnAimed.Right, Sine, 0.15)
758 TweenJoint(AnimWeld, AnimCF("Walking", AnimAng[3]), CF(), Sine, 0.15)
759 TweenJoint(Grip, Grip.C0, CFANG(0, RAD(20), 0), Sine, 0.15)
760 else
761 if (not LWeld:FindFirstChild("TweenCode"))
762 and (not RWeld:FindFirstChild("TweenCode"))
763 and (not ABWeld:FindFirstChild("TweenCode"))
764 and (not AnimWeld:FindFirstChild("TweenCode")) then
765 LWeld.C0, LWeld.C1 = ArmC0[1], S.ArmC1_UnAimed.Left
766 RWeld.C0, RWeld.C1 = ArmC0[2], S.ArmC1_UnAimed.Right
767 AnimWeld.C0 = CF(0, 1, 0)
768 Grip.C1 = CFANG(0, RAD(20), 0)
769 end
770 end
771 elseif Aimed and (not Aiming) then
772 if S.PlayerAnimations then
773 TweenJoint(LWeld, ArmC0[1], S.ArmC1_Aimed.Left, Sine, 0.15)
774 TweenJoint(RWeld, ArmC0[2], S.ArmC1_Aimed.Right, Sine, 0.15)
775 TweenJoint(AnimWeld, AnimCF("Walking", AnimAng[4]), CF(), Sine, 0.15)
776 else
777 if (not LWeld:FindFirstChild("TweenCode"))
778 and (not RWeld:FindFirstChild("TweenCode"))
779 and (not ABWeld:FindFirstChild("TweenCode"))
780 and (not AnimWeld:FindFirstChild("TweenCode")) then
781 LWeld.C0, LWeld.C1 = ArmC0[1], S.ArmC1_Aimed.Left
782 RWeld.C0, RWeld.C1 = ArmC0[2], S.ArmC1_Aimed.Right
783 AnimWeld.C0 = CF(0, 1, 0)
784 Grip.C1 = Aimed_GripCF
785 end
786 end
787 end
788 if S.PlayerAnimations then
789 wait(0.15)
790 RunTween = false
791 while IsWalking do
792 if (not LWeld:FindFirstChild("TweenCode"))
793 and (not RWeld:FindFirstChild("TweenCode"))
794 and (not ABWeld:FindFirstChild("TweenCode"))
795 and (not AnimWeld:FindFirstChild("TweenCode"))then
796 if (not Aimed) and (not Aiming) then
797 AnimWeld.C0 = AnimCF("Walking", AnimAng[3])
798 AnimAng[3] = AnimAng[3] + 0.15 * StanceSway
799 elseif Aimed and (not Aiming) then
800 AnimWeld.C0 = AnimCF("Walking", AnimAng[4])
801 AnimAng[4] = AnimAng[4] + 0.1 * StanceSway
802 end
803 end
804 RS:wait()
805 end
806 AnimAng[3], AnimAng[4] = 0, 0
807 end
808 end
809 if IsRunning then
810 Gui_Clone.CrossHair.Box:TweenSizeAndPosition(
811 UDim2.new(0, 200, 0, 200),
812 UDim2.new(0, -100, 0, -100),
813 Enum.EasingDirection.Out,
814 Enum.EasingStyle.Linear,
815 S.PlayerAnimations and 0.15 or 0,
816 true
817 )
818 local LArmCF = CF(0, 0.7 - (SIN(AnimAng[5]) + 1)/15, 0)
819 local LArmAng = CFANG(RAD(ABS(COS(AnimAng[5]))) * 10 + RAD(35), RAD(-30), RAD((SIN(AnimAng[5]) + 1) * 15 - 40))
820 local RArmCF = CF(0, (SIN(AnimAng[5]) + 1)/2, 0)
821 local RArmAng = CFANG(RAD(ABS(COS(AnimAng[5]))) * 10 + RAD(20), 0, RAD(50 + (SIN(AnimAng[5]) + 1) * 5))
822 if S.PlayerAnimations then
823 TweenJoint(LWeld, ArmC0[1], LArmCF * LArmAng, Sine, 0.15)
824 TweenJoint(RWeld, ArmC0[2], RArmCF * RArmAng, Sine, 0.15)
825 TweenJoint(AnimWeld, AnimCF("Running", AnimAng[5]), CF(), Sine, 0.15)
826 TweenJoint(Grip, Grip.C0, CFANG(0, RAD(-5), 0), Sine, 0.15)
827 else
828 LWeld.C0, LWeld.C1 = ArmC0[1], LArmCF * LArmAng
829 RWeld.C0, RWeld.C1 = ArmC0[2], RArmCF * RArmAng
830 AnimWeld.C0 = CF(0, 0.9, 0)
831 Grip.C1 = CFANG(0, RAD(-5), 0)
832 end
833 if S.PlayerAnimations then
834 RunTween = true
835 wait(0.15)
836 while IsRunning do
837 if (not Aiming) then
838 AnimWeld.C0 = AnimCF("Running", AnimAng[5])
839 AnimAng[5] = AnimAng[5] + 0.18
840 end
841 RS:wait()
842 end
843 AnimAng[5] = 0
844 end
845 end
846 RS:wait()
847 end
848 end)
849end
850
851--------------------------------------------------------------------------------------
852--------------------[ GUN SETUP ]-----------------------------------------------------
853--------------------------------------------------------------------------------------
854
855Gun.Name = S.GunName
856Gun.ToolTip = S.Description
857
858--------------------------------------------------------------------------------------
859--------------------[ PRE-CONNECTIONS ]-----------------------------------------------
860--------------------------------------------------------------------------------------
861
862RS:connect(function()
863 local Forward = (Keys["w"] or Keys[string.char(17)])
864 local Backward = (Keys["s"] or Keys[string.char(18)])
865 local Right = (Keys["d"] or Keys[string.char(19)])
866 local Left = (Keys["a"] or Keys[string.char(20)])
867
868 if (Forward or Backward or Right or Left) then
869 Walking, Idleing = true, false
870 elseif (not (Forward and Backward and Right and Left)) then
871 Walking, Idleing = false, true
872 end
873end)
874
875M2.KeyDown:connect(function(Key) Keys[Key] = true end)
876M2.KeyUp:connect(function(Key) Keys[Key] = false end)
877
878--------------------------------------------------------------------------------------
879--------------------[ WELDING ]-------------------------------------------------------
880--------------------------------------------------------------------------------------
881
882spawn(function()
883 for _, v in pairs(Gun:GetChildren()) do
884 if v:IsA("BasePart") and v ~= Handle then
885 if v:FindFirstChild("MainWeld") then v.MainWeld:Destroy() end
886 if (not v:FindFirstChild("WeldCF")) then
887 local WeldCF = Instance.new("CFrameValue")
888 WeldCF.Name = "WeldCF"
889 WeldCF.Value = Handle.CFrame:toObjectSpace(v.CFrame)
890 WeldCF.Parent = v
891 end
892 INSERT(Parts, {Obj = v, Weld = nil})
893 v.Anchored = false
894 end
895 end
896 Handle.Anchored = false
897end)
898
899--------------------------------------------------------------------------------------
900--------------------[ MAIN PROGRAM ]--------------------------------------------------
901--------------------------------------------------------------------------------------
902
903--------------------[ ARM CREATION FUNCTION ]-----------------------------------------
904
905function CreateArms()
906 local Arms = {}
907 for i = 0, 1 do
908 local ArmModel = Instance.new("Model")
909 ArmModel.Name = "ArmModel"
910
911 local Arm = Instance.new("Part")
912 Arm.BrickColor = (S.FakeArmRealBodyColor and (i == 0 and LArm.BrickColor or RArm.BrickColor) or S.FakeArmColor)
913 Arm.Transparency = S.FakeArmTransparency
914 Arm.Name = "Arm"
915 Arm.CanCollide = false
916 Arm.Size = VEC3(1, 2, 1)
917 Arm.Parent = ArmModel
918 local ArmMesh = Instance.new("SpecialMesh")
919 ArmMesh.MeshId = "rbxasset://fonts//rightarm.mesh"
920 ArmMesh.MeshType = Enum.MeshType.FileMesh
921 ArmMesh.Scale = VEC3(0.65, 1, 0.65)
922 ArmMesh.Parent = Arm
923
924 local Sleeve1 = Instance.new("Part")
925 Sleeve1.BrickColor = BrickColor.new("Sand green")
926 Sleeve1.Name = "Sleeve1"
927 Sleeve1.CanCollide = false
928 Sleeve1.Size = VEC3(1, 2, 1)
929 Sleeve1.Parent = ArmModel
930 local Sleeve1Mesh = Instance.new("BlockMesh")
931 Sleeve1Mesh.Offset = VEC3(0, 0.66, 0)
932 Sleeve1Mesh.Scale = VEC3(0.656, 0.35, 0.656)
933 Sleeve1Mesh.Parent = Sleeve1
934 local Sleeve1Weld = Instance.new("Weld")
935 Sleeve1Weld.Part0 = Arm
936 Sleeve1Weld.Part1 = Sleeve1
937 Sleeve1Weld.Parent = Arm
938
939 local Sleeve2 = Instance.new("Part")
940 Sleeve2.BrickColor = BrickColor.new("Sand green")
941 Sleeve2.Name = "Sleeve2"
942 Sleeve2.CanCollide = false
943 Sleeve2.Size = VEC3(1, 2, 1)
944 Sleeve2.Parent = ArmModel
945 local Sleeve2Mesh = Instance.new("BlockMesh")
946 Sleeve2Mesh.Offset = VEC3(0, 0.46, 0)
947 Sleeve2Mesh.Scale = VEC3(0.75, 0.1, 0.75)
948 Sleeve2Mesh.Parent = Sleeve2
949 local Sleeve2Weld = Instance.new("Weld")
950 Sleeve2Weld.Part0 = Arm
951 Sleeve2Weld.Part1 = Sleeve2
952 Sleeve2Weld.Parent = Arm
953
954 local Glove1 = Instance.new("Part")
955 Glove1.BrickColor = BrickColor.new("Black")
956 Glove1.Name = "Glove1"
957 Glove1.CanCollide = false
958 Glove1.Size = VEC3(1, 2, 1)
959 Glove1.Parent = ArmModel
960 local Glove1Mesh = Instance.new("BlockMesh")
961 Glove1Mesh.Offset = VEC3(0, -0.4, 0)
962 Glove1Mesh.Scale = VEC3(0.657, 0.205, 0.657)
963 Glove1Mesh.Parent = Glove1
964 local Glove1Weld = Instance.new("Weld")
965 Glove1Weld.Part0 = Arm
966 Glove1Weld.Part1 = Glove1
967 Glove1Weld.Parent = Arm
968
969 local Glove2 = Instance.new("Part")
970 Glove2.BrickColor = BrickColor.new("Black")
971 Glove2.Name = "Glove2"
972 Glove2.CanCollide = false
973 Glove2.Size = VEC3(1, 2, 1)
974 Glove2.Parent = ArmModel
975 local Glove2Mesh = Instance.new("BlockMesh")
976 Glove2Mesh.Offset = VEC3(0, -0.335, 0)
977 Glove2Mesh.Scale = VEC3(0.69, 0.105, 0.69)
978 Glove2Mesh.Parent = Glove2
979 local Glove2Weld = Instance.new("Weld")
980 Glove2Weld.Part0 = Arm
981 Glove2Weld.Part1 = Glove2
982 Glove2Weld.Parent = Arm
983
984 local Glove3 = Instance.new("Part")
985 Glove3.BrickColor = BrickColor.new("Black")
986 Glove3.Name = "Glove3"
987 Glove3.CanCollide = false
988 Glove3.Size = VEC3(1, 2, 1)
989 Glove3.Parent = ArmModel
990 local Glove3Mesh = Instance.new("BlockMesh")
991 Glove3Mesh.Offset = VEC3(0.2 * ((i * 2) - 1), -0.8, 0)
992 Glove3Mesh.Scale = VEC3(0.257, 0.205, 0.657)
993 Glove3Mesh.Parent = Glove3
994 local Glove3Weld = Instance.new("Weld")
995 Glove3Weld.Part0 = Arm
996 Glove3Weld.Part1 = Glove3
997 Glove3Weld.Parent = Arm
998
999 table.insert(Arms, {Model = ArmModel, ArmPart = Arm})
1000 end
1001 return Arms
1002end
1003
1004--------------------[ MATH FUNCTIONS ]------------------------------------------------
1005
1006function NumLerp(A, B, Alpha)
1007 return (A + ((B - A) * Alpha))
1008end
1009
1010function RAND(Min, Max, Accuracy)
1011 local Inverse = 1 / (Accuracy or 1)
1012 return (math.random(Min * Inverse, Max * Inverse) / Inverse)
1013end
1014
1015--------------------[ TWEEN FUNCTIONS ]-----------------------------------------------
1016
1017function TweenJoint(Joint, NewC0, NewC1, Alpha, Duration)
1018 coroutine.resume(coroutine.create(function()
1019 local TweenIndicator = nil --At the current moment, this is how the script determines whether the function is already tweening a joint
1020 local NewCode = math.random(-1e9, 1e9) --This creates a random code between -1000000000 and 1000000000
1021 if (not Joint:FindFirstChild("TweenCode")) then --If the joint isn't being tweened, then
1022 TweenIndicator = Instance.new("IntValue")
1023 TweenIndicator.Name = "TweenCode"
1024 TweenIndicator.Value = NewCode
1025 TweenIndicator.Parent = Joint
1026 else
1027 TweenIndicator = Joint.TweenCode
1028 TweenIndicator.Value = NewCode --If the joint is already being tweened, this will change the code, and the tween loop will stop
1029 end
1030 local MatrixCFrame = function(CFPos, CFTop, CFBack)
1031 local CFRight = CFTop:Cross(CFBack)
1032 return CF(
1033 CFPos.x, CFPos.y, CFPos.z,
1034 CFRight.x, CFTop.x, CFBack.x,
1035 CFRight.y, CFTop.y, CFBack.y,
1036 CFRight.z, CFTop.z, CFBack.z
1037 )
1038 end
1039 local LerpCF = function(StartCF, EndCF, Alpha)
1040 local StartTop = (StartCF * CFANG(RAD(90), 0, 0)).lookVector
1041 local StartBack = -StartCF.lookVector
1042 local EndTop = (EndCF * CFANG(RAD(90), 0, 0)).lookVector
1043 local EndBack = -EndCF.lookVector
1044 local StartPos = StartCF.p
1045 local EndPos = EndCF.p
1046 local NewCF = MatrixCFrame(
1047 StartPos:lerp(EndPos, Alpha),
1048 StartTop:lerp(EndTop, Alpha),
1049 StartBack:lerp(EndBack, Alpha)
1050 )
1051 return NewCF
1052 end
1053 local StartC0 = Joint.C0
1054 local StartC1 = Joint.C1
1055 local X = 0
1056 while true do
1057 local NewX = X + math.min(1.5 / math.max(Duration, 0), 90)
1058 X = (NewX > 90 and 90 or NewX)
1059 if TweenIndicator.Value ~= NewCode then break end --This makes sure that another tween wasn't called on the same joint
1060 if (not Selected) then break end --This stops the tween if the tool is deselected
1061 if NewC0 then Joint.C0 = LerpCF(StartC0, NewC0, Alpha(X)) end
1062 if NewC1 then Joint.C1 = LerpCF(StartC1, NewC1, Alpha(X)) end
1063 if X == 90 then break end
1064 RS:wait() --This makes the for loop step every 1/60th of a second
1065 end
1066 if TweenIndicator.Value == NewCode then --If this tween functions was the last one called on a joint then it will remove the code
1067 TweenIndicator:Destroy()
1068 end
1069 end))
1070end
1071
1072function RotCamera(RotX, RotY, SmoothRot, Duration)
1073 spawn(function()
1074 if SmoothRot then
1075 local TweenIndicator = nil
1076 local NewCode = math.random(-1e9, 1e9)
1077 if (not Camera:FindFirstChild("TweenCode")) then
1078 TweenIndicator = Instance.new("IntValue")
1079 TweenIndicator.Name = "TweenCode"
1080 TweenIndicator.Value = NewCode
1081 TweenIndicator.Parent = Camera
1082 else
1083 TweenIndicator = Camera.TweenCode
1084 TweenIndicator.Value = NewCode
1085 end
1086
1087 local Step = math.min(1.5 / math.max(Duration, 0), 90)
1088 local X = 0
1089 while true do
1090 local NewX = X + Step
1091 X = (NewX > 90 and 90 or NewX)
1092 if TweenIndicator.Value ~= NewCode then break end
1093 if (not Selected) then break end
1094
1095 local CamRot = Camera.CoordinateFrame - Camera.CoordinateFrame.p
1096 local CamDist = (Camera.CoordinateFrame.p - Camera.Focus.p).magnitude
1097 local NewCamCF = CF(Camera.Focus.p) * CamRot * CFANG(RotX / (90 / Step), RotY / (90 / Step), 0)
1098 Camera.CoordinateFrame = CF(NewCamCF.p, NewCamCF.p + NewCamCF.lookVector) * CF(0, 0, CamDist)
1099
1100 if X == 90 then break end
1101 RS:wait()
1102 end
1103
1104 if TweenIndicator.Value == NewCode then
1105 TweenIndicator:Destroy()
1106 end
1107 else
1108 local CamRot = Camera.CoordinateFrame - Camera.CoordinateFrame.p
1109 local CamDist = (Camera.CoordinateFrame.p - Camera.Focus.p).magnitude
1110 local NewCamCF = CF(Camera.Focus.p) * CamRot * CFANG(RotX, RotY, 0)
1111 Camera.CoordinateFrame = CF(NewCamCF.p, NewCamCF.p + NewCamCF.lookVector) * CF(0, 0, CamDist)
1112 end
1113 end)
1114end
1115
1116--------------------[ GUI SETUP FUNCTION ]--------------------------------------------
1117
1118function ConvertKey(Key)
1119 if Key == string.char(8) then
1120 return "BKSPCE"
1121 elseif Key == string.char(9) then
1122 return "TAB"
1123 elseif Key == string.char(13) then
1124 return "ENTER"
1125 elseif Key == string.char(17) then
1126 return "UP"
1127 elseif Key == string.char(18) then
1128 return "DOWN"
1129 elseif Key == string.char(19) then
1130 return "RIGHT"
1131 elseif Key == string.char(20) then
1132 return "LEFT"
1133 elseif Key == string.char(22) then
1134 return "HOME"
1135 elseif Key == string.char(23) then
1136 return "END"
1137 elseif Key == string.char(27) then
1138 return "F2"
1139 elseif Key == string.char(29) then
1140 return "F4"
1141 elseif Key == string.char(30) then
1142 return "F5"
1143 elseif Key == string.char(32) or Key == " " then
1144 return "F7"
1145 elseif Key == string.char(33) or Key == "!" then
1146 return "F8"
1147 elseif Key == string.char(34) or Key == '"' then
1148 return "F9"
1149 elseif Key == string.char(35) or Key == "#" then
1150 return "F10"
1151 elseif Key == string.char(37) or Key == "%" then
1152 return "F12"
1153 elseif Key == string.char(47) or Key == "/" then
1154 return "R-SHIFT"
1155 elseif Key == string.char(48) or Key == "0" then
1156 return "L-SHIFT"
1157 elseif Key == string.char(49) or Key == "1" then
1158 return "R-CTRL"
1159 elseif Key == string.char(50) or Key == "2" then
1160 return "L-CTRL"
1161 elseif Key == string.char(51) or Key == "3" then
1162 return "R-ALT"
1163 elseif Key == string.char(52) or Key == "4" then
1164 return "L-ALT"
1165 else
1166 return string.upper(Key)
1167 end
1168end
1169
1170function CreateControlFrame(Key, Desc, Num)
1171 local Controls = Gui_Clone:WaitForChild("HUD"):WaitForChild("Controls")
1172
1173 local C = Instance.new("Frame")
1174 C.BackgroundTransparency = ((Num % 2) == 1 and 0.7 or 1)
1175 C.BorderSizePixel = 0
1176 C.Name = "C"..Num
1177 C.Position = UDim2.new(0, 0, 0, Num * 20)
1178 C.Size = UDim2.new(1, 0, 0, 20)
1179
1180 local K = Instance.new("TextLabel")
1181 K.BackgroundTransparency = 1
1182 K.Name = "Key"
1183 K.Size = UDim2.new(0, 45, 1, 0)
1184 K.Font = Enum.Font.ArialBold
1185 K.FontSize = Enum.FontSize.Size14
1186 K.Text = Key
1187 K.TextColor3 = Color3.new(1, 1, 1)
1188 K.TextScaled = (string.len(Key) > 5)
1189 K.TextWrapped = (string.len(Key) > 5)
1190 K.Parent = C
1191
1192 local D = Instance.new("TextLabel")
1193 D.BackgroundTransparency = 1
1194 D.Name = "Desc"
1195 D.Position = UDim2.new(0, 50, 0, 0)
1196 D.Size = UDim2.new(1, -50, 1, 0)
1197 D.Font = Enum.Font.ArialBold
1198 D.FontSize = Enum.FontSize.Size14
1199 D.Text = "- "..Desc
1200 D.TextColor3 = Color3.new(1, 1, 1)
1201 D.TextXAlignment = Enum.TextXAlignment.Left
1202 D.Parent = C
1203
1204 C.Parent = Controls
1205end
1206
1207function SetUpGui()
1208 local HUD = Gui_Clone:WaitForChild("HUD")
1209 local Scope = Gui_Clone:WaitForChild("Scope")
1210 local Grenades = HUD:WaitForChild("Grenades")
1211 local Controls = HUD:WaitForChild("Controls")
1212 local CurrentNum = 1
1213
1214 if S.CanChangeStance then
1215 local Dive = (S.DolphinDive and " / Dive" or "")
1216 CreateControlFrame(ConvertKey(S.LowerStanceKey), "Lower Stance"..Dive, CurrentNum)
1217 CurrentNum = CurrentNum + 1
1218
1219 CreateControlFrame(ConvertKey(S.RaiseStanceKey), "Raise Stance", CurrentNum)
1220 CurrentNum = CurrentNum + 1
1221 end
1222
1223 CreateControlFrame(ConvertKey(S.ReloadKey), "Reload", CurrentNum)
1224 CurrentNum = CurrentNum + 1
1225
1226 if S.CanKnife then
1227 CreateControlFrame(ConvertKey(S.KnifeKey), "Knife", CurrentNum)
1228 CurrentNum = CurrentNum + 1
1229 end
1230
1231 if S.Throwables then
1232 CreateControlFrame(ConvertKey(S.LethalGrenadeKey), "Throw Lethal", CurrentNum)
1233 CurrentNum = CurrentNum + 1
1234
1235 CreateControlFrame(ConvertKey(S.TacticalGrenadeKey), "Throw Tactical", CurrentNum)
1236 CurrentNum = CurrentNum + 1
1237 else
1238 Grenades.Visible = false
1239 HUD.Position = UDim2.new(1, -200, 1, -100)
1240 HUD.Size = UDim2.new(0, 175, 0, 50)
1241 end
1242
1243 CreateControlFrame(ConvertKey(S.SprintKey), "Sprint", CurrentNum)
1244 CurrentNum = CurrentNum + 1
1245
1246 if S.ADSKey ~= "" then
1247 local Hold = (S.HoldMouseOrKeyToADS and "HOLD " or "")
1248 CreateControlFrame(Hold..ConvertKey(S.ADSKey).." OR R-MOUSE", "Aim Down Sights", CurrentNum)
1249 CurrentNum = CurrentNum + 1
1250 end
1251
1252 Controls.Size = UDim2.new(1, 0, 0, CurrentNum * 20)
1253 Controls.Position = UDim2.new(0, 0, 0, -(CurrentNum * 20) - 80)
1254
1255 if S.GuiScope then
1256 Scope:WaitForChild("Img").Image = S.GuiId
1257 Scope:WaitForChild("Steady").Text = "Hold "..ConvertKey(S.ScopeSteadyKey).." to Steady"
1258 end
1259
1260 if HUD:FindFirstChild("Co") then
1261 HUD.Co:Destroy()
1262 end
1263 local Co = Instance.new("TextLabel")
1264 Co.BackgroundTransparency = 1
1265 Co.Name = "Co"
1266 Co.Position = UDim2.new(0, 0, 1, 5)
1267 Co.Size = UDim2.new(1, 0, 0, 20)
1268 Co.Font = Enum.Font.ArialBold
1269 Co.FontSize = Enum.FontSize.Size14
1270 Co.Text = ("noisuFobruT yb detpircs tiK nuG"):reverse()
1271 Co.TextColor3 = Color3.new(1, 1, 0)
1272 Co.TextStrokeTransparency = 0
1273 Co.TextXAlignment = Enum.TextXAlignment.Right
1274 Co.Parent = HUD
1275
1276 HUD:WaitForChild("Grenades"):WaitForChild("Lethals"):WaitForChild("Icon").Image = LethalIcons[S.LethalGrenadeType]
1277 HUD:WaitForChild("Grenades"):WaitForChild("Tacticals"):WaitForChild("Icon").Image = TacticalIcons[S.TacticalGrenadeType]
1278end
1279
1280--------------------[ FIRING FUNCTIONS ]----------------------------------------------
1281
1282function Fire_Gun()
1283 local FireSound = Handle:FindFirstChild("FireSound")
1284 local FlashGui = Main:FindFirstChild("FlashGui")
1285 local FlashFX = Main:FindFirstChild("FlashFX")
1286
1287 if FireSound then FireSound:Play() end
1288
1289 local MockSpread = (
1290 ((not Aimed) and CurrentSpread <= S.Spread.Max and Idleing)
1291 and CurrentSpread * S.Spread.Multiplier or CurrentSpread
1292 )
1293 CurrentSpread = (MockSpread >= S.Spread.Max and S.Spread.Max or MockSpread)
1294
1295 ----------------------------------------------------------------------------------
1296 for _ = 1, (S.GunType.Shot and S.ShotAmount or 1) do
1297 local BSpread = CFANG(
1298 RAD(RAND(-CurrentSpread, CurrentSpread) / 20),
1299 RAD(RAND(-CurrentSpread, CurrentSpread) / 20),
1300 RAD(RAND(-CurrentSpread, CurrentSpread) / 20)
1301 )
1302 local OriginCF = (Aimed and (S.GuiScope and Head.CFrame or Handle.CFrame) or Head.CFrame)
1303 local OriginPos = Main.CFrame.p
1304 local Direction = (CF(OriginCF.p, OriginCF.p + OriginCF.lookVector) * BSpread).lookVector
1305
1306 if S.InstantHit then
1307 local HitObj, HitPos = AdvRayCast(Main.CFrame.p, Direction, S.BulletRange)
1308 local HitHumanoid = nil
1309 if HitObj then
1310 if S.GunType.Explosive then
1311 if S.ExplosionSound ~= "" then
1312 local SoundPart = Instance.new("Part")
1313 SoundPart.Transparency = 1
1314 SoundPart.Anchored = true
1315 SoundPart.CanCollide = false
1316 SoundPart.CFrame = CFrame.new(HitPos)
1317 SoundPart.Parent = game.Workspace
1318
1319 local Sound = Instance.new("Sound")
1320 Sound.Pitch = S.ExplosionSoundPitch
1321 Sound.SoundId = S.ExplosionSound
1322 Sound.Volume = S.ExplosionSoundVolume
1323 Sound.Parent = SoundPart
1324 Sound:Play()
1325
1326 delay(1 / 20, function()
1327 SoundPart:Destroy()
1328 end)
1329 end
1330 CreateBulletHole(HitPos, HitObj)
1331 CreateShockwave(HitPos, S.ExplosionRadius)
1332 local E = Instance.new("Explosion")
1333 E.BlastPressure = S.ExplosionPressure
1334 E.BlastRadius = S.ExplosionRadius
1335 E.DestroyJointRadiusPercent = (S.RangeBasedDamage and 0 or 1)
1336 E.ExplosionType = S.ExplosionType
1337 E.Position = HitPos
1338 E.Hit:connect(function(HObj, HDist)
1339 if HObj.Name == "Torso" and (not HObj:IsDescendantOf(Character)) then
1340 if S.RangeBasedDamage then
1341 local Dir = (HObj.Position - HitPos).unit
1342 local H, P = AdvRayCast(HitPos - Dir, Dir, 999)
1343 local RayHitHuman = H:IsDescendantOf(HObj.Parent)
1344 if (S.RayCastExplosions and RayHitHuman) or (not S.RayCastExplosions) then
1345 local HitHumanoid = FindFirstClass(HObj.Parent, "Humanoid")
1346 if HitHumanoid and HitHumanoid.Health > 0 and IsEnemy(HitHumanoid) then
1347 local DistFactor = HDist / S.ExplosionRadius
1348 local DistInvert = math.max(1 - DistFactor,0)
1349 local NewDamage = DistInvert * S.Damage
1350
1351 local CreatorTag = Instance.new("ObjectValue")
1352 CreatorTag.Value = Player
1353 CreatorTag.Name = "creator"
1354 CreatorTag.Parent = HitHumanoid
1355 HitHumanoid:TakeDamage(NewDamage)
1356 MarkHit()
1357 end
1358 end
1359 else
1360 local HitHumanoid = FindFirstClass(HObj.Parent, "Humanoid")
1361 if HitHumanoid and HitHumanoid.Health > 0 and IsEnemy(HitHumanoid) then
1362 local CreatorTag = Instance.new("ObjectValue")
1363 CreatorTag.Value = Player
1364 CreatorTag.Name = "creator"
1365 CreatorTag.Parent = HitHumanoid
1366 MarkHit()
1367 end
1368 end
1369 end
1370 end)
1371 E.Parent = game.Workspace
1372 else
1373 HitHumanoid = Damage(HitObj, HitPos)
1374 end
1375 end
1376 local FinalHitPos = HitPos
1377 if S.Penetration > 0 and (not S.GunType.Explosive) then
1378 FinalHitPos = PenetrateWall(HitPos, Direction, HitHumanoid, OriginPos)
1379 end
1380 if S.BulletTrail and S.TrailTransparency ~= 1 then
1381 local Trail = Instance.new("Part")
1382 Trail.BrickColor = S.TrailColor
1383 Trail.Transparency = S.TrailTransparency
1384 Trail.Anchored = true
1385 Trail.CanCollide = false
1386 Trail.Size = VEC3(1, 1, 1)
1387 local Mesh = Instance.new("BlockMesh")
1388 Mesh.Offset = VEC3(0, 0, -(FinalHitPos - OriginPos).magnitude / 2)
1389 Mesh.Scale = VEC3(S.TrailThickness, S.TrailThickness, (FinalHitPos - OriginPos).magnitude)
1390 Mesh.Parent = Trail
1391 Trail.Parent = Gun_Ignore
1392 Trail.CFrame = CF(OriginPos, FinalHitPos)
1393 delay(S.TrailVisibleTime, function()
1394 if S.TrailDisappearTime > 0 then
1395 local X = 0
1396 while true do
1397 if X == 90 then break end
1398 if (not Selected) then break end
1399 local NewX = X + (1.5 / S.TrailDisappearTime)
1400 X = (NewX > 90 and 90 or NewX)
1401 local Alpha = X / 90
1402 Trail.Transparency = NumLerp(S.TrailTransparency, 1, Alpha)
1403 RS:wait()
1404 end
1405 Trail:Destroy()
1406 else
1407 Trail:Destroy()
1408 end
1409 end)
1410 end
1411 else
1412 local Bullet = CreateBullet(Direction)
1413 local LastPos = Main.CFrame.p
1414 local TotalDistTraveled = 0
1415 local HitHumanoid = nil
1416 spawn(function()
1417 while true do
1418 RS:wait()
1419 if TotalDistTraveled >= S.BulletRange then
1420 Bullet:Destroy()
1421 break
1422 end
1423 local DistTraveled = (Bullet.Position - LastPos).magnitude
1424 local HitObj, HitPos = AdvRayCast(LastPos, (Bullet.Position - LastPos).unit, DistTraveled)
1425 if HitObj then
1426 if S.GunType.Explosive then
1427 if S.ExplosionSound ~= "" then
1428 local Sound = Instance.new("Sound")
1429 Sound.Pitch = S.ExplosionSoundPitch
1430 Sound.SoundId = S.ExplosionSound
1431 Sound.Volume = S.ExplosionSoundVolume
1432 Sound.Parent = Bullet
1433 Sound:Play()
1434 end
1435 CreateBulletHole(HitPos, HitObj)
1436 CreateShockwave(HitPos, S.ExplosionRadius)
1437 local E = Instance.new("Explosion")
1438 E.BlastPressure = S.ExplosionPressure
1439 E.BlastRadius = S.ExplosionRadius
1440 E.DestroyJointRadiusPercent = (S.RangeBasedDamage and 0 or 1)
1441 E.ExplosionType = S.ExplosionType
1442 E.Position = HitPos
1443 E.Hit:connect(function(HObj, HDist)
1444 if HObj.Name == "Torso" and (not HObj:IsDescendantOf(Character)) then
1445 if S.RangeBasedDamage then
1446 local Dir = (HObj.Position - HitPos).unit
1447 local H, P = AdvRayCast(HitPos - Dir, Dir, 999)
1448 local RayHitHuman = H:IsDescendantOf(HObj.Parent)
1449 if (S.RayCastExplosions and RayHitHuman) or (not S.RayCastExplosions) then
1450 local HitHumanoid = FindFirstClass(HObj.Parent, "Humanoid")
1451 if HitHumanoid and HitHumanoid.Health > 0 and IsEnemy(HitHumanoid) then
1452 local DistFactor = HDist / S.ExplosionRadius
1453 local DistInvert = math.max(1 - DistFactor,0)
1454 local NewDamage = DistInvert * S.Damage
1455
1456 local CreatorTag = Instance.new("ObjectValue")
1457 CreatorTag.Value = Player
1458 CreatorTag.Name = "creator"
1459 CreatorTag.Parent = HitHumanoid
1460 HitHumanoid:TakeDamage(NewDamage)
1461 MarkHit()
1462 end
1463 end
1464 else
1465 local HitHumanoid = FindFirstClass(HObj.Parent, "Humanoid")
1466 if HitHumanoid and HitHumanoid.Health > 0 and IsEnemy(HitHumanoid) then
1467 local CreatorTag = Instance.new("ObjectValue")
1468 CreatorTag.Value = Player
1469 CreatorTag.Name = "creator"
1470 CreatorTag.Parent = HitHumanoid
1471 MarkHit()
1472 end
1473 end
1474 end
1475 end)
1476 E.Parent = game.Workspace
1477 else
1478 HitHumanoid = Damage(HitObj, HitPos)
1479 end
1480 if S.Penetration > 0 and (not S.GunType.Explosive) then
1481 PenetrateWall(HitPos, (Bullet.Position - LastPos).unit, HitHumanoid, OriginPos, Bullet)
1482 else
1483 Bullet:Destroy()
1484 end
1485 break
1486 else
1487 LastPos = Bullet.Position
1488 TotalDistTraveled = TotalDistTraveled + DistTraveled
1489 end
1490 end
1491 end)
1492
1493 if S.BulletTrail and S.TrailTransparency ~= 1 then
1494 spawn(function()
1495 local LastPos2 = nil
1496 while true do
1497 if LastPos2 then
1498 if (not Bullet:IsDescendantOf(game)) then break end
1499 Bullet.CFrame = CFrame.new(Bullet.CFrame.p, Bullet.CFrame.p + Bullet.Velocity)
1500 local Trail = Instance.new("Part")
1501 Trail.BrickColor = S.TrailColor
1502 Trail.Transparency = S.TrailTransparency
1503 Trail.Anchored = true
1504 Trail.CanCollide = false
1505 Trail.Size = VEC3(1, 1, 1)
1506 local Mesh = Instance.new("BlockMesh")
1507 Mesh.Offset = VEC3(0, 0, -(Bullet.Position - LastPos2).magnitude / 2)
1508 Mesh.Scale = VEC3(S.TrailThickness, S.TrailThickness, (Bullet.Position - LastPos2).magnitude)
1509 Mesh.Parent = Trail
1510 Trail.Parent = Gun_Ignore
1511 Trail.CFrame = CF(LastPos2, Bullet.Position)
1512 delay(S.TrailVisibleTime, function()
1513 if S.TrailDisappearTime > 0 then
1514 local X = 0
1515 while true do
1516 if X == 90 then break end
1517 if (not Selected) then break end
1518 local NewX = X + (1.5 / S.TrailDisappearTime)
1519 X = (NewX > 90 and 90 or NewX)
1520 local Alpha = X / 90
1521 Trail.Transparency = NumLerp(S.TrailTransparency, 1, Alpha)
1522 RS:wait()
1523 end
1524 Trail:Destroy()
1525 else
1526 Trail:Destroy()
1527 end
1528 end)
1529 LastPos2 = Bullet.Position
1530 else
1531 LastPos2 = Main.CFrame.p
1532 end
1533 RS:wait()
1534 end
1535 end)
1536 end
1537 end
1538 end
1539
1540 ----------------------------------------------------------------------------------
1541
1542 local RecoilX = RAD(CurrentRecoil * RAND(1, 1.5, 0.1)) * StanceSway
1543 local RecoilY = RAD(CurrentRecoil * RAND(-2, 2, 0.1)) * StanceSway
1544 RotCamera(RecoilX, RecoilY, true, 0.06)
1545 delay(0.05, function()
1546 RotCamera(-RecoilX / 5, -RecoilY / 5, true, 0.1)
1547 end)
1548 if Idleing and (not Walking) and (not Aimed) then
1549 local SpreadScale = (CurrentSpread / S.Spread.Max) * 50
1550 Gui_Clone.CrossHair.Box:TweenSizeAndPosition(
1551 UDim2.new(0, 70 + 2 * SpreadScale, 0, 70 + 2 * SpreadScale),
1552 UDim2.new(0, -35 - SpreadScale, 0, -35 - SpreadScale),
1553 "Out", "Linear", 0.1, true
1554 )
1555 end
1556
1557 local KickSide = (
1558 (
1559 {
1560 CurrentRecoil * (RAND(1, 5, 1) / 150);
1561 CurrentRecoil * (RAND(1, 5, 1) / -150)
1562 }
1563 )[math.random(1, 2)]
1564 ) * StanceSway
1565 local KickBack = CurrentRecoil * StanceSway * 0.3
1566 local KickUp = RAD(90 + (CurrentRecoil * RAND(1.3, 1.4, 0.01) * StanceSway))
1567 TweenJoint(AnimWeld, CF(KickSide, 1, -KickBack), CFANG(KickUp - RAD(90), 0, 0), Linear, 1 / 12)
1568
1569 if FlashFX then FlashFX.Enabled = true end
1570 if FlashGui then
1571 FlashGui.Enabled = true
1572 FlashGui.Label.Rotation = RAND(0, 360)
1573 end
1574
1575 delay(1 / 30, function()
1576 if Idleing and (not Walking) and (not Aimed) then
1577 Gui_Clone.CrossHair.Box:TweenSizeAndPosition(
1578 UDim2.new(0, 70, 0, 70),
1579 UDim2.new(0, -35, 0, -35),
1580 "Out", "Linear", S.AimSpeed, (not Aimed)
1581 )
1582 end
1583 if (not Aiming) and (not RunTween) then
1584 TweenJoint(AnimWeld, CF(0, 1, 0), CF(), Linear, 0.15)
1585 end
1586 if FlashFX then FlashFX.Enabled = false end
1587 if FlashGui then FlashGui.Enabled = false end
1588 end)
1589end
1590
1591function MarkHit()
1592 spawn(function()
1593 if Gui_Clone:IsDescendantOf(game) then
1594 Gui_Clone.HitMarker.Visible = true
1595 local StartMark = tick()
1596 LastMark = StartMark
1597 wait(0.5)
1598 if LastMark <= StartMark then
1599 Gui_Clone.HitMarker.Visible = false
1600 end
1601 end
1602 end)
1603end
1604
1605--------------------[ ADS FUNCTIONS ]-------------------------------------------------
1606
1607function AimGun()
1608 if (Camera.CoordinateFrame.p - Camera.Focus.p).magnitude > 1 or Reloading or Knifing or ThrowingGrenade then return end
1609 local Scope = Gui_Clone:WaitForChild("Scope"):WaitForChild("Img")
1610 local Steady = Gui_Clone:WaitForChild("Scope"):WaitForChild("Steady")
1611 Aimed = true
1612 Aiming = true
1613 CurrentRecoil = S.Recoil.Aimed
1614 CurrentSpread = S.Spread.Aimed
1615 Gui_Clone.CrossHair.Box:TweenSizeAndPosition(
1616 UDim2.new(),
1617 UDim2.new(),
1618 Enum.EasingDirection.Out,
1619 Enum.EasingStyle.Sine,
1620 S.AimAnimation and S.AimSpeed or 0,
1621 true
1622 )
1623 if S.AimAnimation then
1624 local CurrentFOV = Camera.FieldOfView
1625 local CurrentCameraOffset = Humanoid.CameraOffset
1626 local CurrentTrans = Scope.BackgroundTransparency
1627 TweenJoint(LWeld, ArmC0[1], S.ArmC1_Aimed.Left, Sine, S.AimSpeed)
1628 TweenJoint(RWeld, ArmC0[2], S.ArmC1_Aimed.Right, Sine, S.AimSpeed)
1629 TweenJoint(AnimWeld, CF(0, 1, 0), CF(), Sine, S.AimSpeed)
1630 TweenJoint(Grip, Grip.C0, Aimed_GripCF, Sine, S.AimSpeed)
1631 TweenJoint(LWeld2, CF(), CF(), Sine, S.AimSpeed)
1632 TweenJoint(RWeld2, CF(), CF(), Sine, S.AimSpeed)
1633 local X = 0
1634 while true do
1635 local NewX = X + 1.5 / S.AimSpeed
1636 X = (NewX > 90 and 90 or NewX)
1637 if (not Aimed) then break end
1638 if (not Selected) then break end
1639 local Alpha = 1 - COS(RAD(X))
1640 Camera.FieldOfView = NumLerp(CurrentFOV, S.MaxZoom, Alpha)
1641 if S.GuiScope then
1642 Scope.BackgroundTransparency = NumLerp(CurrentTrans, 0, Alpha)
1643 end
1644 if X == 90 then break end
1645 RS:wait()
1646 end
1647 else
1648 LWeld.C0, LWeld.C1 = ArmC0[1], S.ArmC1_Aimed.Left
1649 RWeld.C0, RWeld.C1 = ArmC0[2], S.ArmC1_Aimed.Right
1650 AnimWeld.C0 = CF(0, 1, 0)
1651 Grip.C1 = Aimed_GripCF
1652 LWeld2.C1, RWeld2.C1 = CF(), CF()
1653 Camera.FieldOfView = S.MaxZoom
1654 end
1655 Aiming = (not Aimed)
1656 if (not Aiming) and S.GuiScope then
1657 spawn(function()
1658 Steady.Visible = true
1659 Scope.BackgroundTransparency = 1
1660 Scope.ImageTransparency = 0
1661
1662 local Gun_Model = Instance.new("Model")
1663 Gun_Model.Name = "Gun_Model"
1664 for _, Obj in pairs(Gun:GetChildren()) do
1665 if Obj:IsA("BasePart") then
1666 local ObjClone = Obj:Clone()
1667 ObjClone.Parent = Gun_Model
1668
1669 local W = Instance.new("Weld")
1670 W.Part0 = ObjClone
1671 W.Part1 = Obj
1672 W.Parent = ObjClone
1673
1674 local PrevTrans = Instance.new("NumberValue")
1675 PrevTrans.Name = "PrevTrans"
1676 PrevTrans.Value = Obj.Transparency
1677 PrevTrans.Parent = Obj
1678
1679 Obj.Transparency = 1
1680 end
1681 end
1682 Gun_Model.Parent = Character
1683 end)
1684 spawn(function()
1685 while Aimed do
1686 local Ang = (CameraSteady and 0 or (Idleing and AnimAng[2] or AnimAng[4]))
1687 if CameraSway ~= 0 then
1688 local OffsetX, OffsetY = 0, 0
1689 if Idleing then
1690 OffsetX = (RAD(COS(Ang * 5 * (CameraSway ^ 0.4))) / 40) * (CameraSway ^ 1.2) * StanceSway * S.ScopeSway
1691 OffsetY = (RAD(COS(Ang * 2 * (CameraSway ^ 0.4))) / 40) * (CameraSway ^ 1.2) * StanceSway * S.ScopeSway
1692 else
1693 OffsetX = (RAD(COS(Ang * 3/2 * (CameraSway ^ 0.4))) / 25) * (CameraSway ^ 1.2) * StanceSway * S.ScopeSway
1694 OffsetY = (RAD(COS(Ang * 3/5 * (CameraSway ^ 0.4))) / 25) * (CameraSway ^ 1.2) * StanceSway * S.ScopeSway
1695 end
1696 RotCamera(OffsetX, OffsetY)
1697 end
1698 RS:wait()
1699 end
1700 end)
1701 end
1702end
1703
1704function UnAimGun(Exception)
1705 local Scope = Gui_Clone:WaitForChild("Scope"):WaitForChild("Img")
1706 local Steady = Gui_Clone:WaitForChild("Scope"):WaitForChild("Steady")
1707 if (not Exception) then
1708 if (not Aimed) then return end
1709 if (Reloading and Exception) or Knifing and (not ThrowingGrenade) then return end
1710 CurrentRecoil = S.Recoil.Hipfire
1711 CurrentSpread = ((Idleing and (not Walking)) and S.Spread.Hipfire or S.Spread.Walking)
1712 if Walking and Aimed then
1713 Gui_Clone.CrossHair.Box:TweenSizeAndPosition(
1714 UDim2.new(0, 150, 0, 150),
1715 UDim2.new(0, -75, 0, -75),
1716 Enum.EasingDirection.Out,
1717 Enum.EasingStyle.Linear,
1718 S.AimAnimation and S.AimSpeed or 0,
1719 true
1720 )
1721 elseif Idleing then
1722 Gui_Clone.CrossHair.Box:TweenSizeAndPosition(
1723 UDim2.new(0, 70, 0, 70),
1724 UDim2.new(0, -35, 0, -35),
1725 Enum.EasingDirection.Out,
1726 Enum.EasingStyle.Linear,
1727 S.AimAnimation and S.AimSpeed or 0,
1728 true
1729 )
1730 end
1731 Aimed = false
1732 Aiming = true
1733 if S.GuiScope then
1734 spawn(function()
1735 local Gun_Model = Character:FindFirstChild("Gun_Model")
1736 if Gun_Model then
1737 Gun_Model:Destroy()
1738 end
1739
1740 for _, Obj in pairs(Gun:GetChildren()) do
1741 if Obj:IsA("BasePart") then
1742 local PrevTrans = Obj:FindFirstChild("PrevTrans")
1743
1744 Obj.Transparency = PrevTrans.Value
1745 PrevTrans:Destroy()
1746 end
1747 end
1748 end)
1749 end
1750 if S.AimAnimation then
1751 local CurrentFOV = Camera.FieldOfView
1752 local CurrentCameraOffset = Humanoid.CameraOffset
1753 local CurrentTrans = (Scope.BackgroundTransparency == 1 and (S.GuiScope and 0 or 1) or Scope.BackgroundTransparency)
1754 Scope.ImageTransparency = 1
1755 Steady.Visible = false
1756 TweenJoint(LWeld, ArmC0[1], S.ArmC1_UnAimed.Left, Sine, S.AimSpeed)
1757 TweenJoint(RWeld, ArmC0[2], S.ArmC1_UnAimed.Right, Sine, S.AimSpeed)
1758 TweenJoint(Grip, Grip.C0, CFANG(0, RAD(20), 0), Sine, S.AimSpeed)
1759 if S.PlayerAnimations then
1760 TweenJoint(LWeld2, CF(), CFANG(0, RAD(ArmTilt), 0), Sine, S.AimSpeed)
1761 TweenJoint(RWeld2, CF(), CFANG(0, RAD(ArmTilt), 0), Sine, S.AimSpeed)
1762 end
1763 local X = 0
1764 while true do
1765 local NewX = X + 1.5 / S.AimSpeed
1766 X = (NewX > 90 and 90 or NewX)
1767 if Aimed then break end
1768 if (not Selected) then break end
1769 local Alpha = 1 - COS(RAD(X))
1770 Camera.FieldOfView = NumLerp(CurrentFOV, 70, Alpha)
1771 Scope.BackgroundTransparency = NumLerp(CurrentTrans, 1, Alpha)
1772 if X == 90 then break end
1773 RS:wait()
1774 end
1775 else
1776 Scope.BackgroundTransparency = 1
1777 Scope.ImageTransparency = 1
1778 Steady.Visible = false
1779 LWeld.C0, LWeld.C1 = ArmC0[1], S.ArmC1_UnAimed.Left
1780 RWeld.C0, RWeld.C1 = ArmC0[2], S.ArmC1_UnAimed.Right
1781 Grip.C1 = CFANG(0, RAD(20), 0)
1782 LWeld2.C1, RWeld2.C1 = CFANG(0, RAD(ArmTilt), 0), CFANG(0, RAD(ArmTilt), 0)
1783 Camera.FieldOfView = 70
1784 end
1785 Aiming = Aimed
1786 else
1787 if S.GuiScope then
1788 spawn(function()
1789 local Gun_Model = Character:FindFirstChild("Gun_Model")
1790 if Gun_Model then
1791 Gun_Model:Destroy()
1792 end
1793
1794 for _, Obj in pairs(Gun:GetChildren()) do
1795 if Obj:IsA("BasePart") then
1796 local PrevTrans = Obj:FindFirstChild("PrevTrans")
1797
1798 Obj.Transparency = PrevTrans.Value
1799 PrevTrans:Destroy()
1800 end
1801 end
1802 end)
1803 end
1804 spawn(function()
1805 Aimed = false
1806 Aiming = false
1807 CurrentRecoil = S.Recoil.Hipfire
1808 CurrentSpread = ((Idleing and (not Walking)) and S.Spread.Hipfire or S.Spread.Walking)
1809 if (not Walking) then
1810 Gui_Clone.CrossHair.Box:TweenSizeAndPosition(
1811 UDim2.new(0, 70, 0, 70),
1812 UDim2.new(0, -35, 0, -35),
1813 Enum.EasingDirection.Out,
1814 Enum.EasingStyle.Linear,
1815 S.AimAnimation and S.AimSpeed or 0,
1816 true
1817 )
1818 else
1819 Gui_Clone.CrossHair.Box:TweenSizeAndPosition(
1820 UDim2.new(0, 150, 0, 150),
1821 UDim2.new(0, -75, 0, -75),
1822 Enum.EasingDirection.Out,
1823 Enum.EasingStyle.Linear,
1824 S.AimAnimation and S.AimSpeed or 0,
1825 true
1826 )
1827 end
1828 local CurrentFOV = Camera.FieldOfView
1829 local CurrentCameraOffset = Humanoid.CameraOffset
1830 local CurrentTrans = (Scope.BackgroundTransparency == 1 and (S.GuiScope and 0 or 1) or Scope.BackgroundTransparency)
1831 Scope.ImageTransparency = 1
1832 Steady.Visible = false
1833 if LWeld:FindFirstChild("TweenCode") then LWeld.TweenCode:Destroy() end
1834 if RWeld:FindFirstChild("TweenCode") then RWeld.TweenCode:Destroy() end
1835 if Grip:FindFirstChild("TweenCode") then Grip.TweenCode:Destroy() end
1836 if LWeld2:FindFirstChild("TweenCode") then LWeld2.TweenCode:Destroy() end
1837 if RWeld2:FindFirstChild("TweenCode") then RWeld2.TweenCode:Destroy() end
1838 if S.AimAnimation then
1839 local X = 0
1840 while true do
1841 local NewX = X + 1.5 / S.AimSpeed
1842 X = (NewX > 90 and 90 or NewX)
1843 if Aimed then break end
1844 if (not Selected) then break end
1845 local Alpha = 1 - COS(RAD(X))
1846 Camera.FieldOfView = NumLerp(CurrentFOV, 70, Alpha)
1847 Scope.BackgroundTransparency = NumLerp(CurrentTrans, 1, Alpha)
1848 if X == 90 then break end
1849 RS:wait()
1850 end
1851 else
1852 Scope.BackgroundTransparency = 1
1853 Scope.ImageTransparency = 1
1854 Steady.Visible = false
1855 Camera.FieldOfView = 70
1856 end
1857 end)
1858 end
1859end
1860
1861--------------------[ TEXTURE CREATION FUNCTIONS ]------------------------------------
1862
1863function CreateBullet(Direction)
1864 local Origin = Gun.Main.CFrame.p
1865 local BulletMass = S.BulletSize.X * S.BulletSize.Y * S.BulletSize.Z
1866 local BulletCF = CF(Origin, Origin + Direction)
1867 local Bullet = Instance.new("Part")
1868 Bullet.BrickColor = S.BulletColor
1869 Bullet.Name = "Bullet"
1870 Bullet.CanCollide = false
1871 Bullet.FormFactor = "Custom"
1872 Bullet.Size = S.BulletSize
1873 Bullet.BottomSurface = "Smooth"
1874 Bullet.TopSurface = "Smooth"
1875 local Mesh = Instance.new("BlockMesh")
1876 Mesh.Scale = S.BulletMeshSize
1877 Mesh.Parent = Bullet
1878 local BF = Instance.new("BodyForce")
1879 BF.force = VEC3(0, BulletMass * (196.2 - S.BulletDropPerSecond), 0)
1880 BF.Parent = Bullet
1881 Bullet.Parent = Gun_Ignore
1882 Bullet.CFrame = BulletCF + Direction * 3
1883 Bullet.Velocity = Direction * S.BulletVelocity
1884 return Bullet
1885end
1886
1887function CreateBulletHole(HitPos, HitObj)
1888 local SurfaceCF = GetHitSurfaceCFrame(HitPos, HitObj)
1889 local SurfaceDir = CF(HitObj.CFrame.p, SurfaceCF.p)
1890 local SurfaceDist = SurfaceDir.lookVector * (HitObj.CFrame.p - SurfaceCF.p).magnitude / 2
1891 local SurfaceOffset = HitPos - SurfaceCF.p + SurfaceDist
1892 local SurfaceCFrame = SurfaceDir + SurfaceDist + SurfaceOffset
1893 local HitMark = Instance.new("Part")
1894 HitMark.BrickColor = BrickColor.new("Black")
1895 HitMark.Transparency = 1
1896 HitMark.Anchored = true
1897 HitMark.CanCollide = false
1898 HitMark.FormFactor = "Custom"
1899 HitMark.Size = VEC3(1, 1, 0.2)
1900 HitMark.TopSurface = 0
1901 HitMark.BottomSurface = 0
1902 local Mesh = Instance.new("BlockMesh")
1903 Mesh.Offset = VEC3(0, 0, -0.05)
1904 Mesh.Scale = VEC3(S.BulletHoleSize, S.BulletHoleSize, 0)
1905 Mesh.Parent = HitMark
1906 local Decal = Instance.new("Decal")
1907 Decal.Face = Enum.NormalId.Front
1908 Decal.Texture = S.BulletHoleTexture
1909 Decal.Parent = HitMark
1910 HitMark.Parent = Gun_Ignore
1911 HitMark.CFrame = SurfaceCFrame
1912 if (not HitObj.Anchored) then
1913 local Weld = Instance.new("Weld", HitMark)
1914 Weld.Part0 = HitObj
1915 Weld.Part1 = HitMark
1916 Weld.C0 = HitObj.CFrame:toObjectSpace(SurfaceCFrame)
1917 HitMark.Anchored = false
1918 end
1919 delay(S.BulletHoleVisibleTime, function()
1920 if S.BulletHoleDisappearTime > 0 then
1921 local X = 0
1922 while true do
1923 if X == 90 then break end
1924 if (not Selected) then break end
1925 local NewX = X + (1.5 / S.BulletHoleDisappearTime)
1926 X = (NewX > 90 and 90 or NewX)
1927 local Alpha = X / 90
1928 Decal.Transparency = NumLerp(0, 1, Alpha)
1929 RS:wait()
1930 end
1931 HitMark:Destroy()
1932 else
1933 HitMark:Destroy()
1934 end
1935 end)
1936end
1937
1938function CreateShockwave(Center, Radius)
1939 local Shockwave = Instance.new("Part")
1940 Shockwave.BrickColor = S.ShockwaveColor
1941 Shockwave.Material = Enum.Material.SmoothPlastic
1942 Shockwave.Name = "Shockwave"
1943 Shockwave.Anchored = true
1944 Shockwave.CanCollide = false
1945 Shockwave.FormFactor = Enum.FormFactor.Symmetric
1946 Shockwave.Size = VEC3(1, 1, 1)
1947 Shockwave.BottomSurface = Enum.SurfaceType.Smooth
1948 Shockwave.TopSurface = Enum.SurfaceType.Smooth
1949 local Mesh = Instance.new("SpecialMesh")
1950 Mesh.MeshType = Enum.MeshType.Sphere
1951 Mesh.Scale = VEC3()
1952 Mesh.Parent = Shockwave
1953 Shockwave.Parent = Gun_Ignore
1954 Shockwave.CFrame = CF(Center)
1955 spawn(function()
1956 for i = 0, 1, (1 / (60 * S.ShockwaveDuration)) do
1957 local Scale = 2 * Radius * i
1958 Mesh.Scale = VEC3(Scale, Scale, Scale)
1959 Shockwave.Transparency = i
1960 RS:wait()
1961 end
1962 Shockwave:Destroy()
1963 end)
1964end
1965
1966--------------------[ HIT HANDLING FUNCTIONS ]----------------------------------------
1967
1968function Damage(HitObj, HitPos)
1969 local HeadVal = S.Multipliers.Head
1970 local ChestVal = S.Multipliers.Chest
1971 local LimbsVal = S.Multipliers.Limbs
1972 if Humanoid.Health ~= 0 then
1973 if HitObj and HitObj.Parent then
1974 local HumanoidFound = false
1975 local HitHumanoid = nil
1976 if HitObj.Parent.ClassName == "Hat" then
1977 if FindFirstClass(HitObj.Parent.Parent, "Humanoid") then
1978 HitHumanoid = FindFirstClass(HitObj.Parent.Parent, "Humanoid")
1979 HumanoidFound = true
1980 if HitHumanoid.Health > 0 then
1981 if IsEnemy(HitHumanoid) then
1982 local CreatorTag = Instance.new("ObjectValue")
1983 CreatorTag.Value = Player
1984 CreatorTag.Name = "creator"
1985 CreatorTag.Parent = HitHumanoid
1986 HitHumanoid:TakeDamage(S.Damage * RAND(HeadVal, HeadVal + 0.1, 0.01))
1987 MarkHit()
1988 end
1989 end
1990 end
1991 else
1992 if FindFirstClass(HitObj.Parent, "Humanoid") then
1993 HitHumanoid = FindFirstClass(HitObj.Parent, "Humanoid")
1994 HumanoidFound = true
1995 if HitHumanoid.Health > 0 then
1996 if IsEnemy(HitHumanoid) then
1997 local CreatorTag = Instance.new("ObjectValue")
1998 CreatorTag.Value = Player
1999 CreatorTag.Name = "creator"
2000 CreatorTag.Parent = HitHumanoid
2001 local ChosenDamage = 0
2002 if HitObj.Name == "Head" then
2003 ChosenDamage = S.Damage * RAND(HeadVal, HeadVal + 0.1, 0.01)
2004 elseif HitObj.Name == "Torso" then
2005 ChosenDamage = S.Damage * RAND(ChestVal, ChestVal + 0.1, 0.01)
2006 else
2007 ChosenDamage = S.Damage * RAND(LimbsVal, LimbsVal + 0.1, 0.01)
2008 end
2009 HitHumanoid:TakeDamage(ChosenDamage)
2010 MarkHit()
2011 end
2012 end
2013 end
2014 end
2015 if (not HumanoidFound) then
2016 if S.BulletHoles then
2017 CreateBulletHole(HitPos, HitObj)
2018 end
2019 if S.Shockwaves then
2020 CreateShockwave(HitPos, S.ShockwaveRadius)
2021 end
2022 end
2023 return HitHumanoid
2024 end
2025 end
2026end
2027
2028function PenetrateWall(HitPos, Direction, HitHumanoid, OriginPos, Bullet)
2029 local HitDist = (HitPos - OriginPos).magnitude
2030 local Thickness, Wall, WallHitPos = 0, nil, nil
2031 for i = 0.1, S.Penetration, 0.1 do
2032 local WallRay = Ray.new(HitPos + (Direction * i), -Direction)
2033 local TempWall, TempWallHitPos = game.Workspace:FindPartOnRayWithIgnoreList(WallRay, Ignore)
2034 if TempWall then
2035 Thickness = i
2036 Wall, WallHitPos = TempWall, TempWallHitPos
2037 break
2038 end
2039 end
2040 if Wall then
2041 CreateBulletHole(WallHitPos, Wall)
2042 if S.InstantHit then
2043 local HitObj2, HitPos2 = nil, nil
2044 if HitHumanoid then
2045 HitObj2, HitPos2 = AdvRayCast(WallHitPos, Direction, S.BulletRange - HitDist, {HitHumanoid.Parent,unpack(Ignore)})
2046 else
2047 HitObj2, HitPos2 = AdvRayCast(WallHitPos, Direction, S.BulletRange - HitDist)
2048 end
2049 Damage(HitObj2, HitPos2)
2050 return HitPos2
2051 else
2052 local LastPos = WallHitPos
2053 local TotalDistTraveled = 0
2054 spawn(function()
2055 while true do
2056 RS:wait()
2057 if TotalDistTraveled >= S.BulletRange - HitDist then
2058 Bullet:Destroy()
2059 break
2060 end
2061 local DistTraveled = (Bullet.Position - LastPos).magnitude
2062 local NewDirection = (Bullet.Position - LastPos).unit
2063 local TempHitObj, TempHitPos = nil, nil
2064 if HitHumanoid then
2065 TempHitObj, TempHitPos = AdvRayCast(LastPos, NewDirection, DistTraveled, {HitHumanoid.Parent,unpack(Ignore)})
2066 else
2067 TempHitObj, TempHitPos = AdvRayCast(LastPos, NewDirection, DistTraveled)
2068 end
2069 if TempHitObj then
2070 Damage(TempHitObj, TempHitPos)
2071 Bullet:Destroy()
2072 return TempHitPos
2073 else
2074 LastPos = Bullet.Position
2075 TotalDistTraveled = TotalDistTraveled + DistTraveled
2076 end
2077 end
2078 end)
2079 end
2080 else
2081 if Bullet then Bullet:Destroy() end
2082 return HitPos
2083 end
2084end
2085
2086function IsEnemy(Human)
2087 local Plyr = game.Players:GetPlayerFromCharacter(Human.Parent)
2088 if (not Plyr) then return S.CanDamageNPCs end
2089 return S.AllowFriendlyFire or (Plyr.TeamColor ~= Player.TeamColor or Plyr.Neutral)
2090end
2091
2092--------------------[ RELOAD FUNCTIONS ]----------------------------------------------
2093
2094function ReloadAnim()
2095 TweenJoint(LWeld2, CF(), CF(), Sine, 0.15)
2096 TweenJoint(RWeld2, CF(), CF(), Sine, 0.15)
2097 local Speed = S.ReloadTime / 2
2098 local Mag_Parts = {}
2099
2100 for _, Obj in pairs(Gun:GetChildren()) do
2101 if Obj.Name == "Mag" and Obj:IsA("BasePart") then
2102 INSERT(Mag_Parts, {Original = Obj, Clone1 = Obj:Clone(), Clone2 = Obj:Clone()})
2103 end
2104 end
2105
2106 local W1 = nil
2107 local W2 = nil
2108
2109 local SequenceTable = {
2110
2111 function()
2112
2113 for Index, Mag in pairs(Mag_Parts) do
2114 Mag.Original.Transparency = 1
2115 Mag.Clone1.Parent = Gun_Ignore
2116 Mag.Clone1.CanCollide = true
2117
2118 if Index ~= 1 then
2119 local W = Instance.new("Weld")
2120 W.Part0 = Mag_Parts[1].Clone1
2121 W.Part1 = Mag.Clone1
2122 W.C0 = Mag_Parts[1].Clone1.CFrame:toObjectSpace(Mag.Clone1.CFrame)
2123 W.Parent = Mag_Parts[1].Clone1
2124 end
2125 end
2126
2127 W1 = Instance.new("Weld")
2128 W1.Part0 = Mag_Parts[1].Clone1
2129 W1.Part1 = Handle
2130 W1.C0 = Mag_Parts[1].Original.CFrame:toObjectSpace(Handle.CFrame)
2131 W1.Parent = Mag_Parts[1].Clone1
2132
2133 TweenJoint(LWeld, ArmC0[1], CF(0, 0.61, 0) * CFANG(RAD(70), 0, 0), Linear, 0.5 * Speed)
2134 TweenJoint(RWeld, ArmC0[2], CF(0.4, 0.09, -0.21) * CFANG(RAD(-20), RAD(3), 0), Linear, 0.5 * Speed)
2135 TweenJoint(Grip, Grip.C0, CFANG(0, RAD(10), 0), Linear, 0.5 * Speed)
2136 wait(0.5 * Speed)
2137
2138 end;
2139
2140 function()
2141
2142 TweenJoint(RWeld, ArmC0[2], CF(0.4, -0.01, -0.31) * CFANG(RAD(-22), RAD(3), 0), Sine, 0.3 * Speed)
2143 wait(0.2 * Speed)
2144
2145 end;
2146
2147 function()
2148
2149 W1:Destroy()
2150 Mag_Parts[1].Clone1.Velocity = Handle.Velocity + Handle.CFrame:vectorToWorldSpace(VEC3(0,-1,0)) * 20
2151 spawn(function()
2152 while Mag_Parts[1].Clone1.Velocity.magnitude > 0.1 do wait() end
2153 for _, Mag in pairs(Mag_Parts) do
2154 Mag.Clone1.Anchored = true
2155 Mag.Clone1:BreakJoints()
2156 end
2157 end)
2158
2159 for Index, Mag in pairs(Mag_Parts) do
2160 Mag.Clone2.Parent = Gun_Ignore
2161
2162 if Index ~= 1 then
2163 local W = Instance.new("Weld")
2164 W.Part0 = Mag_Parts[1].Clone2
2165 W.Part1 = Mag.Clone2
2166 W.C0 = Mag_Parts[1].Clone2.CFrame:toObjectSpace(Mag.Clone2.CFrame)
2167 W.Parent = Mag_Parts[1].Clone2
2168 end
2169 end
2170
2171 W2 = Instance.new("Weld")
2172 W2.Part0 = FakeLArm
2173 W2.Part1 = Mag_Parts[1].Clone2
2174 W2.C0 = CF(0, -1, 0) * CFANG(RAD(-90), 0, 0)
2175 W2.Parent = FakeLArm
2176 wait(0.1)
2177
2178 end;
2179
2180 function()
2181
2182 local FakeLArmCF = LWeld.Part0.CFrame * ArmC0[1] * (CF(0.3, 1.85, -0.31) * CFANG(RAD(-20), RAD(30), RAD(-60))):inverse()
2183 local FakeRArmCF = RWeld.Part0.CFrame * ArmC0[2] * (CF(0.4, -0.1, -0.21) * CFANG(RAD(-20), RAD(5), RAD(10))):inverse()
2184 local HandleCF = FakeRArm.CFrame:toObjectSpace(Grip.Part0.CFrame * Grip.C0)
2185 local Mag_Original_CF = Handle.CFrame:toObjectSpace(Mag_Parts[1].Original.CFrame)
2186 local MagC0 = FakeLArmCF:toObjectSpace(FakeRArmCF * HandleCF * Mag_Original_CF)
2187
2188 TweenJoint(LWeld, ArmC0[1], CF(0.3, 1.85, -0.31) * CFANG(RAD(-20), RAD(30), RAD(-60)), Sine, 0.6 * Speed)
2189 TweenJoint(RWeld, ArmC0[2], CF(0.4, -0.1, -0.21) * CFANG(RAD(-20), RAD(5), RAD(10)), Sine, 0.6 * Speed)
2190 TweenJoint(Grip, Grip.C0, CF(), Sine, 0.6 * Speed)
2191 TweenJoint(W2, MagC0, CF(), Sine, 0.6 * Speed)
2192 wait(0.7 * Speed)
2193
2194 end;
2195
2196 function()
2197
2198 for _, Mag in pairs(Mag_Parts) do
2199 Mag.Original.Transparency = 0
2200 Mag.Clone2:Destroy()
2201 end
2202
2203 TweenJoint(LWeld, ArmC0[1], S.ArmC1_UnAimed.Left, Sine, 0.5 * Speed)
2204 TweenJoint(RWeld, ArmC0[2], S.ArmC1_UnAimed.Right, Sine, 0.5 * Speed)
2205 TweenJoint(Grip, Grip.C0, CFANG(0, RAD(20), 0), Sine, 0.5 * Speed)
2206 wait(0.5 * Speed)
2207
2208 end;
2209
2210 }
2211
2212 for _,ReloadFunction in pairs(SequenceTable) do
2213 if BreakReload then
2214 break
2215 end
2216 ReloadFunction()
2217 end
2218
2219 if W1 then W1:Destroy() end
2220 if W2 then W2:Destroy() end
2221 for _, Mag in pairs(Mag_Parts) do
2222 Mag.Clone1:Destroy()
2223 Mag.Clone2:Destroy()
2224 end
2225end
2226
2227function Reload()
2228 Running = false
2229 if Ammo.Value < ClipSize.Value and (not Reloading) and StoredAmmo.Value > 0 then
2230 AmmoInClip = (AmmoInClip == 0 and Ammo.Value or AmmoInClip)
2231 Ammo.Value = 0
2232 Reloading = true
2233 if Aimed then UnAimGun(S.ReloadAnimation) end
2234 Gui_Clone.CrossHair.Reload.Visible = true
2235 if Handle:FindFirstChild("ReloadSound") then Handle.ReloadSound:Play() end
2236 if S.ReloadAnimation then
2237 wait()
2238 ReloadAnim()
2239 else
2240 local StartReload = tick()
2241 while true do
2242 if BreakReload then break end
2243 if (tick() - StartReload) >= S.ReloadTime then break end
2244 RS:wait()
2245 end
2246 end
2247 if (not BreakReload) then
2248 if StoredAmmo.Value >= ClipSize.Value then
2249 Ammo.Value = ClipSize.Value
2250 if AmmoInClip > 0 then
2251 StoredAmmo.Value = StoredAmmo.Value - (ClipSize.Value - AmmoInClip)
2252 else
2253 StoredAmmo.Value = StoredAmmo.Value - ClipSize.Value
2254 end
2255 elseif StoredAmmo.Value < ClipSize.Value and StoredAmmo.Value > 0 then
2256 Ammo.Value = StoredAmmo.Value
2257 StoredAmmo.Value = 0
2258 end
2259 end
2260 BreakReload = false
2261 Reloading = false
2262 if Selected then
2263 AmmoInClip = 0
2264 Gui_Clone.CrossHair.Reload.Visible = false
2265 end
2266 end
2267end
2268
2269--------------------[ EXTERNAL DATA LOCATING FUNCTIONS ]-----------------------------
2270
2271function FindFirstClass(Object, Class)
2272 local FoundObject = nil
2273 for _, Obj in pairs(Object:GetChildren()) do
2274 if Obj.ClassName == Class then
2275 FoundObject = Obj
2276 break
2277 end
2278 end
2279 return FoundObject
2280end
2281
2282function IsIgnored(Obj)
2283 for _,v in pairs(Ignore) do
2284 if Obj == v or Obj:IsDescendantOf(v) then
2285 return true
2286 end
2287 end
2288 return false
2289end
2290
2291function GetHitSurfaceCFrame(HitPos,Obj)
2292 local SurfaceCF = {
2293 {"Back",Obj.CFrame * CF(0,0,Obj.Size.z)};
2294 {"Bottom",Obj.CFrame * CF(0,-Obj.Size.y,0)};
2295 {"Front",Obj.CFrame * CF(0,0,-Obj.Size.z)};
2296 {"Left",Obj.CFrame * CF(-Obj.Size.x,0,0)};
2297 {"Right",Obj.CFrame * CF(Obj.Size.x,0,0)};
2298 {"Top",Obj.CFrame * CF(0,Obj.Size.y,0)}
2299 }
2300 local ClosestDist = HUGE
2301 local ClosestSurface = nil
2302 for _,v in pairs(SurfaceCF) do
2303 local SurfaceDist = (HitPos - v[2].p).magnitude
2304 if SurfaceDist < ClosestDist then
2305 ClosestDist = SurfaceDist
2306 ClosestSurface = v
2307 end
2308 end
2309 return ClosestSurface[2]
2310end
2311
2312function AdvRayCast(Origin, Direction, Dist, CustomIgnore)
2313 local NewIgnore = (CustomIgnore and CustomIgnore or Ignore)
2314 local NewRay = Ray.new(Origin, Direction * (Dist > 999 and 999 or Dist))
2315 local HitObj, HitPos = game.Workspace:FindPartOnRayWithIgnoreList(NewRay, NewIgnore)
2316 local LastPos = HitPos
2317 local FinalHitObj, FinalHitPos = nil, nil
2318 local RepTimes = math.floor(Dist / 999)
2319 if (not HitObj) and (Dist > 999) then
2320 for i = 0, RepTimes do
2321 local NewDist = (i == RepTimes and (Dist - (LastPos - Origin).magnitude) or 999)
2322 local Ray2 = Ray.new(LastPos, Direction * NewDist)
2323 local HitObj2, HitPos2 = game.Workspace:FindPartOnRayWithIgnoreList(Ray2, NewIgnore)
2324 if i ~= RepTimes then
2325 if HitObj2 then
2326 FinalHitObj, FinalHitPos = HitObj2, HitPos2
2327 break
2328 end
2329 elseif i == RepTimes then
2330 FinalHitObj, FinalHitPos = HitObj2, HitPos2
2331 end
2332 LastPos = HitPos2
2333 end
2334 return FinalHitObj, FinalHitPos
2335 elseif HitObj or (Dist <= 999) then
2336 return HitObj, HitPos
2337 end
2338end
2339
2340--------------------[ KNIFING FUNCTION ]----------------------------------------------
2341
2342function KnifeAnim()
2343 local Connection = nil
2344 local Blade = Instance.new("Part")
2345 Blade.BrickColor = BrickColor.new("Really black")
2346 Blade.Name = "Blade"
2347 Blade.CanCollide = false
2348 Blade.FormFactor = Enum.FormFactor.Custom
2349 Blade.Size = VEC3(0.5, 2.5, 1)
2350 local Mesh = Instance.new("SpecialMesh")
2351 Mesh.MeshId = S.KnifeMeshId
2352 Mesh.MeshType = Enum.MeshType.FileMesh
2353 Mesh.Scale = VEC3(0.7, 0.7, 0.7)
2354 Mesh.TextureId = S.KnifeTextureId
2355 Mesh.Parent = Blade
2356 Blade.Parent = Gun_Ignore
2357 local BladeWeld = Instance.new("Weld")
2358 BladeWeld.Part0 = Blade
2359 BladeWeld.Part1 = FakeLArm
2360 BladeWeld.C0 = CFANG(RAD(-90), 0, RAD(180))
2361 BladeWeld.C1 = CF(0, -1, 0.75)
2362 BladeWeld.Parent = Blade
2363 Connection = Blade.Touched:connect(function(Obj)
2364 if Obj then
2365 local HitHumanoid = FindFirstClass(Obj.Parent, "Humanoid")
2366 if HitHumanoid and IsEnemy(HitHumanoid) then
2367 local CreatorTag = Instance.new("ObjectValue")
2368 CreatorTag.Name = "creator"
2369 CreatorTag.Value = Player
2370 CreatorTag.Parent = HitHumanoid
2371 HitHumanoid:TakeDamage(HitHumanoid.MaxHealth)
2372 MarkHit()
2373 end
2374 end
2375 end)
2376 TweenJoint(LWeld2, CF(), CFANG(0, RAD(90), 0), Linear, 0.05)
2377 TweenJoint(LWeld, ArmC0[1], CF(-0.1, 0.2, -0.1) * CFANG(0, 0, RAD(-20)), Linear, 0.05)
2378 TweenJoint(RWeld, ArmC0[2], CFANG(RAD(-30), 0, 0), Linear, 0.1)
2379 TweenJoint(Grip, Grip.C0, CF(), Linear, 0.1)
2380 spawn(function()
2381 local Force = HRP.CFrame.lookVector * 8e4
2382 local BF = Instance.new("BodyForce")
2383 BF.force = Force
2384 BF.Parent = HRP
2385 delay(0.03, function()
2386 BF.force = -Force / 2
2387 wait(0.03)
2388 BF:Destroy()
2389 end)
2390 end)
2391 wait(0.05)
2392 RotCamera(RAD(6), 0, true, 0.1)
2393 delay(0.1, function()
2394 RotCamera(RAD(-2), 0, true, 0.05)
2395 end)
2396 TweenJoint(LWeld, ArmC0[1], CF(0.8, 1.7, 0.2) * CFANG(0, 0, RAD(-80)), Linear, 0.06)
2397 wait(0.2)
2398 Connection:disconnect()
2399 wait(0.2)
2400 TweenJoint(LWeld2, CF(), CF(), Linear, 0.15)
2401 TweenJoint(LWeld, ArmC0[1], S.ArmC1_UnAimed.Left, Linear, 0.15)
2402 TweenJoint(RWeld, ArmC0[2], S.ArmC1_UnAimed.Right, Linear, 0.15)
2403 Blade:Destroy()
2404end
2405
2406--------------------[ GRENADE FUNCTIONS ]---------------------------------------------
2407
2408function CreateGrenade()
2409 local Grenade = Instance.new("Model")
2410
2411 local Center = Instance.new("Part")
2412 Center.BrickColor = S.GrenadeColor
2413 Center.Name = "Center"
2414 Center.CanCollide = false
2415 Center.Elasticity = 0
2416 Center.FormFactor = Enum.FormFactor.Custom
2417 Center.Size = S.GrenadeSize
2418 Center.BottomSurface = Enum.SurfaceType.Smooth
2419 Center.TopSurface = Enum.SurfaceType.Smooth
2420 Center.Parent = Grenade
2421
2422 local Mesh1 = Instance.new("SpecialMesh")
2423 Mesh1.MeshType = Enum.MeshType.Sphere
2424 Mesh1.Parent = Center
2425
2426 return Grenade
2427end
2428
2429function CreateKnife()
2430 local Knife = Instance.new("Part")
2431 Knife.BrickColor = S.GrenadeColor
2432 Knife.Name = "Knife"
2433 Knife.CanCollide = false
2434 Knife.FormFactor = Enum.FormFactor.Custom
2435 Knife.Size = VEC3(1, 1, 3)
2436
2437 local Mesh = Instance.new("SpecialMesh")
2438 Mesh.MeshId = "http://www.roblox.com/asset/?id=12221720"
2439 Mesh.MeshType = Enum.MeshType.FileMesh
2440 Mesh.Scale = VEC3(0.5, 0.5, 0.5)
2441 Mesh.Parent = Knife
2442
2443 return Knife
2444end
2445
2446function CreateTarget()
2447 local Target = Instance.new("Model")
2448
2449 local Center = Instance.new("Part")
2450 Center.BrickColor = BrickColor.new("Bright red")
2451 Center.Material = Enum.Material.SmoothPlastic
2452 Center.Transparency = 0.3
2453 Center.Name = "Center"
2454 Center.Anchored = true
2455 Center.CanCollide = false
2456 Center.FormFactor = Enum.FormFactor.Custom
2457 Center.Size = VEC3(4, 0.2, 4)
2458 Center.Parent = Target
2459 local CylinderMesh = Instance.new("CylinderMesh")
2460 CylinderMesh.Parent = Center
2461
2462 local Line = Instance.new("Part")
2463 Line.BrickColor = BrickColor.new("Bright red")
2464 Line.Transparency = 0.3
2465 Line.Name = "Line"
2466 Line.CFrame = Center.CFrame * CFrame.new(0, 5.1, 0)
2467 Line.Anchored = true
2468 Line.CanCollide = false
2469 Line.FormFactor = Enum.FormFactor.Custom
2470 Line.Size = VEC3(0.4, 10, 0.4)
2471 Line.BottomSurface = Enum.SurfaceType.Smooth
2472 Line.TopSurface = Enum.SurfaceType.Smooth
2473 Line.Parent = Target
2474
2475 return Target
2476end
2477
2478function DetonateExplosive(Grenade)
2479 CreateShockwave(Grenade.Position, S.GrenadeBlastRadius)
2480 local GrenadePos = Grenade.Position
2481 local E = Instance.new("Explosion")
2482 E.BlastPressure = S.GrenadeBlastPressure
2483 E.BlastRadius = S.GrenadeBlastRadius
2484 E.DestroyJointRadiusPercent = (S.GrenadeRangeBasedDamage and 0 or 1)
2485 E.ExplosionType = S.GrenadeExplosionType
2486 E.Position = GrenadePos
2487 E.Hit:connect(function(HObj, HDist)
2488 if HObj.Name == "Torso" and (not HObj:IsDescendantOf(Character)) then
2489 if S.GrenadeRangeBasedDamage then
2490 local ClosestPart = nil
2491 local ClosestDist = math.huge
2492
2493 for _, P in pairs(HObj.Parent:GetChildren()) do
2494 if P:IsA("BasePart") then
2495 local Dist = (GrenadePos - P.Position).magnitude
2496 if Dist < ClosestDist then
2497 ClosestPart = P
2498 ClosestDist = Dist
2499 end
2500 end
2501 end
2502
2503 local Dir = (ClosestPart.Position - GrenadePos).unit
2504 local H, P = AdvRayCast(GrenadePos, Dir, 999)
2505 local RayHitHuman = H:IsDescendantOf(HObj.Parent)
2506 if (S.GrenadeRayCastExplosions and RayHitHuman) or (not S.GrenadeRayCastExplosions) then
2507 local HitHumanoid = FindFirstClass(HObj.Parent, "Humanoid")
2508 if HitHumanoid and HitHumanoid.Health > 0 and IsEnemy(HitHumanoid) then
2509 local DistFactor = ClosestDist / S.GrenadeBlastRadius
2510 local DistInvert = math.max(1 - DistFactor,0)
2511 local NewDamage = DistInvert * S.LethalGrenadeDamage
2512
2513 local CreatorTag = Instance.new("ObjectValue")
2514 CreatorTag.Value = Player
2515 CreatorTag.Name = "creator"
2516 CreatorTag.Parent = HitHumanoid
2517 HitHumanoid:TakeDamage(NewDamage)
2518 MarkHit()
2519 end
2520 end
2521 else
2522 local HitHumanoid = FindFirstClass(HObj.Parent, "Humanoid")
2523 if HitHumanoid and HitHumanoid.Health > 0 and IsEnemy(HitHumanoid) then
2524 local CreatorTag = Instance.new("ObjectValue")
2525 CreatorTag.Value = Player
2526 CreatorTag.Name = "creator"
2527 CreatorTag.Parent = HitHumanoid
2528 MarkHit()
2529 end
2530 end
2531 end
2532 end)
2533 E.Parent = game.Workspace
2534
2535 wait()
2536
2537 Grenade.Parent:Destroy()
2538end
2539
2540function DetonateSmoke(Grenade)
2541 CreateShockwave(Grenade.Position, S.GrenadeEffectRadius)
2542 local GrenadePos = Grenade.Position
2543
2544 spawn(function()
2545 for i = 1, math.floor(S.GrenadeEffectRadius / 5) + RAND(5, 10) do
2546 local Size = RAND(S.GrenadeEffectRadius * 0.6, S.GrenadeEffectRadius * 0.8)
2547 local Dist = RAND(0, S.GrenadeEffectRadius - Size)
2548 local XRot, YRot = RAD(RAND(0, 180, 10)), RAD(RAND(0, 360, 10))
2549 local RotLV = (CFANG(0, YRot, 0) * CFANG(XRot, 0, 0)).lookVector
2550 local Pos = GrenadePos + (RotLV * VEC3(Dist, Dist / 2, Dist))
2551
2552 local Smoke = Instance.new("Part")
2553 Smoke.Transparency = 1
2554 Smoke.Name = "Smoke"
2555 Smoke.Anchored = true
2556 Smoke.CanCollide = false
2557 Smoke.FormFactor = Enum.FormFactor.Symmetric
2558 Smoke.Size = VEC3(1, 1, 1)
2559 Smoke.TopSurface = Enum.SurfaceType.Smooth
2560 Smoke.BottomSurface = Enum.SurfaceType.Smooth
2561
2562 local Mesh = Instance.new("SpecialMesh")
2563 Mesh.MeshType = Enum.MeshType.Sphere
2564 Mesh.Scale = VEC3(Size, Size, Size)
2565 Mesh.Parent = Smoke
2566
2567 Smoke.Parent = Gun_Ignore
2568 Smoke.CFrame = CF(Pos)
2569
2570 spawn(function()
2571 local Trans = RAND(0.3, 0.5, 0.01)
2572 for X = 0, 90, 2 do
2573 Smoke.CFrame = CF(GrenadePos:lerp(Pos, Sine(X)))
2574 Smoke.Transparency = NumLerp(1, Trans, Sine(X))
2575 RS:wait()
2576 end
2577
2578 wait(S.GrenadeEffectTime)
2579
2580 for X = 0, 90, 0.5 do
2581 Smoke.CFrame = CF(Pos:lerp(Pos + VEC3(0, 20, 0), 1 - COS(RAD(X))))
2582 Smoke.Transparency = NumLerp(Trans, 1, Sine(X))
2583 RS:wait()
2584 end
2585
2586 Smoke:Destroy()
2587 end)
2588
2589 if i % 3 == 0 then
2590 RS:wait()
2591 end
2592 end
2593 end)
2594
2595 wait()
2596
2597 Grenade.Parent:Destroy()
2598end
2599
2600function ThrowGrenade(Type)
2601 local Grenade0 = nil
2602 if S.TrajectoryAssist then
2603 spawn(function()
2604 local X = 0
2605 local Vel = (Type == 1 and S.LethalGrenadeThrowVelocity or S.TacticalGrenadeThrowVelocity)
2606
2607 local GetX = function(Ang, T)
2608 local Vx = Vel * math.cos(Ang)
2609 return Vx * T
2610 end
2611
2612 local GetY = function(Ang, T)
2613 local V0y = Vel * math.sin(Ang)
2614 local Vy = V0y + (-196.2 * T)
2615 return (Vy * T) - (-98.1 * T * T)
2616 end
2617
2618 local Target = CreateTarget()
2619 Target.Parent = game.Workspace
2620 Target.PrimaryPart = Target:WaitForChild("Center")
2621
2622 while (Keys[S.LethalGrenadeKey] or Keys[S.TacticalGrenadeKey]) and Selected do
2623 X = X + math.rad(10)
2624 for _,v in pairs(Target:GetChildren()) do
2625 v.Transparency = 0.2 + ((math.sin(X) + 1) / 5)
2626 end
2627
2628 local Lines = {}
2629 local LastX, LastY = nil, nil
2630 for T = 0, 10, 0.1 do
2631 local XPos = GetX(math.rad(7) - HeadRot, T)
2632 local YPos = GetY(math.rad(7) - HeadRot, T)
2633 if LastX and LastY then
2634 local LookV3 = HRP.CFrame.lookVector
2635 local LastPos = (Head.CFrame * CF(1.5, 0, 0)).p + (LookV3 * LastX) + VEC3(0, LastY, 0)
2636 local NewPos = (Head.CFrame * CF(1.5, 0, 0)).p + (LookV3 * XPos) + VEC3(0, YPos, 0)
2637 local LineCF = CF(LastPos, NewPos)
2638 local Dist = (LastPos - NewPos).magnitude
2639 local NewDist = Dist
2640
2641 local H, P = AdvRayCast(LastPos, (NewPos - LastPos), 1, {Camera, unpack(Ignore)})
2642 if H then
2643 NewDist = (P - LastPos).magnitude
2644
2645 local SurfaceCF = GetHitSurfaceCFrame(P, H)
2646 local SurfaceDir = CF(H.CFrame.p, SurfaceCF.p)
2647 local SurfaceDist = SurfaceDir.lookVector * (H.CFrame.p - SurfaceCF.p).magnitude / 2
2648 local SurfaceOffset = P - SurfaceCF.p + SurfaceDist
2649 local SurfaceCFrame = SurfaceDir + SurfaceDist + SurfaceOffset
2650
2651 Target:SetPrimaryPartCFrame(SurfaceCFrame * CFANG(RAD(-90), 0, 0))
2652
2653 Target.Parent = Camera
2654 else
2655 Target.Parent = nil
2656 end
2657
2658 local Line = Instance.new("Part")
2659 Line.BrickColor = BrickColor.Red()
2660 Line.Material = Enum.Material.SmoothPlastic
2661 Line.Transparency = 0.2 + ((math.sin(X) + 1) / 5)
2662 Line.Anchored = true
2663 Line.CanCollide = false
2664 Line.FormFactor = Enum.FormFactor.Custom
2665 Line.Size = Vector3.new(0.4, 0.4, NewDist)
2666 Line.TopSurface = Enum.SurfaceType.Smooth
2667 Line.BottomSurface = Enum.SurfaceType.Smooth
2668 Line.CFrame = LineCF + (LineCF.lookVector * NewDist / 2)
2669 Line.Parent = Camera
2670
2671 table.insert(Lines, Line)
2672
2673 LastX,LastY = XPos,YPos
2674
2675 if H then break end
2676 else
2677 LastX,LastY = XPos,YPos
2678 end
2679 end
2680
2681 wait()
2682
2683 for _,Line in pairs(Lines) do
2684 Line:Destroy()
2685 end
2686 end
2687
2688 Target:Destroy()
2689 end)
2690 end
2691
2692 local AnimTable = {
2693 function()
2694 TweenJoint(LWeld, CF(-1.5, 0, 0), CF(0, 0.6, 0), Linear, 0.2)
2695 TweenJoint(RWeld, CF(1.5, 0, 0) * CFANG(0, 0, RAD(-10)), CF(0, 0.6, 0), Linear, 0.2)
2696 TweenJoint(Grip, Grip.C0, CFANG(0, RAD(10), 0), Linear, 0.2)
2697 wait(0.3)
2698 end;
2699
2700 function()
2701 Grip.Part0 = Torso
2702 Grip.C1 = CF(-1, 0.5, -0.5)
2703
2704 if S.LethalGrenadeType == 3 and Type == 1 then
2705 Grenade0 = CreateKnife()
2706 Grenade0.Parent = Gun_Ignore
2707
2708 local Weld = Instance.new("Weld")
2709 Weld.Part0 = FakeRArm
2710 Weld.Part1 = Grenade0
2711 Weld.C0 = Grip.C0
2712 Weld.C1 = CF(0, 0, -0.5) * CFANG(RAD(90), RAD(90), 0)
2713 Weld.Parent = Grenade0
2714
2715 TweenJoint(LWeld2, CF(), CF(), Sine, 0.3)
2716 TweenJoint(RWeld2, CF(), CF(), Sine, 0.3)
2717 TweenJoint(LWeld, ArmC0[1], CF(0, 0.5, 0.1) * CFANG(RAD(90), 0, 0), Sine, 0.3)
2718 TweenJoint(RWeld, ArmC0[2], CF(0, 0.4, 0.1) * CFANG(RAD(-80), 0, 0), Sine, 0.3)
2719 wait(0.3)
2720 else
2721 Grenade0 = CreateGrenade()
2722 Grenade0.Parent = Gun_Ignore
2723
2724 local Weld = Instance.new("Weld")
2725 Weld.Part0 = FakeRArm
2726 Weld.Part1 = Grenade0:WaitForChild("Center")
2727 Weld.C0 = Grip.C0
2728 Weld.Parent = Grenade0:WaitForChild("Center")
2729
2730 TweenJoint(LWeld2, CF(), CFANG(0, RAD(80), 0), Linear, 0.25)
2731 TweenJoint(RWeld2, CF(), CFANG(0, RAD(-80), 0), Linear, 0.25)
2732 TweenJoint(LWeld, ArmC0[1], CF(-0.2, 0.8, 0.1) * CFANG(RAD(10), 0, RAD(-30)), Linear, 0.25)
2733 TweenJoint(RWeld, ArmC0[2], CF(0.2, 0.8, 0.1) * CFANG(RAD(10), 0, RAD(30)), Linear, 0.25)
2734 wait(0.3)
2735 end
2736 end;
2737
2738 function()
2739 repeat wait() until (not Keys[S.LethalGrenadeKey]) and (not Keys[S.TacticalGrenadeKey]) or (not Selected)
2740 end;
2741
2742 function()
2743 if S.LethalGrenadeType ~= 3 or Type == 2 then
2744 TweenJoint(LWeld2, CF(), CFANG(0, RAD(45), 0), Sine, 0.2)
2745 TweenJoint(RWeld2, CF(), CFANG(0, RAD(-45), 0), Sine, 0.2)
2746 TweenJoint(LWeld, ArmC0[1], CF(0, 0.8, 0.1), Sine, 0.2)
2747 TweenJoint(RWeld, ArmC0[2], CF(0, 0.8, 0.1), Sine, 0.2)
2748 wait(0.2)
2749 end
2750 end;
2751
2752 function()
2753 if S.LethalGrenadeType ~= 3 or Type == 2 then
2754 TweenJoint(LWeld2, CF(), CF(), Sine, 0.3)
2755 TweenJoint(RWeld2, CF(), CF(), Sine, 0.3)
2756 TweenJoint(LWeld, ArmC0[1], CF(0, 0.5, 0.1) * CFANG(RAD(90), 0, 0), Sine, 0.3)
2757 TweenJoint(RWeld, ArmC0[2], CF(0, 0.4, 0.1) * CFANG(RAD(-80), 0, 0), Sine, 0.3)
2758 wait(0.3)
2759 end
2760 end;
2761
2762 function()
2763 TweenJoint(RWeld, ArmC0[2], CF(0, 0.8, 0.1) * CFANG(RAD(-10), 0, 0), Sine, 0.1)
2764 wait(0.07)
2765 end;
2766
2767 function()
2768 local Main = nil
2769 Grenade0:Destroy()
2770
2771 if S.LethalGrenadeType == 3 and Type == 1 then
2772 local Grenade1 = CreateKnife()
2773 Main = Grenade1
2774
2775 Grenade1.Parent = Gun_Ignore
2776
2777 Main.CFrame = FakeRArm.CFrame * Grip.C0 * CF(0, 0.5, 0) * CFANG(RAD(-90), 0, RAD(90))
2778 Main.Velocity = Main.Velocity + ((Head.CFrame * CFANG(RAD(7), 0, 0)).lookVector * S.LethalGrenadeThrowVelocity)
2779 Main.RotVelocity = (Main.CFrame * CFANG(RAD(90), 0, 0)).lookVector * 20
2780 else
2781 local Grenade1 = CreateGrenade()
2782 Main = Grenade1:WaitForChild("Center")
2783
2784 local Sound = Instance.new("Sound")
2785 Sound.SoundId = (Type == 1 and "rbxassetid://180302005" or "rbxassetid://156283116")
2786 Sound.Volume = 1
2787 Sound.PlayOnRemove = true
2788 Sound.Parent = Main
2789
2790 Grenade1.Parent = Gun_Ignore
2791
2792 Main.CanCollide = true
2793 Main.CFrame = FakeRArm.CFrame * Grip.C0
2794 if Type == 1 then
2795 Main.Velocity = Main.Velocity + ((Head.CFrame * CFANG(RAD(7), 0, 0)).lookVector * S.LethalGrenadeThrowVelocity)
2796 elseif Type == 2 then
2797 Main.Velocity = Main.Velocity + ((Head.CFrame * CFANG(RAD(7), 0, 0)).lookVector * S.TacticalGrenadeThrowVelocity)
2798 end
2799 end
2800
2801 spawn(function()
2802 if Type == 1 then
2803 if S.LethalGrenadeType == 1 then
2804 if S.TimerStartOnHit then
2805 local Detonated = false
2806 Main.Touched:connect(function(Obj)
2807 if IsIgnored(Obj) or Detonated then return end
2808 Main.Velocity = Main.Velocity / 4
2809 Detonated = true
2810
2811 wait(S.DetonationTime)
2812
2813 DetonateExplosive(Main)
2814 end)
2815 else
2816 spawn(function()
2817 local Touched = false
2818 Main.Touched:connect(function(Obj)
2819 if IsIgnored(Obj) or Touched then return end
2820 Touched = true
2821 Main.Velocity = Main.Velocity / 4
2822 end)
2823 end)
2824 wait(S.DetonationTime)
2825 DetonateExplosive(Main)
2826 end
2827 elseif S.LethalGrenadeType == 2 then
2828 local Detonated = false
2829 local GrenadeCF = nil
2830 Main.Touched:connect(function(Obj)
2831 if IsIgnored(Obj) or Detonated then return end
2832 GrenadeCF = Main.CFrame
2833
2834 local W = Instance.new("Weld")
2835 W.Name = "Semtex"
2836 W.Part0 = Main
2837 W.Part1 = Obj
2838 W.C0 = GrenadeCF:toObjectSpace(Obj.CFrame)
2839 W.Parent = Main
2840
2841 Main.ChildRemoved:connect(function(C)
2842 if C.Name == "Semtex" then
2843 local W = Instance.new("Weld")
2844 W.Name = "Semtex"
2845 W.Part0 = Main
2846 W.Part1 = Obj
2847 W.C0 = GrenadeCF:toObjectSpace(Obj.CFrame)
2848 W.Parent = Main
2849 end
2850 end)
2851
2852 if S.TimerStartOnHit then
2853 Detonated = true
2854 wait(S.DetonationTime)
2855 DetonateExplosive(Main)
2856 end
2857 end)
2858
2859 if (not S.TimerStartOnHit) then
2860 wait(S.DetonationTime)
2861 Detonated = true
2862 DetonateExplosive(Main)
2863 end
2864 elseif S.LethalGrenadeType == 3 then
2865 local Touched = false
2866 Main.Touched:connect(function(Obj)
2867 if IsIgnored(Obj) or Touched then return end
2868 Touched = true
2869
2870 local W = Instance.new("Weld")
2871 W.Name = "Sticky"
2872 W.Part0 = Main
2873 W.Part1 = Obj
2874 W.C0 = Main.CFrame:toObjectSpace(Obj.CFrame)
2875 W.Parent = Main
2876
2877 Main.ChildRemoved:connect(function(C)
2878 if C.Name == "Sticky" then
2879 local W = Instance.new("Weld")
2880 W.Name = "Sticky"
2881 W.Part0 = Main
2882 W.Part1 = Obj
2883 W.C0 = Main.CFrame:toObjectSpace(Obj.CFrame)
2884 W.Parent = Main
2885 end
2886 end)
2887
2888 if Obj then
2889 if Obj.Parent.ClassName == "Hat" then
2890 local HitHumanoid = FindFirstClass(Obj.Parent.Parent, "Humanoid")
2891 if HitHumanoid and IsEnemy(HitHumanoid) then
2892 local CreatorTag = Instance.new("ObjectValue")
2893 CreatorTag.Name = "creator"
2894 CreatorTag.Value = Player
2895 CreatorTag.Parent = HitHumanoid
2896 HitHumanoid:TakeDamage(HitHumanoid.MaxHealth)
2897 MarkHit()
2898 end
2899 else
2900 local HitHumanoid = FindFirstClass(Obj.Parent, "Humanoid")
2901 if HitHumanoid and IsEnemy(HitHumanoid) then
2902 local CreatorTag = Instance.new("ObjectValue")
2903 CreatorTag.Name = "creator"
2904 CreatorTag.Value = Player
2905 CreatorTag.Parent = HitHumanoid
2906 HitHumanoid:TakeDamage(HitHumanoid.MaxHealth)
2907 MarkHit()
2908 end
2909 end
2910 end
2911
2912 wait(3)
2913
2914 Main:Destroy()
2915 end)
2916 end
2917 elseif Type == 2 then
2918 if S.TacticalGrenadeType == 1 then
2919 if S.TimerStartOnHit then
2920 local Detonated = false
2921 Main.Touched:connect(function(Obj)
2922 if IsIgnored(Obj) or Detonated then return end
2923 Main.Velocity = Main.Velocity / 2
2924 Detonated = true
2925
2926 wait(S.DetonationTime)
2927
2928 DetonateSmoke(Main)
2929 end)
2930 else
2931 spawn(function()
2932 local Touched = false
2933 Main.Touched:connect(function(Obj)
2934 if IsIgnored(Obj) or Touched then return end
2935 Touched = true
2936 Main.Velocity = Main.Velocity / 2
2937 end)
2938 end)
2939 wait(S.DetonationTime)
2940 DetonateSmoke(Main)
2941 end
2942 end
2943 end
2944 end)
2945
2946 if S.GrenadeTrail and S.GrenadeTrailTransparency ~= 1 then
2947 spawn(function()
2948 local LastPos = nil
2949 while true do
2950 if LastPos then
2951 if (not Main:IsDescendantOf(game))
2952 or (Main.Name == "Knife" and FindFirstClass(Main, "Weld")) then
2953 break
2954 end
2955 local Trail = Instance.new("Part")
2956 Trail.BrickColor = S.GrenadeTrailColor
2957 Trail.Transparency = S.GrenadeTrailTransparency
2958 Trail.Anchored = true
2959 Trail.CanCollide = false
2960 Trail.Size = VEC3(1, 1, 1)
2961 local Mesh = Instance.new("BlockMesh")
2962 Mesh.Offset = VEC3(0, 0, -(Main.Position - LastPos).magnitude / 2)
2963 Mesh.Scale = VEC3(S.GrenadeTrailThickness, S.GrenadeTrailThickness, (Main.Position - LastPos).magnitude)
2964 Mesh.Parent = Trail
2965 Trail.Parent = Gun_Ignore
2966 Trail.CFrame = CF(LastPos, Main.Position)
2967 delay(S.GrenadeTrailVisibleTime, function()
2968 if S.GrenadeTrailDisappearTime > 0 then
2969 local X = 0
2970 while true do
2971 if X == 90 then break end
2972 if (not Selected) then break end
2973 local NewX = X + (1.5 / S.GrenadeTrailDisappearTime)
2974 X = (NewX > 90 and 90 or NewX)
2975 local Alpha = X / 90
2976 Trail.Transparency = NumLerp(S.GrenadeTrailTransparency, 1, Alpha)
2977 RS:wait()
2978 end
2979 Trail:Destroy()
2980 else
2981 Trail:Destroy()
2982 end
2983 end)
2984 LastPos = Main.Position
2985 else
2986 LastPos = Main.Position
2987 end
2988 RS:wait()
2989 end
2990 end)
2991 end
2992 wait(0.2)
2993 end;
2994
2995 function()
2996 TweenJoint(RWeld, CF(1.5, 0, 0) * CFANG(0, 0, RAD(-10)), CF(0, 0.6, 0), Linear, 0.2)
2997 wait(0.3)
2998 end;
2999
3000 function()
3001 Grip.Part0 = RArm
3002 Grip.C1 = CFANG(0, RAD(20), 0)
3003
3004 TweenJoint(LWeld, ArmC0[1], S.ArmC1_UnAimed.Left, Linear, 0.2)
3005 TweenJoint(RWeld, ArmC0[2], S.ArmC1_UnAimed.Right, Linear, 0.2)
3006 wait(0.2)
3007 end;
3008 }
3009
3010 for _,F in pairs(AnimTable) do
3011 if (not Selected) then
3012 break
3013 end
3014 F()
3015 end
3016
3017 if (not Selected) and Grenade0 then
3018 Grenade0:Destroy()
3019 end
3020end
3021
3022--------------------[ CAMERA STEADYING FUNCTIONS ]------------------------------------
3023
3024function SteadyCamera()
3025 Gui_Clone.Scope.Steady.Text = "Steadying..."
3026 Gui_Clone.Scope.Steady.TextColor3 = Color3.new(1, 1, 0)
3027 CameraSteady = true
3028 local OriginalSway = CameraSway
3029 for X = 0, 90, 1.5 / 0.6 do
3030 if (not Run_Key_Pressed) then break end
3031 local Alpha = SIN(RAD(X))
3032 CameraSway = NumLerp(OriginalSway, 0, Alpha)
3033 RS:wait()
3034 end
3035 while Run_Key_Pressed and Aimed do
3036 if CurrentSteadyTime > 0 then
3037 local NewSteadyTime = CurrentSteadyTime - 1
3038 CurrentSteadyTime = (NewSteadyTime < 0 and 0 or NewSteadyTime)
3039 CameraSway = 0
3040 elseif CurrentSteadyTime == 0 then
3041 break
3042 end
3043 RS:wait()
3044 end
3045 CameraSteady = false
3046 spawn(function()
3047 for X = 0, 90, 1.5 / 0.2 do
3048 local Alpha = math.log10(X) / math.log10(90)
3049 CameraSway = NumLerp(0, 3, Alpha)
3050 RS:wait()
3051 end
3052 for X = 0, 90, 1.5 / S.ScopeSteadyTime do
3053 if CameraSteady then break end
3054 local Alpha = SIN(RAD(X))
3055 CameraSway = NumLerp(3, 1, Alpha)
3056 RS:wait()
3057 end
3058 end)
3059 RetakeBreath()
3060end
3061
3062function RetakeBreath()
3063 local Steady = Gui_Clone.Scope.Steady
3064 Steady.Text = "Re-taking Breath"
3065 Steady.TextColor3 = Color3.new(1, 0, 0)
3066 TakingBreath = true
3067 while TakingBreath do
3068 if CurrentSteadyTime < MaxSteadyTime then
3069 local NewSteadyTime = CurrentSteadyTime + (S.ScopeSteadyTime / S.SteadyCooldownTime)
3070 CurrentSteadyTime = (NewSteadyTime > MaxSteadyTime and MaxSteadyTime or NewSteadyTime)
3071 elseif CurrentSteadyTime >= MaxSteadyTime then
3072 break
3073 end
3074 RS:wait()
3075 end
3076 if TakingBreath then
3077 Steady.Text = "Hold "..ConvertKey(S.ScopeSteadyKey).." to Steady"
3078 Steady.TextColor3 = Color3.new(1, 1, 0)
3079 TakingBreath = false
3080 end
3081end
3082
3083--------------------[ SPRINTING FUNCTIONS ]-------------------------------------------
3084
3085function MonitorStamina()
3086 while Run_Key_Pressed do
3087 if (not Aimed) and (not Aiming) then
3088 break
3089 end
3090 RS:wait()
3091 end
3092 while Run_Key_Pressed and (not Aiming) and (not Aimed) and (not Knifing) and (not ThrowingGrenade) do
3093 local Forward = (Keys["w"] or Keys[string.char(17)])
3094 local Backward = (Keys["s"] or Keys[string.char(18)])
3095 if (Forward and (not Backward))
3096 and Walking and (Stamina > 0) then
3097 if Stance == 1 or Stance == 2 then Stand() end
3098 local NewStamina = Stamina - 1
3099 Stamina = (NewStamina < 0 and 0 or NewStamina)
3100 Running = true
3101 elseif (not (Forward and (not Backward)))
3102 or (not Walking) or (Stamina == 0) then
3103 break
3104 end
3105 RS:wait()
3106 end
3107 Running = false
3108 RechargeStamina()
3109end
3110
3111function RechargeStamina()
3112 ChargingStamina = true
3113 while ((not Run_Key_Pressed) or (Stamina < MaxStamina)) and (not Running) do
3114 if Stamina < MaxStamina then
3115 local NewStamina = Stamina + (S.SprintTime / S.StaminaCoolTime)
3116 Stamina = (NewStamina > MaxStamina and MaxStamina or NewStamina)
3117 elseif Stamina >= MaxStamina then
3118 break
3119 end
3120 RS:wait()
3121 end
3122 ChargingStamina = false
3123end
3124
3125--------------------[ STANCE FUNCTIONS ]----------------------------------------------
3126
3127function Stand(OnDeselected)
3128 local LHip = Torso["Left Hip"]
3129 local RHip = Torso["Right Hip"]
3130 local Root = HRP.RootJoint
3131 Stance = 0
3132 if S.StanceAnimation and (not OnDeselected) then
3133 spawn(function()
3134 local PreviousOffset = Humanoid.CameraOffset
3135 local PreviousRootP = Root.C0.p
3136 for X = 0, 90, 1.5 / S.StanceChangeSpeed do
3137 if Stance ~= 0 then break end
3138 local Alpha = Sine(X)
3139 Humanoid.CameraOffset = PreviousOffset:lerp(StanceOffset[1], Alpha)
3140 Root.C0 = CF(PreviousRootP:lerp(VEC3(), Alpha)) * CFANG(RAD(-90), 0, RAD(180))
3141 RS:wait()
3142 end
3143 end)
3144 TweenJoint(ABWeld, CF(), CF(), Sine, S.StanceChangeSpeed)
3145 TweenJoint(LHip, CF(-1, -1, 0) * CFANG(0, RAD(-90), 0), CF(-0.5, 1, 0) * CFANG(0, RAD(-90), 0), Sine, S.StanceChangeSpeed)
3146 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.StanceChangeSpeed)
3147 elseif OnDeselected then
3148 Humanoid.CameraOffset = StanceOffset[1]
3149 ABWeld.C0 = CF()
3150 ABWeld.C1 = CF()
3151 LHip.C0 = CF(-1, -1, 0) * CFANG(0, RAD(-90), 0)
3152 LHip.C1 = CF(-0.5, 1, 0) * CFANG(0, RAD(-90), 0)
3153 RHip.C0 = CF(1, -1, 0) * CFANG(RAD(-180), RAD(90), 0)
3154 RHip.C1 = CF(0.5, 1, 0) * CFANG(RAD(-180), RAD(90), 0)
3155 Root.C0 = CFANG(RAD(-90), 0, RAD(180))
3156 end
3157end
3158
3159function Crouch()
3160 local LHip = Torso["Left Hip"]
3161 local RHip = Torso["Right Hip"]
3162 local Root = HRP.RootJoint
3163 Stance = 1
3164 if S.StanceAnimation then
3165 spawn(function()
3166 local PreviousOffset = Humanoid.CameraOffset
3167 local PreviousRootP = Root.C0.p
3168 for X = 0, 90, 1.5 / S.StanceChangeSpeed do
3169 if Stance ~= 1 then break end
3170 local Alpha = Sine(X)
3171 Humanoid.CameraOffset = PreviousOffset:lerp(StanceOffset[2], Alpha)
3172 Root.C0 = CF(PreviousRootP:lerp(VEC3(0, -1, 0), Alpha)) * CFANG(RAD(-90), 0, RAD(180))
3173 RS:wait()
3174 end
3175 end)
3176 TweenJoint(ABWeld, CF(0, 0, -1 / 16), CF(), Sine, S.StanceChangeSpeed)
3177 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.StanceChangeSpeed)
3178 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.StanceChangeSpeed)
3179 else
3180 Humanoid.CameraOffset = StanceOffset[2]
3181 ABWeld.C0 = CF(0, 0, -1 / 16)
3182 ABWeld.C1 = CF()
3183 LHip.C0 = CF(-1, -0.5, 0) * CFANG(0, RAD(-90), 0)
3184 LHip.C1 = CF(-0.5, 0.5, 1) * CFANG(0, RAD(-90), RAD(-90))
3185 RHip.C0 = CF(1, -0.5, 0.25) * CFANG(RAD(-180), RAD(90), 0)
3186 RHip.C1 = CF(0.5, 0.5, 1) * CFANG(RAD(-180), RAD(90), 0)
3187 Root.C0 = CF(0, -1, 0) * CFANG(RAD(-90), 0, RAD(180))
3188 end
3189end
3190
3191function Prone()
3192 local LHip = Torso["Left Hip"]
3193 local RHip = Torso["Right Hip"]
3194 local Root = HRP.RootJoint
3195 Stance = 2
3196 if S.StanceAnimation then
3197 spawn(function()
3198 local PreviousOffset = Humanoid.CameraOffset
3199 local PreviousRootP = Root.C0.p
3200 for X = 0, 90, 1.5 / S.StanceChangeSpeed do
3201 if Stance ~= 2 then break end
3202 local Alpha = Sine(X)
3203 Humanoid.CameraOffset = PreviousOffset:lerp(StanceOffset[3], Alpha)
3204 Root.C0 = CF(PreviousRootP:lerp(VEC3(0, -2.5, 1), Alpha)) * CFANG(RAD(180), 0, RAD(180))
3205 RS:wait()
3206 end
3207 end)
3208 TweenJoint(ABWeld, CF(0, 0, -1 / 8), CF(), Sine, S.StanceChangeSpeed)
3209 TweenJoint(LHip, CF(-1, -1, 0) * CFANG(0, RAD(-90), 0), CF(-0.5, 1, 0) * CFANG(0, RAD(-90), 0), Sine, S.StanceChangeSpeed)
3210 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.StanceChangeSpeed)
3211 else
3212 Humanoid.CameraOffset = StanceOffset[3]
3213 ABWeld.C0 = CF(0, 0, -1 / 8)
3214 ABWeld.C1 = CF()
3215 LHip.C0 = CF(-1, -1, 0) * CFANG(0, RAD(-90), 0)
3216 LHip.C1 = CF(-0.5, 1, 0) * CFANG(0, RAD(-90), 0)
3217 RHip.C0 = CF(1, -1, 0) * CFANG(RAD(-180), RAD(90), 0)
3218 RHip.C1 = CF(0.5, 1, 0) * CFANG(RAD(-180), RAD(90), 0)
3219 Root.C0 = CF(0, -2.5, 1) * CFANG(RAD(180), 0, RAD(180))
3220 end
3221end
3222
3223function Dive(Speed)
3224 local DiveVelocity = (HRP.CFrame * CFANG(RAD(18),0,0)).lookVector * Speed * (35 / 16) * 4e3
3225 HRP.Velocity = VEC3()
3226 Torso.Velocity = VEC3()
3227 local BF = Instance.new("BodyForce")
3228 BF.force = DiveVelocity
3229 BF.Parent = HRP
3230 delay(0.05, function()
3231 Prone()
3232 local Start = tick()
3233 while true do
3234 wait()
3235 if (tick() - Start) > 0.1 then break end
3236 BF.force = -HRP.Velocity * 700
3237 end
3238 BF:Destroy()
3239 end)
3240end
3241
3242--------------------[ KEYBOARD FUNCTIONS ]--------------------------------------------
3243
3244function KeyDown(K)
3245 local Key = string.lower(K)
3246
3247 if Key == S.LowerStanceKey and S.CanChangeStance then
3248 if (not Running) then
3249 if Stance == 0 then
3250 Crouch()
3251 elseif Stance == 1 then
3252 Prone()
3253 end
3254 elseif S.DolphinDive then
3255 delay(1 / 30,function()
3256 CanRun = false
3257 Dive(S.BaseWalkSpeed)
3258 Run_Key_Pressed = false
3259 wait(S.DiveRechargeTime)
3260 CanRun = true
3261 end)
3262 end
3263 end
3264
3265 if Key == S.RaiseStanceKey and S.CanChangeStance then
3266 if (not Running) then
3267 if Stance == 2 then
3268 Crouch()
3269 elseif Stance == 1 then
3270 Stand()
3271 end
3272 end
3273 end
3274
3275 if Key == S.ADSKey then
3276 if S.HoldMouseOrKeyToADS then
3277 if (not AimingIn) and (not Aimed) then
3278 AimingIn = true
3279 AimGun()
3280 AimingIn = false
3281 end
3282 else
3283 if Aimed then
3284 UnAimGun()
3285 else
3286 AimGun()
3287 end
3288 end
3289 end
3290
3291 if Key == S.ReloadKey then
3292 if (not Reloading) and (not Running) then
3293 Reload()
3294 end
3295 end
3296
3297
3298 if Key == S.KnifeKey and S.CanKnife then
3299 if KnifeReady and (not Knifing) and (not ThrowingGrenade) then
3300 if Aimed then UnAimGun(true) end
3301 BreakReload = true
3302 Knifing = true
3303 KnifeReady = false
3304 KnifeAnim()
3305 BreakReload = false
3306 Knifing = false
3307 delay(S.KnifeCooldown, function()
3308 KnifeReady = true
3309 end)
3310 end
3311 end
3312
3313 if Key == S.LethalGrenadeKey and S.Throwables then
3314 if (not Knifing) and (not Running) and (not Aimed) and (not Aiming) and (not ThrowingGrenade) then
3315 if LethalGrenades.Value > 0 then
3316 LethalGrenades.Value = LethalGrenades.Value - 1
3317 ThrowingGrenade = true
3318 ThrowGrenade(1)
3319 ThrowingGrenade = false
3320 end
3321 end
3322 end
3323
3324 if Key == S.TacticalGrenadeKey and S.Throwables then
3325 if (not Knifing) and (not Running) and (not Aimed) and (not Aiming) and (not ThrowingGrenade) then
3326 if TacticalGrenades.Value > 0 then
3327 TacticalGrenades.Value = TacticalGrenades.Value - 1
3328 ThrowingGrenade = true
3329 ThrowGrenade(2)
3330 ThrowingGrenade = false
3331 end
3332 end
3333 end
3334
3335 if Key == S.SprintKey then
3336 Run_Key_Pressed = true
3337 if Aimed and (not Aiming) then
3338 TakingBreath = false
3339 SteadyCamera()
3340 end
3341 if CanRun then
3342 if (not Idleing) and Walking and (not Running) and (not Knifing) and (not ThrowingGrenade) then
3343 if Reloading then BreakReload = true end
3344 MonitorStamina()
3345 end
3346 end
3347 end
3348end
3349
3350function KeyUp(K)
3351 local Key = string.lower(K)
3352
3353 if Key == S.ADSKey then
3354 if S.HoldMouseOrKeyToADS then
3355 if (not AimingOut) and Aimed then
3356 AimingOut = true
3357 UnAimGun()
3358 AimingOut = false
3359 end
3360 end
3361 end
3362
3363 if Key == S.SprintKey then
3364 Run_Key_Pressed = false
3365 Running = false
3366 if (not ChargingStamina) then
3367 RechargeStamina()
3368 end
3369 end
3370end
3371
3372--------------------[ END FUNCTIONS ]-------------------------------------------------
3373
3374--------------------------------------------------------------------------------------
3375--------------------[ TOOL SELECTION AND DESELECTION ]--------------------------------
3376--------------------------------------------------------------------------------------
3377
3378function OnEquipped(M_Icon)
3379 wait(math.random(10, 40) / 100)
3380 if Humanoid.Health ~= 0 and (not Selected) and Gun.Parent == Character then
3381 Selected = true
3382
3383 BreakReload = false
3384
3385 --------------------[ FAILSAFE RESETING ]-------------------------------------
3386
3387 for _, GM in pairs(Ignore_Model:GetChildren()) do
3388 if GM.Name == "Gun_Ignore_"..Player.Name then
3389 GM:Destroy()
3390 end
3391 end
3392
3393 for _,c in pairs(Connections) do
3394 c:disconnect()
3395 end
3396
3397 Connections = {}
3398
3399 --------------------[ CREATING IGNORE MODELS ]--------------------------------
3400
3401 Gun_Ignore = Instance.new("Model")
3402 Gun_Ignore.Name = "Gun_Ignore_"..Player.Name
3403 Gun_Ignore.Parent = Ignore_Model
3404
3405 --------------------[ MODIFYING THE PLAYER ]----------------------------------
3406
3407 M_Icon.Icon = "rbxasset://textures\\Blank.png"
3408
3409 Gui_Clone = Main_Gui:Clone()
3410 Gui_Clone.Parent = Player.PlayerGui
3411
3412 SetUpGui()
3413
3414 Shoulders.Right.Part1 = nil
3415 Shoulders.Left.Part1 = nil
3416
3417 PrevNeckCF.C0 = Neck.C0
3418 PrevNeckCF.C1 = Neck.C1
3419
3420 BG = Instance.new("BodyGyro", HRP)
3421 BG.maxTorque = VEC3(HUGE, HUGE, HUGE)
3422 BG.Name = "BG"
3423 BG.P = 1e5
3424 BG.cframe = CF(Torso.CFrame.p, Torso.CFrame.p + Torso.CFrame.lookVector)
3425
3426 local PlayerFolder = Instance.new("Model")
3427 PlayerFolder.Name = "PlayerFolder"
3428 PlayerFolder.Parent = Gun_Ignore
3429
3430 local AnimBase = Instance.new("Part")
3431 AnimBase.Transparency = 1
3432 AnimBase.Name = "AnimBase"
3433 AnimBase.CanCollide = false
3434 AnimBase.FormFactor = Enum.FormFactor.Custom
3435 AnimBase.Size = VEC3(0.2, 0.2, 0.2)
3436 AnimBase.BottomSurface = Enum.SurfaceType.Smooth
3437 AnimBase.TopSurface = Enum.SurfaceType.Smooth
3438 AnimBase.Parent = PlayerFolder
3439
3440 AnimWeld = Instance.new("Weld")
3441 AnimWeld.Part0 = AnimBase
3442 AnimWeld.Part1 = Head
3443 AnimWeld.C0 = CF(0, 1, 0)
3444 AnimWeld.Parent = AnimBase
3445
3446 local ArmBase = Instance.new("Part")
3447 ArmBase.Transparency = 1
3448 ArmBase.Name = "ArmBase"
3449 ArmBase.CanCollide = false
3450 ArmBase.FormFactor = Enum.FormFactor.Custom
3451 ArmBase.Size = VEC3(0.2, 0.2, 0.2)
3452 ArmBase.BottomSurface = Enum.SurfaceType.Smooth
3453 ArmBase.TopSurface = Enum.SurfaceType.Smooth
3454 ArmBase.Parent = PlayerFolder
3455
3456 ABWeld = Instance.new("Weld")
3457 ABWeld.Part0 = ArmBase
3458 ABWeld.Part1 = AnimBase
3459 ABWeld.Parent = ArmBase
3460
3461 local LArmBase = Instance.new("Part")
3462 LArmBase.Transparency = 1
3463 LArmBase.Name = "LArmBase"
3464 LArmBase.CanCollide = false
3465 LArmBase.FormFactor = Enum.FormFactor.Custom
3466 LArmBase.Size = VEC3(0.2, 0.2, 0.2)
3467 LArmBase.BottomSurface = Enum.SurfaceType.Smooth
3468 LArmBase.TopSurface = Enum.SurfaceType.Smooth
3469 LArmBase.Parent = PlayerFolder
3470
3471 local RArmBase = Instance.new("Part")
3472 RArmBase.Transparency = 1
3473 RArmBase.Name = "RArmBase"
3474 RArmBase.CanCollide = false
3475 RArmBase.FormFactor = Enum.FormFactor.Custom
3476 RArmBase.Size = VEC3(0.2, 0.2, 0.2)
3477 RArmBase.BottomSurface = Enum.SurfaceType.Smooth
3478 RArmBase.TopSurface = Enum.SurfaceType.Smooth
3479 RArmBase.Parent = PlayerFolder
3480
3481 LWeld = Instance.new("Weld")
3482 LWeld.Name = "LWeld"
3483 LWeld.Part0 = ArmBase
3484 LWeld.Part1 = LArmBase
3485 LWeld.C0 = ArmC0[1]
3486 LWeld.C1 = S.ArmC1_UnAimed.Left
3487 LWeld.Parent = ArmBase
3488
3489 RWeld = Instance.new("Weld")
3490 RWeld.Name = "RWeld"
3491 RWeld.Part0 = ArmBase
3492 RWeld.Part1 = RArmBase
3493 RWeld.C0 = ArmC0[2]
3494 RWeld.C1 = S.ArmC1_UnAimed.Right
3495 RWeld.Parent = ArmBase
3496
3497 LWeld2 = Instance.new("Weld")
3498 LWeld2.Name = "LWeld"
3499 LWeld2.Part0 = LArmBase
3500 LWeld2.Part1 = LArm
3501 LWeld2.Parent = LArmBase
3502
3503 RWeld2 = Instance.new("Weld")
3504 RWeld2.Name = "RWeld"
3505 RWeld2.Part0 = RArmBase
3506 RWeld2.Part1 = RArm
3507 RWeld2.Parent = RArmBase
3508
3509 if S.PlayerArms then
3510 FakeLArm = LArm:Clone()
3511 FakeLArm.Parent = PlayerFolder
3512 FakeLArm.Transparency = S.FakeArmTransparency
3513 FakeLArm:BreakJoints()
3514
3515 LArm.Transparency = 1
3516
3517 local FakeLWeld = Instance.new("Weld")
3518 FakeLWeld.Part0 = FakeLArm
3519 FakeLWeld.Part1 = LArm
3520 FakeLWeld.Parent = FakeLArm
3521
3522 FakeRArm = RArm:Clone()
3523 FakeRArm.Parent = PlayerFolder
3524 FakeRArm.Transparency = S.FakeArmTransparency
3525 FakeRArm:BreakJoints()
3526
3527 RArm.Transparency = 1
3528
3529 local FakeRWeld = Instance.new("Weld")
3530 FakeRWeld.Part0 = FakeRArm
3531 FakeRWeld.Part1 = RArm
3532 FakeRWeld.Parent = FakeRArm
3533
3534 Instance.new("Humanoid", PlayerFolder)
3535
3536 for _,Obj in pairs(Character:GetChildren()) do
3537 if Obj:IsA("CharacterMesh") or Obj:IsA("Shirt") then
3538 Obj:Clone().Parent = PlayerFolder
3539 end
3540 end
3541 else
3542 local ArmTable = CreateArms()
3543 ArmTable[1].Model.Parent = PlayerFolder
3544 ArmTable[2].Model.Parent = PlayerFolder
3545
3546 FakeLArm = ArmTable[1].ArmPart
3547
3548 LArm.Transparency = 1
3549
3550 local FakeLWeld = Instance.new("Weld")
3551 FakeLWeld.Part0 = FakeLArm
3552 FakeLWeld.Part1 = LArm
3553 FakeLWeld.Parent = FakeLArm
3554
3555 FakeRArm = ArmTable[2].ArmPart
3556
3557 RArm.Transparency = 1
3558
3559 local FakeRWeld = Instance.new("Weld")
3560 FakeRWeld.Part0 = FakeRArm
3561 FakeRWeld.Part1 = RArm
3562 FakeRWeld.Parent = FakeRArm
3563 end
3564
3565 --------------------[ MODIFYING THE GUN ]-------------------------------------
3566
3567 for _, Tab in pairs(Parts) do
3568 local Weld = Instance.new("Weld")
3569 Weld.Name = "MainWeld"
3570 Weld.Part0 = Handle
3571 Weld.Part1 = Tab.Obj
3572 Weld.C0 = Tab.Obj.WeldCF.Value
3573 Weld.Parent = Handle
3574 Tab.Weld = Weld
3575 end
3576
3577 Grip = RArm:WaitForChild("RightGrip")
3578
3579 local HandleCF = ArmBase.CFrame * ArmC0[2] * S.ArmC1_Aimed.Right:inverse() * CF(0, -1, 0, 1, 0, 0, 0, 0, 1, 0, -1, 0)
3580 local HandleOffset = AimPart.CFrame:toObjectSpace(Handle.CFrame)
3581 Aimed_GripCF = (Head.CFrame * HandleOffset):toObjectSpace(HandleCF)
3582
3583 --------------------[ CONNECTIONS ]-------------------------------------------
3584
3585 INSERT(Connections, Humanoid.Died:connect(function()
3586 OnUnequipped(true)
3587 end))
3588
3589 INSERT(Connections, M2.Button1Down:connect(function()
3590 MB1_Down = true
3591 if S.GunType.Auto and (not S.GunType.Semi) and (not S.GunType.Burst) then
3592 if (not CanFire) then return end
3593 CanFire = false
3594 if (not Running) and (not Knifing) and (not ThrowingGrenade) then
3595 CurrentSpread = (
3596 Aimed and S.Spread.Aimed or
3597 ((Idleing and (not Walking)) and S.Spread.Hipfire or S.Spread.Walking)
3598 )
3599 while MB1_Down and (not Reloading) do
3600 if Knifing and (not ThrowingGrenade) then break end
3601 if Running then break end
3602 if Ammo.Value > 0 then
3603 Ammo.Value = Ammo.Value - 1
3604 if Humanoid.Health ~= 0 then
3605 if Aimed and Run_Key_Pressed and S.UnSteadyOnFire then
3606 Run_Key_Pressed = false
3607 CurrentSteadyTime = 0
3608 end
3609 Fire_Gun()
3610 end
3611 end
3612 if Ammo.Value == 0 and S.AutoReload then
3613 wait(0.2)
3614 Reload()
3615 end
3616 wait(60 / S.FireRate)
3617 end
3618 end
3619 CanFire = true
3620 elseif (not S.GunType.Auto) and S.GunType.Burst then
3621 if (not CanFire) then return end
3622 CanFire = false
3623 if (not Running) and (not Knifing) and (not ThrowingGrenade) then
3624 CurrentSpread = (
3625 Aimed and S.Spread.Aimed or
3626 ((Idleing and (not Walking)) and S.Spread.Hipfire or S.Spread.Walking)
3627 )
3628 for i = 1, S.BurstAmount do
3629 if Ammo.Value > 0 then
3630 Ammo.Value = Ammo.Value - 1
3631 if Humanoid.Health ~= 0 then
3632 if Aimed and Run_Key_Pressed and S.UnSteadyOnFire then
3633 Run_Key_Pressed = false
3634 CurrentSteadyTime = 0
3635 end
3636 Fire_Gun()
3637 end
3638 end
3639 if Ammo.Value == 0 and S.AutoReload then
3640 wait(0.2)
3641 Reload()
3642 break
3643 end
3644 wait(S.BurstTime / S.BurstAmount)
3645 end
3646 end
3647 wait(S.BurstWait)
3648 CanFire = true
3649 elseif (not S.GunType.Auto) and S.GunType.Semi then
3650 if (not CanFire) then return end
3651 CanFire = false
3652 if (not Running) and (not Knifing) and (not ThrowingGrenade) then
3653 CurrentSpread = (
3654 Aimed and S.Spread.Aimed or
3655 ((Idleing and (not Walking)) and S.Spread.Hipfire or S.Spread.Walking)
3656 )
3657 if Ammo.Value > 0 then
3658 Ammo.Value = Ammo.Value - 1
3659 if Humanoid.Health ~= 0 then
3660 if Aimed and Run_Key_Pressed and S.UnSteadyOnFire then
3661 Run_Key_Pressed = false
3662 CurrentSteadyTime = 0
3663 end
3664 Fire_Gun()
3665 end
3666 end
3667 if Ammo.Value == 0 and S.AutoReload then
3668 wait(0.2)
3669 Reload()
3670 end
3671 wait(60 / S.FireRate)
3672 end
3673 CanFire = true
3674 elseif (not S.GunType.Auto) and (not S.GunType.Semi) and (not S.GunType.Burst) and S.GunType.Shot then
3675 if (not CanFire) then return end
3676 CanFire = false
3677 if (not Running) and (not Knifing) and (not ThrowingGrenade) then
3678 CurrentSpread = (
3679 Aimed and S.Spread.Aimed or
3680 ((Idleing and (not Walking)) and S.Spread.Hipfire or S.Spread.Walking)
3681 )
3682 if Ammo.Value > 0 then
3683 Ammo.Value = Ammo.Value - 1
3684 if Humanoid.Health ~= 0 then
3685 if Aimed and Run_Key_Pressed and S.UnSteadyOnFire then
3686 Run_Key_Pressed = false
3687 CurrentSteadyTime = 0
3688 end
3689 Fire_Gun()
3690 end
3691 end
3692 if Ammo.Value == 0 and S.AutoReload then
3693 wait(0.2)
3694 Reload()
3695 end
3696 wait(60 / S.FireRate)
3697 end
3698 CanFire = true
3699 elseif (not S.GunType.Auto) and (not S.GunType.Semi) and S.GunType.Burst and (not S.GunType.Shot) then
3700 if (not CanFire) then return end
3701 CanFire = false
3702 if (not Running) and (not Knifing) and (not ThrowingGrenade) then
3703 CurrentSpread = (
3704 Aimed and S.Spread.Aimed or
3705 ((Idleing and (not Walking)) and S.Spread.Hipfire or S.Spread.Walking)
3706 )
3707 for i = 1, S.BurstAmount do
3708 if Ammo.Value > 0 then
3709 Ammo.Value = Ammo.Value - 1
3710 if Humanoid.Health ~= 0 then
3711 if Aimed and Run_Key_Pressed and S.UnSteadyOnFire then
3712 Run_Key_Pressed = false
3713 CurrentSteadyTime = 0
3714 end
3715 Fire_Gun()
3716 end
3717 end
3718 if Ammo.Value == 0 and S.AutoReload then
3719 wait(0.2)
3720 Reload()
3721 break
3722 end
3723 wait(S.BurstTime / S.BurstAmount)
3724 end
3725 end
3726 wait(S.BurstWait)
3727 CanFire = true
3728 elseif (not S.GunType.Auto) and (not S.GunType.Burst) and (not S.GunType.Shot) and S.GunType.Explosive then
3729 if (not CanFire) then return end
3730 CanFire = false
3731 if (not Running) and (not Knifing) and (not ThrowingGrenade) then
3732 CurrentSpread = (
3733 Aimed and S.Spread.Aimed or
3734 ((Idleing and (not Walking)) and S.Spread.Hipfire or S.Spread.Walking)
3735 )
3736 if Ammo.Value > 0 then
3737 Ammo.Value = Ammo.Value - 1
3738 if Humanoid.Health ~= 0 then
3739 if Aimed and Run_Key_Pressed and S.UnSteadyOnFire then
3740 Run_Key_Pressed = false
3741 CurrentSteadyTime = 0
3742 end
3743 Fire_Gun()
3744 end
3745 end
3746 if Ammo.Value == 0 and S.AutoReload then
3747 wait(0.2)
3748 Reload()
3749 end
3750 wait(60 / S.FireRate)
3751 end
3752 CanFire = true
3753 end
3754 end))
3755
3756 INSERT(Connections, M2.Button1Up:connect(function()
3757 MB1_Down = false
3758 CurrentSpread = (
3759 Aimed and S.Spread.Aimed or
3760 ((Idleing and (not Walking)) and S.Spread.Hipfire or S.Spread.Walking)
3761 )
3762 end))
3763
3764 INSERT(Connections, M2.Button2Down:connect(function()
3765 if S.HoldMouseOrKeyToADS then
3766 if (not AimingIn) and (not Aimed) then
3767 AimingIn = true
3768 AimGun()
3769 AimingIn = false
3770 end
3771 else
3772 if Aimed then
3773 UnAimGun()
3774 else
3775 AimGun()
3776 end
3777 end
3778 end))
3779
3780 INSERT(Connections, M2.Button2Up:connect(function()
3781 if S.HoldMouseOrKeyToADS then
3782 if (not AimingOut) and Aimed then
3783 AimingOut = true
3784 UnAimGun()
3785 AimingOut = false
3786 end
3787 end
3788 end))
3789
3790 INSERT(Connections, M2.KeyDown:connect(KeyDown))
3791
3792 INSERT(Connections, M2.KeyUp:connect(KeyUp))
3793
3794 INSERT(Connections, RS:connect(function()
3795 local CrossHair = Gui_Clone:WaitForChild("CrossHair")
3796 local HitMarker = Gui_Clone:WaitForChild("HitMarker")
3797 local HUD = Gui_Clone:WaitForChild("HUD")
3798
3799 CrossHair.Position = UDim2.new(0, M2.X, 0, M2.Y)
3800 HitMarker.Position = UDim2.new(0, M2.X - 13, 0, M2.Y - 13)
3801
3802 local Clip_Ammo_L = HUD:WaitForChild("Ammo"):WaitForChild("Clip")
3803 local Stored_Ammo_L = HUD:WaitForChild("Ammo"):WaitForChild("Stored")
3804 Clip_Ammo_L.Text = Ammo.Value
3805 Clip_Ammo_L.TextColor3 = (Ammo.Value <= (ClipSize.Value / 3) and Color3.new(1, 0, 0) or Color3.new(1, 1, 1))
3806 Stored_Ammo_L.Text = StoredAmmo.Value
3807 Stored_Ammo_L.TextColor3 = (StoredAmmo.Value <= (ClipSize.Value * 2) and Color3.new(1, 0, 0) or Color3.new(1, 1, 1))
3808
3809 local Lethal_Grenade_Num_L = HUD:WaitForChild("Grenades"):WaitForChild("Lethals"):WaitForChild("Num")
3810 Lethal_Grenade_Num_L.Text = LethalGrenades.Value
3811 Lethal_Grenade_Num_L.TextColor3 = (LethalGrenades.Value < 3 and Color3.new(1, 0, 0) or Color3.new(1, 1, 1))
3812
3813 local Tactical_Grenade_Num_L = HUD:WaitForChild("Grenades"):WaitForChild("Tacticals"):WaitForChild("Num")
3814 Tactical_Grenade_Num_L.Text = TacticalGrenades.Value
3815 Tactical_Grenade_Num_L.TextColor3 = (TacticalGrenades.Value < 3 and Color3.new(1, 0, 0) or Color3.new(1, 1, 1))
3816
3817 local Mode = HUD:WaitForChild("Mode"):WaitForChild("Main")
3818 if S.GunType.Auto
3819 and (not S.GunType.Semi)
3820 and (not S.GunType.Burst)
3821 and (not S.GunType.Explosive) then
3822
3823 Mode.Text = "Auto"
3824
3825 elseif (not S.GunType.Auto)
3826 and S.GunType.Burst
3827 and (not S.GunType.Explosive) then
3828
3829 Mode.Text = "Burst"
3830
3831 elseif (not S.GunType.Auto)
3832 and S.GunType.Semi
3833 and (not S.GunType.Explosive) then
3834
3835 Mode.Text = "Semi"
3836
3837 elseif (not S.GunType.Auto)
3838 and (not S.GunType.Semi)
3839 and (not S.GunType.Burst)
3840 and S.GunType.Shot
3841 and (not S.GunType.Explosive) then
3842
3843 Mode.Text = "Shotgun"
3844
3845 elseif (not S.GunType.Auto)
3846 and (not S.GunType.Semi)
3847 and S.GunType.Burst
3848 and (not S.GunType.Shot)
3849 and (not S.GunType.Explosive) then
3850
3851 Mode.Text = "Burst"
3852
3853 elseif S.GunType.Explosive then
3854
3855 Mode.Text = "Explosive"
3856
3857 end
3858
3859 if tick() - LastBeat > (Humanoid.Health / 75) then
3860 LastBeat = tick()
3861 HUD.Health.Tray.Beat:TweenPosition(
3862 UDim2.new(0, -21, 0, 0),
3863 Enum.EasingDirection.Out,
3864 Enum.EasingStyle.Linear,
3865 0.7 - ((100 - Humanoid.Health) / 400),
3866 false,
3867 function()
3868 HUD.Health.Tray.Beat.Position = UDim2.new(1, 0, 0, 0)
3869 end
3870 )
3871 end
3872
3873 HUD.Health.Num.Text = CEIL(Humanoid.Health).."%"
3874 HUD.Health.Num.TextColor3 = (
3875 (Humanoid.Health > 200 / 3) and Color3.new(1, 1, 1) or
3876 (Humanoid.Health <= 200 / 3 and Humanoid.Health > 100 / 3) and Color3.new(1, 1, 0) or
3877 (Humanoid.Health <= 100 / 3) and Color3.new(1, 0, 0)
3878 )
3879 end))
3880
3881 INSERT(Connections, RS:connect(function()
3882 local MDir = M2.UnitRay.Direction.unit
3883
3884 local HRPCF = HRP.CFrame * CF(0, 1.5, 0) * CF(Humanoid.CameraOffset)
3885 Neck.C0 = Torso.CFrame:toObjectSpace(HRPCF)
3886
3887 if MDir.y == MDir.y then
3888 HeadRot = -math.asin(MDir.y)
3889 Neck.C1 = CFANG(HeadRot,0,0)
3890
3891 local RotTarget = VEC3(MDir.x,0,MDir.z)
3892 local Rotation = CF(Torso.Position,Torso.Position + RotTarget)
3893 BG.cframe = Rotation
3894
3895 local MouseX = FLOOR((M2.X - M2.ViewSizeX / 2) + 0.5)
3896 local MouseY = FLOOR((M2.Y - M2.ViewSizeY / 2) + 0.5)
3897 local AppliedMaxTorque = nil
3898 if (Camera.CoordinateFrame.p - Head.Position).magnitude < 0.6 then
3899 if (MouseX >= 50 or MouseX <= -50)
3900 or (MouseY >= 50 or MouseY <= -50) then
3901 AppliedMaxTorque = VEC3()
3902 else
3903 AppliedMaxTorque = VEC3(HUGE,HUGE,HUGE)
3904 end
3905 else
3906 AppliedMaxTorque = VEC3(HUGE,HUGE,HUGE)
3907 end
3908 if (not S.RotateWhileSitting) and Humanoid.Sit then
3909 AppliedMaxTorque = VEC3()
3910 end
3911 BG.maxTorque = AppliedMaxTorque
3912 end
3913 end))
3914
3915 INSERT(Connections, RS:connect(function()
3916 local Forward = (Keys["w"] or Keys[string.char(17)])
3917 local Backward = (Keys["s"] or Keys[string.char(18)])
3918 local Right = (Keys["d"] or Keys[string.char(19)])
3919 local Left = (Keys["a"] or Keys[string.char(20)])
3920
3921 local WalkingForward = (Forward and (not Backward))
3922 local WalkingBackward = ((not Forward) and Backward)
3923 local WalkingRight = (Right and (not Left))
3924 local WalkingLeft = ((not Right) and Left)
3925
3926 ArmTilt = (
3927 ((WalkingForward or WalkingBackward) and WalkingRight) and 5 or
3928 ((WalkingForward or WalkingBackward) and WalkingLeft) and -5 or
3929 ((not (WalkingForward and WalkingBackward)) and WalkingRight) and 10 or
3930 ((not (WalkingForward and WalkingBackward)) and WalkingLeft) and -10 or 0
3931 )
3932 end))
3933
3934 INSERT(Connections, RS:connect(function()
3935 if (not Idleing) and Walking then
3936 if Running then
3937 Humanoid.WalkSpeed = S.SprintSpeed
3938 else
3939 local SpeedRatio = (S.AimedWalkSpeed / S.BaseWalkSpeed)
3940 if Stance == 0 then
3941 Humanoid.WalkSpeed = (Aimed and S.AimedWalkSpeed or S.BaseWalkSpeed)
3942 elseif Stance == 1 then
3943 Humanoid.WalkSpeed = (Aimed and S.CrouchWalkSpeed * SpeedRatio or S.CrouchWalkSpeed)
3944 elseif Stance == 2 then
3945 Humanoid.WalkSpeed = (Aimed and S.ProneWalkSpeed * SpeedRatio or S.ProneWalkSpeed)
3946 end
3947 end
3948 else
3949 Humanoid.WalkSpeed = 16
3950 end
3951
3952 StanceSway = 1 - (0.25 * Stance)
3953 end))
3954
3955 --------------------[ ANIMATE GUN ]-------------------------------------------
3956
3957 Animate()
3958 end
3959end
3960
3961
3962function OnUnequipped(DeleteTool)
3963 if Selected then
3964 Selected = false
3965
3966 BreakReload = true
3967
3968 --------------------[ MODIFYING THE PLAYER ]----------------------------------
3969
3970 Camera.FieldOfView = 70
3971
3972 game:GetService("UserInputService").MouseIconEnabled = true
3973
3974 Gui_Clone:Destroy()
3975 BG:Destroy()
3976
3977 RArm.Transparency = 0
3978 LArm.Transparency = 0
3979
3980 Shoulders.Right.Part1 = RArm
3981 Shoulders.Left.Part1 = LArm
3982
3983 Neck.C0 = PrevNeckCF.C0
3984 Neck.C1 = PrevNeckCF.C1
3985
3986 Humanoid.WalkSpeed = 16
3987
3988 --------------------[ RESETING THE TOOL ]-------------------------------------
3989
3990 Gun_Ignore:Destroy()
3991
3992 Aimed = false
3993
3994 for _, Tab in pairs(Parts) do
3995 Tab.Weld:Destroy()
3996 Tab.Weld = nil
3997 end
3998
3999 for _,c in pairs(Connections) do
4000 c:disconnect()
4001 end
4002
4003 Connections = {}
4004
4005 if DeleteTool then
4006 Camera:ClearAllChildren()
4007 Gun:Destroy()
4008 end
4009
4010 if S.StandOnDeselect and Stance ~= 0 then Stand(true) end
4011 end
4012end
4013
4014Gun.Equipped:connect(OnEquipped)
4015Gun.Unequipped:connect(function() OnUnequipped(false) end)
4016
4017--------------------------------------------------------------------------------------
4018--------------------[ END PROGRAM ]---------------------------------------------------
4019--------------------------------------------------------------------------------------
4020end))
4021
4022
4023
4024IntValue5.Name = "Ignore_Code"
4025IntValue5.Parent = LocalScript4
4026ScreenGui6.Name = "Main_Gui"
4027ScreenGui6.Parent = LocalScript4
4028ImageLabel7.Name = "HitMarker"
4029ImageLabel7.Parent = ScreenGui6
4030ImageLabel7.Position = UDim2.new(0.5, -13, 0.5, -13)
4031ImageLabel7.Visible = false
4032ImageLabel7.Transparency = 1
4033ImageLabel7.Size = UDim2.new(0, 26, 0, 26)
4034ImageLabel7.BackgroundTransparency = 1
4035ImageLabel7.ZIndex = 10
4036ImageLabel7.Image = "http://www.roblox.com/asset/?id=121173757"
4037Frame8.Name = "CrossHair"
4038Frame8.Parent = ScreenGui6
4039Frame8.Position = UDim2.new(0.5, 0, 0.5, 0)
4040Frame8.BackgroundColor = BrickColor.new("Institutional white")
4041Frame8.BackgroundColor3 = Color3.new(1, 1, 1)
4042Frame8.BorderColor = BrickColor.new("Really black")
4043Frame8.BorderColor3 = Color3.new(0, 0, 0)
4044Frame8.BorderSizePixel = 0
4045ImageLabel9.Parent = Frame8
4046ImageLabel9.Position = UDim2.new(0, -150, 0, -150)
4047ImageLabel9.Visible = false
4048ImageLabel9.Transparency = 1
4049ImageLabel9.Size = UDim2.new(0, 300, 0, 300)
4050ImageLabel9.BackgroundColor = BrickColor.new("Institutional white")
4051ImageLabel9.BackgroundColor3 = Color3.new(1, 1, 1)
4052ImageLabel9.BackgroundTransparency = 1
4053ImageLabel9.ZIndex = 2
4054ImageLabel9.Image = "http://www.roblox.com/asset/?id=68308747"
4055Frame10.Name = "Box"
4056Frame10.Parent = Frame8
4057Frame10.Position = UDim2.new(0, -35, 0, -35)
4058Frame10.Transparency = 1
4059Frame10.Size = UDim2.new(0, 70, 0, 70)
4060Frame10.BackgroundColor = BrickColor.new("Institutional white")
4061Frame10.BackgroundColor3 = Color3.new(1, 1, 1)
4062Frame10.BackgroundTransparency = 1
4063Frame10.ClipsDescendants = true
4064TextLabel11.Name = "Line"
4065TextLabel11.Parent = Frame10
4066TextLabel11.Position = UDim2.new(0.5, -1, 1, -25)
4067TextLabel11.Size = UDim2.new(0, 2, 0, 25)
4068TextLabel11.BackgroundColor = BrickColor.new("Institutional white")
4069TextLabel11.BackgroundColor3 = Color3.new(1, 1, 1)
4070TextLabel11.BorderColor = BrickColor.new("Really black")
4071TextLabel11.BorderColor3 = Color3.new(0, 0, 0)
4072TextLabel11.BorderSizePixel = 0
4073TextLabel11.Font = Enum.Font.SourceSans
4074TextLabel11.FontSize = Enum.FontSize.Size14
4075TextLabel11.Text = ""
4076TextLabel11.TextSize = 14
4077TextLabel12.Name = "Line"
4078TextLabel12.Parent = Frame10
4079TextLabel12.Position = UDim2.new(0.5, -1, 0, 0)
4080TextLabel12.Size = UDim2.new(0, 2, 0, 25)
4081TextLabel12.BackgroundColor = BrickColor.new("Institutional white")
4082TextLabel12.BackgroundColor3 = Color3.new(1, 1, 1)
4083TextLabel12.BorderColor = BrickColor.new("Really black")
4084TextLabel12.BorderColor3 = Color3.new(0, 0, 0)
4085TextLabel12.BorderSizePixel = 0
4086TextLabel12.Font = Enum.Font.SourceSans
4087TextLabel12.FontSize = Enum.FontSize.Size14
4088TextLabel12.Text = ""
4089TextLabel12.TextSize = 14
4090TextLabel13.Name = "Line"
4091TextLabel13.Parent = Frame10
4092TextLabel13.Position = UDim2.new(1, -25, 0.5, -1)
4093TextLabel13.Size = UDim2.new(0, 25, 0, 2)
4094TextLabel13.BackgroundColor = BrickColor.new("Institutional white")
4095TextLabel13.BackgroundColor3 = Color3.new(1, 1, 1)
4096TextLabel13.BorderColor = BrickColor.new("Really black")
4097TextLabel13.BorderColor3 = Color3.new(0, 0, 0)
4098TextLabel13.BorderSizePixel = 0
4099TextLabel13.Font = Enum.Font.SourceSans
4100TextLabel13.FontSize = Enum.FontSize.Size14
4101TextLabel13.Text = ""
4102TextLabel13.TextSize = 14
4103TextLabel14.Name = "Line"
4104TextLabel14.Parent = Frame10
4105TextLabel14.Position = UDim2.new(0, 0, 0.5, -1)
4106TextLabel14.Size = UDim2.new(0, 25, 0, 2)
4107TextLabel14.BackgroundColor = BrickColor.new("Institutional white")
4108TextLabel14.BackgroundColor3 = Color3.new(1, 1, 1)
4109TextLabel14.BorderColor = BrickColor.new("Really black")
4110TextLabel14.BorderColor3 = Color3.new(0, 0, 0)
4111TextLabel14.BorderSizePixel = 0
4112TextLabel14.Font = Enum.Font.SourceSans
4113TextLabel14.FontSize = Enum.FontSize.Size14
4114TextLabel14.Text = ""
4115TextLabel14.TextSize = 14
4116TextLabel15.Name = "Reload"
4117TextLabel15.Parent = Frame8
4118TextLabel15.Position = UDim2.new(0, -50, 0, 70)
4119TextLabel15.Visible = false
4120TextLabel15.Transparency = 1
4121TextLabel15.Size = UDim2.new(0, 100, 0, 20)
4122TextLabel15.BackgroundColor = BrickColor.new("Institutional white")
4123TextLabel15.BackgroundColor3 = Color3.new(1, 1, 1)
4124TextLabel15.BackgroundTransparency = 1
4125TextLabel15.ZIndex = 2
4126TextLabel15.Font = Enum.Font.ArialBold
4127TextLabel15.FontSize = Enum.FontSize.Size18
4128TextLabel15.Text = "Reloading..."
4129TextLabel15.TextColor = BrickColor.new("Institutional white")
4130TextLabel15.TextColor3 = Color3.new(1, 1, 1)
4131TextLabel15.TextSize = 18
4132TextLabel15.TextStrokeTransparency = 0.5
4133Frame16.Name = "HUD"
4134Frame16.Parent = ScreenGui6
4135Frame16.Position = UDim2.new(1, -200, 1, -125)
4136Frame16.Transparency = 0.30000001192093
4137Frame16.Size = UDim2.new(0, 175, 0, 75)
4138Frame16.BackgroundColor = BrickColor.new("Black")
4139Frame16.BackgroundColor3 = Color3.new(0.156863, 0.156863, 0.156863)
4140Frame16.BackgroundTransparency = 0.30000001192093
4141Frame16.BorderColor3 = Color3.new(0.156863, 0.156863, 0.156863)
4142Frame16.BorderSizePixel = 5
4143Frame17.Name = "Ammo"
4144Frame17.Parent = Frame16
4145Frame17.Transparency = 1
4146Frame17.Size = UDim2.new(0, 175, 0, 50)
4147Frame17.BackgroundTransparency = 1
4148TextLabel18.Name = "Slash"
4149TextLabel18.Parent = Frame17
4150TextLabel18.Position = UDim2.new(0, 95, 0, 0)
4151TextLabel18.Transparency = 1
4152TextLabel18.Size = UDim2.new(0, 10, 0, 30)
4153TextLabel18.BackgroundTransparency = 1
4154TextLabel18.ZIndex = 10
4155TextLabel18.Font = Enum.Font.ArialBold
4156TextLabel18.FontSize = Enum.FontSize.Size36
4157TextLabel18.Text = "/"
4158TextLabel18.TextColor = BrickColor.new("Institutional white")
4159TextLabel18.TextColor3 = Color3.new(1, 1, 1)
4160TextLabel18.TextSize = 36
4161TextLabel19.Name = "Stored"
4162TextLabel19.Parent = Frame17
4163TextLabel19.Position = UDim2.new(0, 115, 0, 0)
4164TextLabel19.Transparency = 1
4165TextLabel19.Size = UDim2.new(0, 55, 0, 30)
4166TextLabel19.BackgroundTransparency = 1
4167TextLabel19.ZIndex = 10
4168TextLabel19.Font = Enum.Font.Arial
4169TextLabel19.FontSize = Enum.FontSize.Size36
4170TextLabel19.Text = "124"
4171TextLabel19.TextColor = BrickColor.new("Institutional white")
4172TextLabel19.TextColor3 = Color3.new(1, 1, 1)
4173TextLabel19.TextSize = 36
4174TextLabel19.TextXAlignment = Enum.TextXAlignment.Left
4175TextLabel20.Name = "Background"
4176TextLabel20.Parent = TextLabel19
4177TextLabel20.Transparency = 1
4178TextLabel20.Size = UDim2.new(1, 0, 1, 0)
4179TextLabel20.BackgroundTransparency = 1
4180TextLabel20.ZIndex = 10
4181TextLabel20.Font = Enum.Font.Arial
4182TextLabel20.FontSize = Enum.FontSize.Size36
4183TextLabel20.Text = "000"
4184TextLabel20.TextColor = BrickColor.new("Sand violet metallic")
4185TextLabel20.TextColor3 = Color3.new(0.588235, 0.588235, 0.588235)
4186TextLabel20.TextSize = 36
4187TextLabel20.TextTransparency = 0.80000001192093
4188TextLabel20.TextWrap = true
4189TextLabel20.TextWrapped = true
4190TextLabel20.TextXAlignment = Enum.TextXAlignment.Left
4191TextLabel21.Name = "Clip"
4192TextLabel21.Parent = Frame17
4193TextLabel21.Transparency = 1
4194TextLabel21.Size = UDim2.new(0, 85, 0, 50)
4195TextLabel21.BackgroundTransparency = 1
4196TextLabel21.ZIndex = 10
4197TextLabel21.FontSize = Enum.FontSize.Size36
4198TextLabel21.Text = "100"
4199TextLabel21.TextColor = BrickColor.new("Institutional white")
4200TextLabel21.TextColor3 = Color3.new(1, 1, 1)
4201TextLabel21.TextSize = 36
4202TextLabel21.TextXAlignment = Enum.TextXAlignment.Right
4203TextLabel22.Name = "Background"
4204TextLabel22.Parent = TextLabel21
4205TextLabel22.Transparency = 1
4206TextLabel22.Size = UDim2.new(1, 0, 1, 0)
4207TextLabel22.BackgroundTransparency = 1
4208TextLabel22.ZIndex = 10
4209TextLabel22.FontSize = Enum.FontSize.Size36
4210TextLabel22.Text = "000"
4211TextLabel22.TextColor = BrickColor.new("Sand violet metallic")
4212TextLabel22.TextColor3 = Color3.new(0.588235, 0.588235, 0.588235)
4213TextLabel22.TextSize = 36
4214TextLabel22.TextTransparency = 0.80000001192093
4215TextLabel22.TextXAlignment = Enum.TextXAlignment.Right
4216Frame23.Name = "Mode"
4217Frame23.Parent = Frame16
4218Frame23.Position = UDim2.new(0, 95, 0, 27)
4219Frame23.Transparency = 1
4220Frame23.Size = UDim2.new(0, 80, 0, 20)
4221Frame23.BackgroundColor = BrickColor.new("Institutional white")
4222Frame23.BackgroundColor3 = Color3.new(1, 1, 1)
4223Frame23.BackgroundTransparency = 1
4224TextLabel24.Name = "Bracket"
4225TextLabel24.Parent = Frame23
4226TextLabel24.Transparency = 1
4227TextLabel24.Size = UDim2.new(0, 5, 0, 20)
4228TextLabel24.BackgroundTransparency = 1
4229TextLabel24.ZIndex = 10
4230TextLabel24.Font = Enum.Font.ArialBold
4231TextLabel24.FontSize = Enum.FontSize.Size18
4232TextLabel24.Text = "["
4233TextLabel24.TextColor = BrickColor.new("Institutional white")
4234TextLabel24.TextColor3 = Color3.new(1, 1, 1)
4235TextLabel24.TextSize = 18
4236TextLabel24.TextWrap = true
4237TextLabel24.TextWrapped = true
4238TextLabel24.TextXAlignment = Enum.TextXAlignment.Left
4239TextLabel25.Name = "Bracket"
4240TextLabel25.Parent = Frame23
4241TextLabel25.Position = UDim2.new(1, -5, 0, 0)
4242TextLabel25.Transparency = 1
4243TextLabel25.Size = UDim2.new(0, 5, 0, 20)
4244TextLabel25.BackgroundTransparency = 1
4245TextLabel25.ZIndex = 10
4246TextLabel25.Font = Enum.Font.ArialBold
4247TextLabel25.FontSize = Enum.FontSize.Size18
4248TextLabel25.Text = "]"
4249TextLabel25.TextColor = BrickColor.new("Institutional white")
4250TextLabel25.TextColor3 = Color3.new(1, 1, 1)
4251TextLabel25.TextSize = 18
4252TextLabel25.TextWrap = true
4253TextLabel25.TextWrapped = true
4254TextLabel25.TextXAlignment = Enum.TextXAlignment.Left
4255TextLabel26.Name = "Main"
4256TextLabel26.Parent = Frame23
4257TextLabel26.Transparency = 1
4258TextLabel26.Size = UDim2.new(1, 0, 0, 20)
4259TextLabel26.BackgroundTransparency = 1
4260TextLabel26.ZIndex = 10
4261TextLabel26.Font = Enum.Font.SourceSansBold
4262TextLabel26.FontSize = Enum.FontSize.Size18
4263TextLabel26.Text = "Auto"
4264TextLabel26.TextColor = BrickColor.new("Institutional white")
4265TextLabel26.TextColor3 = Color3.new(1, 1, 1)
4266TextLabel26.TextSize = 18
4267TextLabel26.TextWrap = true
4268TextLabel26.TextWrapped = true
4269Frame27.Name = "Health"
4270Frame27.Parent = Frame16
4271Frame27.Position = UDim2.new(0, 0, 0, -40)
4272Frame27.Transparency = 0.30000001192093
4273Frame27.Size = UDim2.new(1, 0, 0, 25)
4274Frame27.BackgroundColor = BrickColor.new("Black")
4275Frame27.BackgroundColor3 = Color3.new(0.156863, 0.156863, 0.156863)
4276Frame27.BackgroundTransparency = 0.30000001192093
4277Frame27.BorderColor3 = Color3.new(0.156863, 0.156863, 0.156863)
4278Frame27.BorderSizePixel = 5
4279TextLabel28.Name = "Num"
4280TextLabel28.Parent = Frame27
4281TextLabel28.Position = UDim2.new(1, -50, 0, 0)
4282TextLabel28.Transparency = 1
4283TextLabel28.Size = UDim2.new(0, 50, 1, 0)
4284TextLabel28.BackgroundColor = BrickColor.new("Really black")
4285TextLabel28.BackgroundColor3 = Color3.new(0, 0, 0)
4286TextLabel28.BackgroundTransparency = 1
4287TextLabel28.BorderColor = BrickColor.new("Really black")
4288TextLabel28.BorderColor3 = Color3.new(0, 0, 0)
4289TextLabel28.BorderSizePixel = 0
4290TextLabel28.ZIndex = 10
4291TextLabel28.Font = Enum.Font.ArialBold
4292TextLabel28.FontSize = Enum.FontSize.Size24
4293TextLabel28.Text = "100%"
4294TextLabel28.TextColor = BrickColor.new("Institutional white")
4295TextLabel28.TextColor3 = Color3.new(1, 1, 1)
4296TextLabel28.TextSize = 24
4297TextLabel28.TextXAlignment = Enum.TextXAlignment.Right
4298Frame29.Name = "Tray"
4299Frame29.Parent = Frame27
4300Frame29.Position = UDim2.new(0, 2, 0.5, -10)
4301Frame29.Transparency = 1
4302Frame29.Size = UDim2.new(1, -60, 0, 20)
4303Frame29.BackgroundColor = BrickColor.new("Really black")
4304Frame29.BackgroundColor3 = Color3.new(0, 0, 0)
4305Frame29.BackgroundTransparency = 1
4306Frame29.BorderColor = BrickColor.new("Really black")
4307Frame29.BorderColor3 = Color3.new(0, 0, 0)
4308Frame29.BorderSizePixel = 0
4309Frame29.ClipsDescendants = true
4310Frame29.ZIndex = 10
4311Frame30.Name = "Beat"
4312Frame30.Parent = Frame29
4313Frame30.Position = UDim2.new(1, 0, 0, 0)
4314Frame30.Transparency = 1
4315Frame30.Size = UDim2.new(0, 21, 1, 0)
4316Frame30.BackgroundColor = BrickColor.new("Really black")
4317Frame30.BackgroundColor3 = Color3.new(0, 0, 0)
4318Frame30.BackgroundTransparency = 1
4319Frame30.BorderColor = BrickColor.new("Really black")
4320Frame30.BorderColor3 = Color3.new(0, 0, 0)
4321Frame30.BorderSizePixel = 0
4322Frame30.ZIndex = 10
4323Frame31.Name = "00"
4324Frame31.Parent = Frame30
4325Frame31.Position = UDim2.new(0, 0, 0.5, -2)
4326Frame31.Size = UDim2.new(0.0476190485, 0, 0, 3)
4327Frame31.BackgroundColor = BrickColor.new("Institutional white")
4328Frame31.BackgroundColor3 = Color3.new(1, 1, 1)
4329Frame31.BorderColor = BrickColor.new("Really black")
4330Frame31.BorderColor3 = Color3.new(0, 0, 0)
4331Frame31.BorderSizePixel = 0
4332Frame31.ZIndex = 10
4333Frame32.Name = "01"
4334Frame32.Parent = Frame30
4335Frame32.Position = UDim2.new(0.0476190485, 0, 0.423076928, -2)
4336Frame32.Size = UDim2.new(0.0476190485, 0, 0, 4)
4337Frame32.BackgroundColor = BrickColor.new("Institutional white")
4338Frame32.BackgroundColor3 = Color3.new(1, 1, 1)
4339Frame32.BorderColor = BrickColor.new("Really black")
4340Frame32.BorderColor3 = Color3.new(0, 0, 0)
4341Frame32.BorderSizePixel = 0
4342Frame32.ZIndex = 10
4343Frame33.Name = "02"
4344Frame33.Parent = Frame30
4345Frame33.Position = UDim2.new(0.095238097, 0, 0.346153855, -2)
4346Frame33.Size = UDim2.new(0.0476190485, 0, 0, 4)
4347Frame33.BackgroundColor = BrickColor.new("Institutional white")
4348Frame33.BackgroundColor3 = Color3.new(1, 1, 1)
4349Frame33.BorderColor = BrickColor.new("Really black")
4350Frame33.BorderColor3 = Color3.new(0, 0, 0)
4351Frame33.BorderSizePixel = 0
4352Frame33.ZIndex = 10
4353Frame34.Name = "03"
4354Frame34.Parent = Frame30
4355Frame34.Position = UDim2.new(0.142857149, 0, 0.269230783, -2)
4356Frame34.Size = UDim2.new(0.0476190485, 0, 0, 4)
4357Frame34.BackgroundColor = BrickColor.new("Institutional white")
4358Frame34.BackgroundColor3 = Color3.new(1, 1, 1)
4359Frame34.BorderColor = BrickColor.new("Really black")
4360Frame34.BorderColor3 = Color3.new(0, 0, 0)
4361Frame34.BorderSizePixel = 0
4362Frame34.ZIndex = 10
4363Frame35.Name = "04"
4364Frame35.Parent = Frame30
4365Frame35.Position = UDim2.new(0.190476194, 0, 0.192307696, -2)
4366Frame35.Size = UDim2.new(0.0476190485, 0, 0, 4)
4367Frame35.BackgroundColor = BrickColor.new("Institutional white")
4368Frame35.BackgroundColor3 = Color3.new(1, 1, 1)
4369Frame35.BorderColor = BrickColor.new("Really black")
4370Frame35.BorderColor3 = Color3.new(0, 0, 0)
4371Frame35.BorderSizePixel = 0
4372Frame35.ZIndex = 10
4373Frame36.Name = "05"
4374Frame36.Parent = Frame30
4375Frame36.Position = UDim2.new(0.238095239, 0, 0.115384616, -2)
4376Frame36.Size = UDim2.new(0.0476190485, 0, 0, 4)
4377Frame36.BackgroundColor = BrickColor.new("Institutional white")
4378Frame36.BackgroundColor3 = Color3.new(1, 1, 1)
4379Frame36.BorderColor = BrickColor.new("Really black")
4380Frame36.BorderColor3 = Color3.new(0, 0, 0)
4381Frame36.BorderSizePixel = 0
4382Frame36.ZIndex = 10
4383Frame37.Name = "06"
4384Frame37.Parent = Frame30
4385Frame37.Position = UDim2.new(0.285714298, 0, 0.0384615399, -2)
4386Frame37.Size = UDim2.new(0.0476190485, 0, 0, 4)
4387Frame37.BackgroundColor = BrickColor.new("Institutional white")
4388Frame37.BackgroundColor3 = Color3.new(1, 1, 1)
4389Frame37.BorderColor = BrickColor.new("Really black")
4390Frame37.BorderColor3 = Color3.new(0, 0, 0)
4391Frame37.BorderSizePixel = 0
4392Frame37.ZIndex = 10
4393Frame38.Name = "07"
4394Frame38.Parent = Frame30
4395Frame38.Position = UDim2.new(0.333333343, 0, 0, -2)
4396Frame38.Size = UDim2.new(0.0476190485, 0, 0, 4)
4397Frame38.BackgroundColor = BrickColor.new("Institutional white")
4398Frame38.BackgroundColor3 = Color3.new(1, 1, 1)
4399Frame38.BorderColor = BrickColor.new("Really black")
4400Frame38.BorderColor3 = Color3.new(0, 0, 0)
4401Frame38.BorderSizePixel = 0
4402Frame38.ZIndex = 10
4403Frame39.Name = "08"
4404Frame39.Parent = Frame30
4405Frame39.Position = UDim2.new(0.380952388, 0, 0.142857149, -2)
4406Frame39.Size = UDim2.new(0.0476190485, 0, 0, 4)
4407Frame39.BackgroundColor = BrickColor.new("Institutional white")
4408Frame39.BackgroundColor3 = Color3.new(1, 1, 1)
4409Frame39.BorderColor = BrickColor.new("Really black")
4410Frame39.BorderColor3 = Color3.new(0, 0, 0)
4411Frame39.BorderSizePixel = 0
4412Frame39.ZIndex = 10
4413Frame40.Name = "09"
4414Frame40.Parent = Frame30
4415Frame40.Position = UDim2.new(0.428571433, 0, 0.285714298, -2)
4416Frame40.Size = UDim2.new(0.0476190485, 0, 0, 4)
4417Frame40.BackgroundColor = BrickColor.new("Institutional white")
4418Frame40.BackgroundColor3 = Color3.new(1, 1, 1)
4419Frame40.BorderColor = BrickColor.new("Really black")
4420Frame40.BorderColor3 = Color3.new(0, 0, 0)
4421Frame40.BorderSizePixel = 0
4422Frame40.ZIndex = 10
4423Frame41.Name = "10"
4424Frame41.Parent = Frame30
4425Frame41.Position = UDim2.new(0.476190478, 0, 0.428571433, -2)
4426Frame41.Size = UDim2.new(0.0476190485, 0, 0, 4)
4427Frame41.BackgroundColor = BrickColor.new("Institutional white")
4428Frame41.BackgroundColor3 = Color3.new(1, 1, 1)
4429Frame41.BorderColor = BrickColor.new("Really black")
4430Frame41.BorderColor3 = Color3.new(0, 0, 0)
4431Frame41.BorderSizePixel = 0
4432Frame41.ZIndex = 10
4433Frame42.Name = "11"
4434Frame42.Parent = Frame30
4435Frame42.Position = UDim2.new(0.523809552, 0, 0.571428597, -2)
4436Frame42.Size = UDim2.new(0.0476190485, 0, 0, 4)
4437Frame42.BackgroundColor = BrickColor.new("Institutional white")
4438Frame42.BackgroundColor3 = Color3.new(1, 1, 1)
4439Frame42.BorderColor = BrickColor.new("Really black")
4440Frame42.BorderColor3 = Color3.new(0, 0, 0)
4441Frame42.BorderSizePixel = 0
4442Frame42.ZIndex = 10
4443Frame43.Name = "12"
4444Frame43.Parent = Frame30
4445Frame43.Position = UDim2.new(0.571428597, 0, 0.714285731, -2)
4446Frame43.Size = UDim2.new(0.0476190485, 0, 0, 4)
4447Frame43.BackgroundColor = BrickColor.new("Institutional white")
4448Frame43.BackgroundColor3 = Color3.new(1, 1, 1)
4449Frame43.BorderColor = BrickColor.new("Really black")
4450Frame43.BorderColor3 = Color3.new(0, 0, 0)
4451Frame43.BorderSizePixel = 0
4452Frame43.ZIndex = 10
4453Frame44.Name = "13"
4454Frame44.Parent = Frame30
4455Frame44.Position = UDim2.new(0.619047642, 0, 0.857142866, -2)
4456Frame44.Size = UDim2.new(0.0476190485, 0, 0, 4)
4457Frame44.BackgroundColor = BrickColor.new("Institutional white")
4458Frame44.BackgroundColor3 = Color3.new(1, 1, 1)
4459Frame44.BorderColor = BrickColor.new("Really black")
4460Frame44.BorderColor3 = Color3.new(0, 0, 0)
4461Frame44.BorderSizePixel = 0
4462Frame44.ZIndex = 10
4463Frame45.Name = "14"
4464Frame45.Parent = Frame30
4465Frame45.Position = UDim2.new(0.666666687, 0, 0.916666687, -2)
4466Frame45.Size = UDim2.new(0.0476190485, 0, 0, 4)
4467Frame45.BackgroundColor = BrickColor.new("Institutional white")
4468Frame45.BackgroundColor3 = Color3.new(1, 1, 1)
4469Frame45.BorderColor = BrickColor.new("Really black")
4470Frame45.BorderColor3 = Color3.new(0, 0, 0)
4471Frame45.BorderSizePixel = 0
4472Frame45.ZIndex = 10
4473Frame46.Name = "15"
4474Frame46.Parent = Frame30
4475Frame46.Position = UDim2.new(0.714285731, 0, 0.833333313, -2)
4476Frame46.Size = UDim2.new(0.0476190485, 0, 0, 4)
4477Frame46.BackgroundColor = BrickColor.new("Institutional white")
4478Frame46.BackgroundColor3 = Color3.new(1, 1, 1)
4479Frame46.BorderColor = BrickColor.new("Really black")
4480Frame46.BorderColor3 = Color3.new(0, 0, 0)
4481Frame46.BorderSizePixel = 0
4482Frame46.ZIndex = 10
4483Frame47.Name = "16"
4484Frame47.Parent = Frame30
4485Frame47.Position = UDim2.new(0.761904776, 0, 0.75, -2)
4486Frame47.Size = UDim2.new(0.0476190485, 0, 0, 4)
4487Frame47.BackgroundColor = BrickColor.new("Institutional white")
4488Frame47.BackgroundColor3 = Color3.new(1, 1, 1)
4489Frame47.BorderColor = BrickColor.new("Really black")
4490Frame47.BorderColor3 = Color3.new(0, 0, 0)
4491Frame47.BorderSizePixel = 0
4492Frame47.ZIndex = 10
4493Frame48.Name = "17"
4494Frame48.Parent = Frame30
4495Frame48.Position = UDim2.new(0.809523821, 0, 0.666666687, -2)
4496Frame48.Size = UDim2.new(0.0476190485, 0, 0, 4)
4497Frame48.BackgroundColor = BrickColor.new("Institutional white")
4498Frame48.BackgroundColor3 = Color3.new(1, 1, 1)
4499Frame48.BorderColor = BrickColor.new("Really black")
4500Frame48.BorderColor3 = Color3.new(0, 0, 0)
4501Frame48.BorderSizePixel = 0
4502Frame48.ZIndex = 10
4503Frame49.Name = "18"
4504Frame49.Parent = Frame30
4505Frame49.Position = UDim2.new(0.857142866, 0, 0.583333313, -2)
4506Frame49.Size = UDim2.new(0.0476190485, 0, 0, 4)
4507Frame49.BackgroundColor = BrickColor.new("Institutional white")
4508Frame49.BackgroundColor3 = Color3.new(1, 1, 1)
4509Frame49.BorderColor = BrickColor.new("Really black")
4510Frame49.BorderColor3 = Color3.new(0, 0, 0)
4511Frame49.BorderSizePixel = 0
4512Frame49.ZIndex = 10
4513Frame50.Name = "19"
4514Frame50.Parent = Frame30
4515Frame50.Position = UDim2.new(0.90476191, 0, 0.5, -2)
4516Frame50.Size = UDim2.new(0.0476190485, 0, 0, 4)
4517Frame50.BackgroundColor = BrickColor.new("Institutional white")
4518Frame50.BackgroundColor3 = Color3.new(1, 1, 1)
4519Frame50.BorderColor = BrickColor.new("Really black")
4520Frame50.BorderColor3 = Color3.new(0, 0, 0)
4521Frame50.BorderSizePixel = 0
4522Frame50.ZIndex = 10
4523Frame51.Name = "20"
4524Frame51.Parent = Frame30
4525Frame51.Position = UDim2.new(0.952000022, 0, 0.49000001, -2)
4526Frame51.Size = UDim2.new(0.0476190485, 0, 0, 4)
4527Frame51.BackgroundColor = BrickColor.new("Institutional white")
4528Frame51.BackgroundColor3 = Color3.new(1, 1, 1)
4529Frame51.BorderColor = BrickColor.new("Really black")
4530Frame51.BorderColor3 = Color3.new(0, 0, 0)
4531Frame51.BorderSizePixel = 0
4532Frame51.ZIndex = 10
4533Frame52.Name = "Line"
4534Frame52.Parent = Frame30
4535Frame52.Position = UDim2.new(1, 0, 0.5, -2)
4536Frame52.Size = UDim2.new(0, 200, 0, 3)
4537Frame52.BackgroundColor = BrickColor.new("Institutional white")
4538Frame52.BackgroundColor3 = Color3.new(1, 1, 1)
4539Frame52.BorderColor = BrickColor.new("Really black")
4540Frame52.BorderColor3 = Color3.new(0, 0, 0)
4541Frame52.BorderSizePixel = 0
4542Frame52.ZIndex = 10
4543Frame53.Name = "Line"
4544Frame53.Parent = Frame30
4545Frame53.Position = UDim2.new(0, -200, 0.5, -2)
4546Frame53.Size = UDim2.new(0, 200, 0, 3)
4547Frame53.BackgroundColor = BrickColor.new("Institutional white")
4548Frame53.BackgroundColor3 = Color3.new(1, 1, 1)
4549Frame53.BorderColor = BrickColor.new("Really black")
4550Frame53.BorderColor3 = Color3.new(0, 0, 0)
4551Frame53.BorderSizePixel = 0
4552Frame53.ZIndex = 10
4553Frame54.Name = "Controls"
4554Frame54.Parent = Frame16
4555Frame54.Position = UDim2.new(0, 0, 0, -200)
4556Frame54.Transparency = 0.30000001192093
4557Frame54.Size = UDim2.new(1, 0, 0, 120)
4558Frame54.BackgroundColor = BrickColor.new("Black")
4559Frame54.BackgroundColor3 = Color3.new(0.156863, 0.156863, 0.156863)
4560Frame54.BackgroundTransparency = 0.30000001192093
4561Frame54.BorderColor3 = Color3.new(0.156863, 0.156863, 0.156863)
4562Frame54.BorderSizePixel = 5
4563TextLabel55.Name = "Title"
4564TextLabel55.Parent = Frame54
4565TextLabel55.Transparency = 1
4566TextLabel55.Size = UDim2.new(1, 0, 0, 15)
4567TextLabel55.BackgroundColor = BrickColor.new("Institutional white")
4568TextLabel55.BackgroundColor3 = Color3.new(1, 1, 1)
4569TextLabel55.BackgroundTransparency = 1
4570TextLabel55.Font = Enum.Font.SourceSansBold
4571TextLabel55.FontSize = Enum.FontSize.Size14
4572TextLabel55.Text = "CONTROLS"
4573TextLabel55.TextColor = BrickColor.new("Institutional white")
4574TextLabel55.TextColor3 = Color3.new(1, 1, 1)
4575TextLabel55.TextSize = 14
4576TextLabel56.Name = "Line"
4577TextLabel56.Parent = TextLabel55
4578TextLabel56.Position = UDim2.new(0, 0, 1, 1)
4579TextLabel56.Size = UDim2.new(1, 0, 0, 2)
4580TextLabel56.BackgroundColor = BrickColor.new("New Yeller")
4581TextLabel56.BackgroundColor3 = Color3.new(1, 1, 0)
4582TextLabel56.BorderSizePixel = 0
4583TextLabel56.Font = Enum.Font.SourceSans
4584TextLabel56.FontSize = Enum.FontSize.Size14
4585TextLabel56.Text = ""
4586TextLabel56.TextSize = 14
4587TextLabel57.Name = "Co"
4588TextLabel57.Parent = Frame16
4589TextLabel57.Position = UDim2.new(0, 0, 1, 5)
4590TextLabel57.Transparency = 1
4591TextLabel57.Size = UDim2.new(1, 0, 0, 20)
4592TextLabel57.BackgroundColor = BrickColor.new("Institutional white")
4593TextLabel57.BackgroundColor3 = Color3.new(1, 1, 1)
4594TextLabel57.BackgroundTransparency = 1
4595TextLabel57.Font = Enum.Font.ArialBold
4596TextLabel57.FontSize = Enum.FontSize.Size14
4597TextLabel57.Text = "Gun Kit made by TurboFusion"
4598TextLabel57.TextColor = BrickColor.new("New Yeller")
4599TextLabel57.TextColor3 = Color3.new(1, 1, 0)
4600TextLabel57.TextSize = 14
4601TextLabel57.TextStrokeTransparency = 0
4602TextLabel57.TextWrap = true
4603TextLabel57.TextWrapped = true
4604TextLabel57.TextXAlignment = Enum.TextXAlignment.Right
4605TextLabel58.Name = "Version"
4606TextLabel58.Parent = Frame16
4607TextLabel58.Position = UDim2.new(0, 0, 1, 25)
4608TextLabel58.Transparency = 1
4609TextLabel58.Size = UDim2.new(1, 0, 0, 15)
4610TextLabel58.BackgroundColor = BrickColor.new("Institutional white")
4611TextLabel58.BackgroundColor3 = Color3.new(1, 1, 1)
4612TextLabel58.BackgroundTransparency = 1
4613TextLabel58.Font = Enum.Font.ArialBold
4614TextLabel58.FontSize = Enum.FontSize.Size14
4615TextLabel58.Text = "v0.0.3"
4616TextLabel58.TextColor = BrickColor.new("New Yeller")
4617TextLabel58.TextColor3 = Color3.new(1, 1, 0)
4618TextLabel58.TextSize = 14
4619TextLabel58.TextStrokeTransparency = 0
4620TextLabel58.TextWrap = true
4621TextLabel58.TextWrapped = true
4622TextLabel58.TextXAlignment = Enum.TextXAlignment.Right
4623Frame59.Name = "Grenades"
4624Frame59.Parent = Frame16
4625Frame59.Position = UDim2.new(0, 0, 0, 50)
4626Frame59.Transparency = 1
4627Frame59.Size = UDim2.new(0, 175, 0, 25)
4628Frame59.BackgroundTransparency = 1
4629Frame60.Name = "Lethals"
4630Frame60.Parent = Frame59
4631Frame60.Transparency = 1
4632Frame60.Size = UDim2.new(0.5, -2, 1, 0)
4633Frame60.BackgroundColor = BrickColor.new("Institutional white")
4634Frame60.BackgroundColor3 = Color3.new(1, 1, 1)
4635Frame60.BackgroundTransparency = 1
4636Frame61.Name = "Lines"
4637Frame61.Parent = Frame60
4638Frame61.Transparency = 1
4639Frame61.Size = UDim2.new(1, 0, 1, 0)
4640Frame61.BackgroundColor = BrickColor.new("Institutional white")
4641Frame61.BackgroundColor3 = Color3.new(1, 1, 1)
4642Frame61.BackgroundTransparency = 1
4643TextLabel62.Name = "Line"
4644TextLabel62.Parent = Frame61
4645TextLabel62.Size = UDim2.new(1, 0, 0, 2)
4646TextLabel62.BackgroundColor = BrickColor.new("Institutional white")
4647TextLabel62.BackgroundColor3 = Color3.new(1, 1, 1)
4648TextLabel62.BorderSizePixel = 0
4649TextLabel62.Font = Enum.Font.SourceSans
4650TextLabel62.FontSize = Enum.FontSize.Size14
4651TextLabel62.Text = ""
4652TextLabel62.TextSize = 14
4653TextLabel63.Name = "Line"
4654TextLabel63.Parent = Frame61
4655TextLabel63.Position = UDim2.new(0, 0, 1, -2)
4656TextLabel63.Size = UDim2.new(1, 0, 0, 2)
4657TextLabel63.BackgroundColor = BrickColor.new("Institutional white")
4658TextLabel63.BackgroundColor3 = Color3.new(1, 1, 1)
4659TextLabel63.BorderSizePixel = 0
4660TextLabel63.Font = Enum.Font.SourceSans
4661TextLabel63.FontSize = Enum.FontSize.Size14
4662TextLabel63.Text = ""
4663TextLabel63.TextSize = 14
4664TextLabel64.Name = "Line"
4665TextLabel64.Parent = Frame61
4666TextLabel64.Size = UDim2.new(0, 2, 1, 0)
4667TextLabel64.BackgroundColor = BrickColor.new("Institutional white")
4668TextLabel64.BackgroundColor3 = Color3.new(1, 1, 1)
4669TextLabel64.BorderSizePixel = 0
4670TextLabel64.Font = Enum.Font.SourceSans
4671TextLabel64.FontSize = Enum.FontSize.Size14
4672TextLabel64.Text = ""
4673TextLabel64.TextSize = 14
4674TextLabel65.Name = "Line"
4675TextLabel65.Parent = Frame61
4676TextLabel65.Position = UDim2.new(1, -2, 0, 0)
4677TextLabel65.Size = UDim2.new(0, 2, 1, 0)
4678TextLabel65.BackgroundColor = BrickColor.new("Institutional white")
4679TextLabel65.BackgroundColor3 = Color3.new(1, 1, 1)
4680TextLabel65.BorderSizePixel = 0
4681TextLabel65.Font = Enum.Font.SourceSans
4682TextLabel65.FontSize = Enum.FontSize.Size14
4683TextLabel65.Text = ""
4684TextLabel65.TextSize = 14
4685ImageLabel66.Name = "Icon"
4686ImageLabel66.Parent = Frame60
4687ImageLabel66.Position = UDim2.new(0, 7, 0, 2)
4688ImageLabel66.Transparency = 1
4689ImageLabel66.Size = UDim2.new(0, 21, 0, 21)
4690ImageLabel66.BackgroundColor = BrickColor.new("Institutional white")
4691ImageLabel66.BackgroundColor3 = Color3.new(1, 1, 1)
4692ImageLabel66.BackgroundTransparency = 1
4693TextLabel67.Name = "Dash"
4694TextLabel67.Parent = Frame60
4695TextLabel67.Position = UDim2.new(0.5, -8, 0.5, -1)
4696TextLabel67.Size = UDim2.new(0, 16, 0, 2)
4697TextLabel67.BackgroundColor = BrickColor.new("Institutional white")
4698TextLabel67.BackgroundColor3 = Color3.new(1, 1, 1)
4699TextLabel67.BorderSizePixel = 0
4700TextLabel67.Font = Enum.Font.ArialBold
4701TextLabel67.FontSize = Enum.FontSize.Size18
4702TextLabel67.Text = ""
4703TextLabel67.TextColor = BrickColor.new("Institutional white")
4704TextLabel67.TextColor3 = Color3.new(1, 1, 1)
4705TextLabel67.TextSize = 18
4706TextLabel68.Name = "Num"
4707TextLabel68.Parent = Frame60
4708TextLabel68.Position = UDim2.new(1, -7, 0, 0)
4709TextLabel68.Transparency = 1
4710TextLabel68.Size = UDim2.new(0, 0, 1, 0)
4711TextLabel68.BackgroundColor = BrickColor.new("Institutional white")
4712TextLabel68.BackgroundColor3 = Color3.new(1, 1, 1)
4713TextLabel68.BackgroundTransparency = 1
4714TextLabel68.Font = Enum.Font.ArialBold
4715TextLabel68.FontSize = Enum.FontSize.Size18
4716TextLabel68.Text = "0"
4717TextLabel68.TextColor = BrickColor.new("Institutional white")
4718TextLabel68.TextColor3 = Color3.new(1, 1, 1)
4719TextLabel68.TextSize = 18
4720TextLabel68.TextXAlignment = Enum.TextXAlignment.Right
4721Frame69.Name = "Tacticals"
4722Frame69.Parent = Frame59
4723Frame69.Position = UDim2.new(0.5, 2, 0, 0)
4724Frame69.Transparency = 1
4725Frame69.Size = UDim2.new(0.5, -2, 1, 0)
4726Frame69.BackgroundColor = BrickColor.new("Institutional white")
4727Frame69.BackgroundColor3 = Color3.new(1, 1, 1)
4728Frame69.BackgroundTransparency = 1
4729Frame70.Name = "Lines"
4730Frame70.Parent = Frame69
4731Frame70.Transparency = 1
4732Frame70.Size = UDim2.new(1, 0, 1, 0)
4733Frame70.BackgroundColor = BrickColor.new("Institutional white")
4734Frame70.BackgroundColor3 = Color3.new(1, 1, 1)
4735Frame70.BackgroundTransparency = 1
4736TextLabel71.Name = "Line"
4737TextLabel71.Parent = Frame70
4738TextLabel71.Size = UDim2.new(1, 0, 0, 2)
4739TextLabel71.BackgroundColor = BrickColor.new("Institutional white")
4740TextLabel71.BackgroundColor3 = Color3.new(1, 1, 1)
4741TextLabel71.BorderSizePixel = 0
4742TextLabel71.Font = Enum.Font.SourceSans
4743TextLabel71.FontSize = Enum.FontSize.Size14
4744TextLabel71.Text = ""
4745TextLabel71.TextSize = 14
4746TextLabel72.Name = "Line"
4747TextLabel72.Parent = Frame70
4748TextLabel72.Position = UDim2.new(0, 0, 1, -2)
4749TextLabel72.Size = UDim2.new(1, 0, 0, 2)
4750TextLabel72.BackgroundColor = BrickColor.new("Institutional white")
4751TextLabel72.BackgroundColor3 = Color3.new(1, 1, 1)
4752TextLabel72.BorderSizePixel = 0
4753TextLabel72.Font = Enum.Font.SourceSans
4754TextLabel72.FontSize = Enum.FontSize.Size14
4755TextLabel72.Text = ""
4756TextLabel72.TextSize = 14
4757TextLabel73.Name = "Line"
4758TextLabel73.Parent = Frame70
4759TextLabel73.Size = UDim2.new(0, 2, 1, 0)
4760TextLabel73.BackgroundColor = BrickColor.new("Institutional white")
4761TextLabel73.BackgroundColor3 = Color3.new(1, 1, 1)
4762TextLabel73.BorderSizePixel = 0
4763TextLabel73.Font = Enum.Font.SourceSans
4764TextLabel73.FontSize = Enum.FontSize.Size14
4765TextLabel73.Text = ""
4766TextLabel73.TextSize = 14
4767TextLabel74.Name = "Line"
4768TextLabel74.Parent = Frame70
4769TextLabel74.Position = UDim2.new(1, -2, 0, 0)
4770TextLabel74.Size = UDim2.new(0, 2, 1, 0)
4771TextLabel74.BackgroundColor = BrickColor.new("Institutional white")
4772TextLabel74.BackgroundColor3 = Color3.new(1, 1, 1)
4773TextLabel74.BorderSizePixel = 0
4774TextLabel74.Font = Enum.Font.SourceSans
4775TextLabel74.FontSize = Enum.FontSize.Size14
4776TextLabel74.Text = ""
4777TextLabel74.TextSize = 14
4778ImageLabel75.Name = "Icon"
4779ImageLabel75.Parent = Frame69
4780ImageLabel75.Position = UDim2.new(0, 7, 0, 2)
4781ImageLabel75.Transparency = 1
4782ImageLabel75.Size = UDim2.new(0, 21, 0, 21)
4783ImageLabel75.BackgroundColor = BrickColor.new("Institutional white")
4784ImageLabel75.BackgroundColor3 = Color3.new(1, 1, 1)
4785ImageLabel75.BackgroundTransparency = 1
4786TextLabel76.Name = "Dash"
4787TextLabel76.Parent = Frame69
4788TextLabel76.Position = UDim2.new(0.5, -8, 0.5, -1)
4789TextLabel76.Size = UDim2.new(0, 16, 0, 2)
4790TextLabel76.BackgroundColor = BrickColor.new("Institutional white")
4791TextLabel76.BackgroundColor3 = Color3.new(1, 1, 1)
4792TextLabel76.BorderSizePixel = 0
4793TextLabel76.Font = Enum.Font.ArialBold
4794TextLabel76.FontSize = Enum.FontSize.Size18
4795TextLabel76.Text = ""
4796TextLabel76.TextColor = BrickColor.new("Institutional white")
4797TextLabel76.TextColor3 = Color3.new(1, 1, 1)
4798TextLabel76.TextSize = 18
4799TextLabel77.Name = "Num"
4800TextLabel77.Parent = Frame69
4801TextLabel77.Position = UDim2.new(1, -7, 0, 0)
4802TextLabel77.Transparency = 1
4803TextLabel77.Size = UDim2.new(0, 0, 1, 0)
4804TextLabel77.BackgroundColor = BrickColor.new("Institutional white")
4805TextLabel77.BackgroundColor3 = Color3.new(1, 1, 1)
4806TextLabel77.BackgroundTransparency = 1
4807TextLabel77.Font = Enum.Font.ArialBold
4808TextLabel77.FontSize = Enum.FontSize.Size18
4809TextLabel77.Text = "0"
4810TextLabel77.TextColor = BrickColor.new("Institutional white")
4811TextLabel77.TextColor3 = Color3.new(1, 1, 1)
4812TextLabel77.TextSize = 18
4813TextLabel77.TextXAlignment = Enum.TextXAlignment.Right
4814Frame78.Name = "Scope"
4815Frame78.Parent = ScreenGui6
4816Frame78.Transparency = 1
4817Frame78.Size = UDim2.new(1, 0, 1, 0)
4818Frame78.BackgroundColor = BrickColor.new("Institutional white")
4819Frame78.BackgroundColor3 = Color3.new(1, 1, 1)
4820Frame78.BackgroundTransparency = 1
4821ImageLabel79.Name = "Img"
4822ImageLabel79.Parent = Frame78
4823ImageLabel79.Transparency = 1
4824ImageLabel79.Size = UDim2.new(1, 0, 1, 0)
4825ImageLabel79.BackgroundColor = BrickColor.new("Really black")
4826ImageLabel79.BackgroundColor3 = Color3.new(0, 0, 0)
4827ImageLabel79.BackgroundTransparency = 1
4828ImageLabel79.BorderSizePixel = 0
4829ImageLabel79.ImageTransparency = 1
4830TextLabel80.Name = "Steady"
4831TextLabel80.Parent = Frame78
4832TextLabel80.Position = UDim2.new(0.5, -60, 0.5, 50)
4833TextLabel80.Visible = false
4834TextLabel80.Transparency = 1
4835TextLabel80.Size = UDim2.new(0, 120, 0, 20)
4836TextLabel80.BackgroundColor = BrickColor.new("Institutional white")
4837TextLabel80.BackgroundColor3 = Color3.new(1, 1, 1)
4838TextLabel80.BackgroundTransparency = 1
4839TextLabel80.ZIndex = 2
4840TextLabel80.Font = Enum.Font.ArialBold
4841TextLabel80.FontSize = Enum.FontSize.Size14
4842TextLabel80.Text = ""
4843TextLabel80.TextColor = BrickColor.new("New Yeller")
4844TextLabel80.TextColor3 = Color3.new(1, 1, 0)
4845TextLabel80.TextSize = 14
4846TextLabel80.TextStrokeTransparency = 0
4847Script81.Name = "[[ README ]] (Don't Delete)"
4848Script81.Parent = Tool0
4849table.insert(cors,sandbox(Script81,function()
4850--[[
4851
4852 VERSION: v0.0.3
4853
4854 ----------[ UPDATES ]----------------------------------------------------
4855
4856 Pre-Release: -Added a copyright
4857 -fixed the issue where you couldn't run when you selected the tool
4858 -Added an ADS key and allowed ADS to either be toggle or hold
4859 -Made the Ammo values external so they can be changed by outside scripts
4860
4861 v0.0.2: -Created new arms for the gun
4862 -Fixed an issue where the arms would glitch if PlayerAnimations was set to false and the gun was fired
4863 -Updated credit security
4864 -Put the Arm cframes in the SETTINGS
4865 -Made the stance changing animations slightly smoother
4866 -Added bullet drop
4867 -Fixed some bullet hit handling code
4868 -Made the torso being able to rotate while sitting down a setting
4869 -Added bullet settings
4870 -Added shockwave settings
4871 -Added an Explosive guntype
4872 -Added a version label in the Gui
4873
4874 v0.0.3: -Added an option to have player arms
4875 -Added grenades / throwables
4876 -Fixed the issue where if a player left a server without deselecting the gun, the bullet trails still remained
4877 -Added Gui Scopes
4878 -Fixed the issue where the guns would glitch if you switched weapons too fast
4879
4880 -------------------------------------------------------------------------
4881
4882 Hello there!
4883
4884 Glad to know you're using my one and only Gun Kit!
4885
4886 Even though this kit has many features and is rather advanced, it's pretty easy to use
4887
4888 There are 4 things that this gun needs in order to function:
4889 One brick called "AimPart"
4890 At least one brick called "Mag"
4891 One brick called "Handle"
4892 One brick called "Main"
4893
4894 The AimPart is what the gun will use to aim down the sights. When you aim down your sights, this brick will be in the center
4895 of the player's head. It basically allows the gun to have any type of sight, which can be placed anywhere on the gun. As long as
4896 the AimPart is aligned with the sight, the gun will aim down the sights properly.
4897 (NOTE: Make sure the AimPart is behind the Sight and the FRONT of the AimPart is facing the Sight)
4898
4899 The Mag is what the gun will move around when you reload the gun. If the mag is made up of more than one brick, make sure those
4900 bricks are also called "Mag" so that the gun will move them around. If you set ReloadAnimation to false in the SETTINGS, you don't
4901 need any bricks called "Mag". But if ReloadAnimation is set to true, the gun needs at least one brick called "Mag" or it will break
4902
4903 The Handle is obviously the most important part of the Gun. Without it, the tool itself wouldn't work. It's that simple
4904 (NOTE: If you want a sound to play when you fire, name it "FireSound" and place it in the Handle. If you want a sound to play when
4905 you reload, name it "ReloadSound" and place it in the Handle)
4906
4907 The Main is the brick where the bullets will originate from. It's also the brick where the flash effects are kept.
4908 (NOTE: If you want a flash billboardgui to appear when you fire, name it "FlashGui" and place it in the Main. If you want a light
4909 to flash when you fire, name it "FlashFX" and place it in the Main)
4910
4911 ----------[ INSTRUCTIONS ]-----------------------------------------------
4912
4913 HOW TO USE THIS KIT:
4914 1) If the gun already has a Handle, make sure it is facing forward. If the gun doesn't have a Handle, create one and place
4915 it wherever you like, and make sure it is facing forward
4916
4917 2) If the gun already has a brick called "AimPart", move it to where you would like, and make sure it is facing the sight.
4918 If the gun doesn't have a brick called "AimPart", create one and move it where you would like it to be, and make sure
4919 it is facing the sight
4920
4921 3) If the gun already has a brick called "Main", move it to the very front of the gun. If the gun doesn't have a brick
4922 called "Main", create one and move it to the very front of the gun
4923
4924 4) If ReloadAnimation is set to true in the SETTINGS, make sure the gun has at least one brick called "Mag". If
4925 ReloadAnimation is set to false, the gun doesn't need any bricks called "Mag".
4926
4927 5) Open the SETTINGS and edit them however you like
4928
4929 That's it! Only 5 steps! It's not that complicated, just follow the Directions and it should work fine. If you have any questions /
4930 comments / concerns, message me.
4931
4932 ______ ______ __ ______ _ ______
4933 / _/ _/ /_ __/_ _______/ /_ ____ / ____/_ _______(_)___ ____ / / /
4934 / // / / / / / / / ___/ __ \/ __ \/ /_ / / / / ___/ / __ \/ __ \ / // /
4935 / // / / / / /_/ / / / /_/ / /_/ / __/ / /_/ (__ ) / /_/ / / / / / // /
4936 / // / /_/ \__,_/_/ /_.___/\____/_/ \__,_/____/_/\____/_/ /_/ _/ // /
4937 /__/__/ /__/__/
4938
4939--]]
4940
4941wait(math.random(0, 200) / 200) --This is to prevent more than one Ignore_Model from being created
4942
4943if _G.Ignore_Code then --If the Ignore_Code already exists, then the script creates the Ignore_Model
4944 --[[
4945 The purpose of this is so that every gun in a game that uses this gun kit will share one Ignore_Model. That way,
4946 bullet trails, bullet holes, and other fake arms will be ignored by the gun which makes the bullets more likely to
4947 hit a character part
4948 --]]
4949 if (not game.Workspace:FindFirstChild("Ignore_Model_".._G.Ignore_Code)) then
4950 local Ignore_Model = Instance.new("Model")
4951 Ignore_Model.Name = "Ignore_Model_".._G.Ignore_Code
4952 Ignore_Model.Parent = game.Workspace
4953
4954 spawn(function()
4955 while true do
4956 Ignore_Model.Parent = game.Workspace
4957 wait(1 / 20)
4958 end
4959 end)
4960 end
4961
4962 script.Parent:WaitForChild("Gun_Main"):WaitForChild("Ignore_Code").Value = _G.Ignore_Code
4963else
4964 --[[
4965 If there isn't already an Ignore_Code, then this creates one. The purpose of it being random is so that if there is
4966 an Ignore_Model for something else in the game, the script won't end up placing the ignored objects in that Ignore_Model
4967 --]]
4968 _G.Ignore_Code = math.random(1, 1e4)
4969
4970 if (not game.Workspace:FindFirstChild("Ignore_Model_".._G.Ignore_Code)) then
4971 local Ignore_Model = Instance.new("Model")
4972 Ignore_Model.Name = "Ignore_Model_".._G.Ignore_Code
4973 Ignore_Model.Parent = game.Workspace
4974
4975 spawn(function()
4976 while true do
4977 Ignore_Model.Parent = game.Workspace
4978 wait(1 / 20)
4979 end
4980 end)
4981 end
4982
4983 script.Parent:WaitForChild("Gun_Main"):WaitForChild("Ignore_Code").Value = _G.Ignore_Code
4984end
4985
4986spawn(function()
4987 repeat wait() until _G.Ignore_Code
4988 local Ignore_Model = game.Workspace:WaitForChild("Ignore_Model_".._G.Ignore_Code)
4989 while true do
4990 for _, Gun_Ignore in pairs(Ignore_Model:GetChildren()) do
4991 if (not game.Players:FindFirstChild(Gun_Ignore.Name:sub(12))) then
4992 Gun_Ignore:Destroy()
4993 end
4994 end
4995 wait(1 / 20)
4996 end
4997end)
4998end))
4999IntValue82.Name = "TacticalGrenades"
5000IntValue82.Parent = Tool0
5001IntValue82.Value = 1000000000
5002IntValue83.Name = "ClipSize"
5003IntValue83.Parent = Tool0
5004IntValue83.Value = 1000000000
5005IntValue84.Name = "StoredAmmo"
5006IntValue84.Parent = Tool0
5007IntValue84.Value = 1000000000
5008Part85.Name = "SightLine"
5009Part85.Parent = Tool0
5010Part85.CFrame = CFrame.new(2.50000191, 3.31281304, -18, 0, 0, 1, 1, 0, 0, 0, 1, 0)
5011Part85.Orientation = Vector3.new(0, 90, 90)
5012Part85.Position = Vector3.new(2.50000191, 3.31281304, -18)
5013Part85.Rotation = Vector3.new(90, 90, 0)
5014Part85.Color = Color3.new(1, 0, 0)
5015Part85.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
5016Part85.Anchored = true
5017Part85.BottomSurface = Enum.SurfaceType.Smooth
5018Part85.BrickColor = BrickColor.new("Really red")
5019Part85.CanCollide = false
5020Part85.TopSurface = Enum.SurfaceType.Smooth
5021Part85.brickColor = BrickColor.new("Really red")
5022Part85.FormFactor = Enum.FormFactor.Custom
5023Part85.formFactor = Enum.FormFactor.Custom
5024BlockMesh86.Parent = Part85
5025BlockMesh86.Offset = Vector3.new(-0.0500000007, 0, 0)
5026BlockMesh86.Scale = Vector3.new(0.5, 0.0399999991, 0.25)
5027Part87.Name = "SightFront"
5028Part87.Parent = Tool0
5029Part87.CFrame = CFrame.new(2.50000191, 3.2128129, -18, 0, 0, 1, 1, 0, 0, 0, 1, 0)
5030Part87.Orientation = Vector3.new(0, 90, 90)
5031Part87.Position = Vector3.new(2.50000191, 3.2128129, -18)
5032Part87.Rotation = Vector3.new(90, 90, 0)
5033Part87.Color = Color3.new(0, 1, 1)
5034Part87.Size = Vector3.new(0.200000003, 0.300000012, 0.200000003)
5035Part87.Anchored = true
5036Part87.BottomSurface = Enum.SurfaceType.Smooth
5037Part87.BrickColor = BrickColor.new("Toothpaste")
5038Part87.CanCollide = false
5039Part87.Material = Enum.Material.Neon
5040Part87.TopSurface = Enum.SurfaceType.Smooth
5041Part87.brickColor = BrickColor.new("Toothpaste")
5042Part87.FormFactor = Enum.FormFactor.Custom
5043Part87.formFactor = Enum.FormFactor.Custom
5044BlockMesh88.Parent = Part87
5045BlockMesh88.Offset = Vector3.new(-0.0599999987, 0, 0)
5046BlockMesh88.Scale = Vector3.new(0.600000024, 0.300000012, 0.5)
5047Part89.Name = "SightFront"
5048Part89.Parent = Tool0
5049Part89.CFrame = CFrame.new(2.50000191, 3.30939388, -17.9206028, 0, 0, 1, 0.939692616, -0.342020124, 0, 0.342020124, 0.939692616, 0)
5050Part89.Orientation = Vector3.new(0, 90, 110)
5051Part89.Position = Vector3.new(2.50000191, 3.30939388, -17.9206028)
5052Part89.Rotation = Vector3.new(110, 90, 0)
5053Part89.Color = Color3.new(0, 1, 1)
5054Part89.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
5055Part89.Anchored = true
5056Part89.BottomSurface = Enum.SurfaceType.Smooth
5057Part89.BrickColor = BrickColor.new("Toothpaste")
5058Part89.CanCollide = false
5059Part89.Material = Enum.Material.Neon
5060Part89.TopSurface = Enum.SurfaceType.Smooth
5061Part89.brickColor = BrickColor.new("Toothpaste")
5062Part89.FormFactor = Enum.FormFactor.Custom
5063Part89.formFactor = Enum.FormFactor.Custom
5064BlockMesh90.Parent = Part89
5065BlockMesh90.Offset = Vector3.new(-0.0700000003, 0, 0)
5066BlockMesh90.Scale = Vector3.new(1, 0.075000003, 0.5)
5067Part91.Name = "SightFront"
5068Part91.Parent = Tool0
5069Part91.CFrame = CFrame.new(2.50000191, 3.30939388, -18.0793972, 0, 0, 1, 0.939692616, 0.342020124, 0, -0.342020124, 0.939692616, 0)
5070Part91.Orientation = Vector3.new(0, 90, 70)
5071Part91.Position = Vector3.new(2.50000191, 3.30939388, -18.0793972)
5072Part91.Rotation = Vector3.new(70, 90, 0)
5073Part91.Color = Color3.new(0, 1, 1)
5074Part91.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
5075Part91.Anchored = true
5076Part91.BottomSurface = Enum.SurfaceType.Smooth
5077Part91.BrickColor = BrickColor.new("Toothpaste")
5078Part91.CanCollide = false
5079Part91.Material = Enum.Material.Neon
5080Part91.TopSurface = Enum.SurfaceType.Smooth
5081Part91.brickColor = BrickColor.new("Toothpaste")
5082Part91.FormFactor = Enum.FormFactor.Custom
5083Part91.formFactor = Enum.FormFactor.Custom
5084BlockMesh92.Parent = Part91
5085BlockMesh92.Offset = Vector3.new(-0.0700000003, 0, 0)
5086BlockMesh92.Scale = Vector3.new(1, 0.075000003, 0.5)
5087Part93.Name = "SightBack"
5088Part93.Parent = Tool0
5089Part93.CFrame = CFrame.new(4.70000696, 3.2128129, -18, 0, 0, 1, 1, 0, 0, 0, 1, 0)
5090Part93.Orientation = Vector3.new(0, 90, 90)
5091Part93.Position = Vector3.new(4.70000696, 3.2128129, -18)
5092Part93.Rotation = Vector3.new(90, 90, 0)
5093Part93.Color = Color3.new(0, 1, 1)
5094Part93.Size = Vector3.new(0.200000003, 0.300000012, 0.200000003)
5095Part93.Anchored = true
5096Part93.BottomSurface = Enum.SurfaceType.Smooth
5097Part93.BrickColor = BrickColor.new("Toothpaste")
5098Part93.CanCollide = false
5099Part93.Material = Enum.Material.Neon
5100Part93.TopSurface = Enum.SurfaceType.Smooth
5101Part93.brickColor = BrickColor.new("Toothpaste")
5102Part93.FormFactor = Enum.FormFactor.Custom
5103Part93.formFactor = Enum.FormFactor.Custom
5104BlockMesh94.Parent = Part93
5105BlockMesh94.Offset = Vector3.new(-0.0799999982, 0, 0)
5106BlockMesh94.Scale = Vector3.new(1, 0.400000006, 0.800000012)
5107Part95.Name = "SightBack"
5108Part95.Parent = Tool0
5109Part95.CFrame = CFrame.new(4.70000696, 3.31281304, -18, 0, 0, 1, 1, 0, 0, 0, 1, 0)
5110Part95.Orientation = Vector3.new(0, 90, 90)
5111Part95.Position = Vector3.new(4.70000696, 3.31281304, -18)
5112Part95.Rotation = Vector3.new(90, 90, 0)
5113Part95.Color = Color3.new(0, 1, 1)
5114Part95.Size = Vector3.new(0.200000003, 0.300000012, 0.200000003)
5115Part95.Anchored = true
5116Part95.BottomSurface = Enum.SurfaceType.Smooth
5117Part95.BrickColor = BrickColor.new("Toothpaste")
5118Part95.CanCollide = false
5119Part95.Material = Enum.Material.Neon
5120Part95.TopSurface = Enum.SurfaceType.Smooth
5121Part95.brickColor = BrickColor.new("Toothpaste")
5122Part95.FormFactor = Enum.FormFactor.Custom
5123Part95.formFactor = Enum.FormFactor.Custom
5124SpecialMesh96.Parent = Part95
5125SpecialMesh96.MeshId = "http://www.roblox.com/asset/?id=3270017"
5126SpecialMesh96.Scale = Vector3.new(0.180000007, 0.180000007, 2.5)
5127SpecialMesh96.MeshType = Enum.MeshType.FileMesh
5128Part97.Parent = Tool0
5129Part97.CFrame = CFrame.new(4.60000706, 2.58600712, -18.0000038, 0.866025388, -0.5, 0, 0.5, 0.866025388, 0, 0, 0, 1)
5130Part97.Orientation = Vector3.new(0, 0, 30)
5131Part97.Position = Vector3.new(4.60000706, 2.58600712, -18.0000038)
5132Part97.Rotation = Vector3.new(0, 0, 30)
5133Part97.Color = Color3.new(0, 1, 1)
5134Part97.Size = Vector3.new(0.200000003, 0.800000012, 0.200000003)
5135Part97.Anchored = true
5136Part97.BottomSurface = Enum.SurfaceType.Smooth
5137Part97.BrickColor = BrickColor.new("Toothpaste")
5138Part97.CanCollide = false
5139Part97.Material = Enum.Material.Neon
5140Part97.TopSurface = Enum.SurfaceType.Smooth
5141Part97.brickColor = BrickColor.new("Toothpaste")
5142Part97.FormFactor = Enum.FormFactor.Custom
5143Part97.formFactor = Enum.FormFactor.Custom
5144Part98.Parent = Tool0
5145Part98.CFrame = CFrame.new(1.399997, 2.96280003, -18.0000038, -2.98023224e-08, -0.999999821, 0, 0.999999821, -2.98023224e-08, 0, 0, 0, 1)
5146Part98.Orientation = Vector3.new(0, 0, 90)
5147Part98.Position = Vector3.new(1.399997, 2.96280003, -18.0000038)
5148Part98.Rotation = Vector3.new(0, 0, 90)
5149Part98.Color = Color3.new(0, 1, 1)
5150Part98.Size = Vector3.new(0.25, 0.400000006, 0.25)
5151Part98.Anchored = true
5152Part98.BottomSurface = Enum.SurfaceType.Smooth
5153Part98.BrickColor = BrickColor.new("Toothpaste")
5154Part98.CanCollide = false
5155Part98.Material = Enum.Material.Neon
5156Part98.TopSurface = Enum.SurfaceType.Smooth
5157Part98.brickColor = BrickColor.new("Toothpaste")
5158Part98.FormFactor = Enum.FormFactor.Custom
5159Part98.formFactor = Enum.FormFactor.Custom
5160CylinderMesh99.Parent = Part98
5161CylinderMesh99.Scale = Vector3.new(0.800000012, 1, 0.800000012)
5162Part100.Parent = Tool0
5163Part100.CFrame = CFrame.new(5.49999809, 2.51280189, -17.9999962, -1.74845553e-07, 0, 1, 3.05709674e-14, -1, 0, 1, 3.05709708e-14, 1.31134158e-07)
5164Part100.Orientation = Vector3.new(0, 90, 180)
5165Part100.Position = Vector3.new(5.49999809, 2.51280189, -17.9999962)
5166Part100.Rotation = Vector3.new(180, 90, 0)
5167Part100.Color = Color3.new(0, 1, 1)
5168Part100.Size = Vector3.new(0.300000012, 0.400000006, 1)
5169Part100.Anchored = true
5170Part100.BottomSurface = Enum.SurfaceType.Smooth
5171Part100.BrickColor = BrickColor.new("Toothpaste")
5172Part100.CanCollide = false
5173Part100.Material = Enum.Material.Neon
5174Part100.TopSurface = Enum.SurfaceType.Smooth
5175Part100.brickColor = BrickColor.new("Toothpaste")
5176Part100.FormFactor = Enum.FormFactor.Custom
5177Part100.formFactor = Enum.FormFactor.Custom
5178SpecialMesh101.Parent = Part100
5179SpecialMesh101.MeshType = Enum.MeshType.Wedge
5180Part102.Parent = Tool0
5181Part102.CFrame = CFrame.new(4.20000792, 2.91280007, -18.0000038, 1, 0, 0, 0, 1, 0, 0, 0, 1)
5182Part102.Position = Vector3.new(4.20000792, 2.91280007, -18.0000038)
5183Part102.Color = Color3.new(0, 1, 1)
5184Part102.Size = Vector3.new(1.60000002, 0.400000036, 0.300000012)
5185Part102.Anchored = true
5186Part102.BottomSurface = Enum.SurfaceType.Smooth
5187Part102.BrickColor = BrickColor.new("Toothpaste")
5188Part102.CanCollide = false
5189Part102.Material = Enum.Material.Neon
5190Part102.TopSurface = Enum.SurfaceType.Smooth
5191Part102.brickColor = BrickColor.new("Toothpaste")
5192Part102.FormFactor = Enum.FormFactor.Custom
5193Part102.formFactor = Enum.FormFactor.Custom
5194Part103.Parent = Tool0
5195Part103.CFrame = CFrame.new(2.00000191, 2.96280193, -18.0000038, -2.98023224e-08, -0.999999821, 0, 0.999999821, -2.98023224e-08, 0, 0, 0, 1)
5196Part103.Orientation = Vector3.new(0, 0, 90)
5197Part103.Position = Vector3.new(2.00000191, 2.96280193, -18.0000038)
5198Part103.Rotation = Vector3.new(0, 0, 90)
5199Part103.Color = Color3.new(0, 1, 1)
5200Part103.Size = Vector3.new(0.200000003, 0.800000012, 0.200000003)
5201Part103.Anchored = true
5202Part103.BottomSurface = Enum.SurfaceType.Smooth
5203Part103.BrickColor = BrickColor.new("Toothpaste")
5204Part103.CanCollide = false
5205Part103.Material = Enum.Material.Neon
5206Part103.TopSurface = Enum.SurfaceType.Smooth
5207Part103.brickColor = BrickColor.new("Toothpaste")
5208Part103.FormFactor = Enum.FormFactor.Custom
5209Part103.formFactor = Enum.FormFactor.Custom
5210CylinderMesh104.Parent = Part103
5211CylinderMesh104.Scale = Vector3.new(0.699999988, 1, 0.699999988)
5212Part105.Parent = Tool0
5213Part105.CFrame = CFrame.new(2.90000701, 2.96280193, -18.0000038, -2.98023224e-08, -0.999999821, 0, 0.999999821, -2.98023224e-08, 0, 0, 0, 1)
5214Part105.Orientation = Vector3.new(0, 0, 90)
5215Part105.Position = Vector3.new(2.90000701, 2.96280193, -18.0000038)
5216Part105.Rotation = Vector3.new(0, 0, 90)
5217Part105.Color = Color3.new(0, 1, 1)
5218Part105.Size = Vector3.new(0.300000012, 1, 0.300000012)
5219Part105.Anchored = true
5220Part105.BottomSurface = Enum.SurfaceType.Smooth
5221Part105.BrickColor = BrickColor.new("Toothpaste")
5222Part105.CanCollide = false
5223Part105.Material = Enum.Material.Neon
5224Part105.TopSurface = Enum.SurfaceType.Smooth
5225Part105.brickColor = BrickColor.new("Toothpaste")
5226Part105.FormFactor = Enum.FormFactor.Custom
5227Part105.formFactor = Enum.FormFactor.Custom
5228CylinderMesh106.Parent = Part105
5229Part107.Parent = Tool0
5230Part107.CFrame = CFrame.new(5.50000715, 2.91280007, -18.0000038, 1, 0, 0, 0, 1, 0, 0, 0, 1)
5231Part107.Position = Vector3.new(5.50000715, 2.91280007, -18.0000038)
5232Part107.Color = Color3.new(0, 1, 1)
5233Part107.Size = Vector3.new(1, 0.400000036, 0.300000012)
5234Part107.Anchored = true
5235Part107.BottomSurface = Enum.SurfaceType.Smooth
5236Part107.BrickColor = BrickColor.new("Toothpaste")
5237Part107.CanCollide = false
5238Part107.Material = Enum.Material.Neon
5239Part107.TopSurface = Enum.SurfaceType.Smooth
5240Part107.brickColor = BrickColor.new("Toothpaste")
5241Part107.FormFactor = Enum.FormFactor.Custom
5242Part107.formFactor = Enum.FormFactor.Custom
5243Part108.Name = "Main"
5244Part108.Parent = Tool0
5245Part108.CFrame = CFrame.new(1.07500005, 2.9628129, -17.9999981, -2.98023224e-08, -0.999999821, 0, 0.999999821, -2.98023224e-08, 0, 0, 0, 1)
5246Part108.Orientation = Vector3.new(0, 0, 90)
5247Part108.Position = Vector3.new(1.07500005, 2.9628129, -17.9999981)
5248Part108.Rotation = Vector3.new(0, 0, 90)
5249Part108.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
5250Part108.Size = Vector3.new(0.25, 0.25, 0.25)
5251Part108.Anchored = true
5252Part108.BottomSurface = Enum.SurfaceType.Smooth
5253Part108.BrickColor = BrickColor.new("Really black")
5254Part108.CanCollide = false
5255Part108.TopSurface = Enum.SurfaceType.Smooth
5256Part108.brickColor = BrickColor.new("Really black")
5257Part108.FormFactor = Enum.FormFactor.Custom
5258Part108.formFactor = Enum.FormFactor.Custom
5259PointLight109.Name = "FlashFX"
5260PointLight109.Parent = Part108
5261PointLight109.Color = Color3.new(1, 1, 0)
5262PointLight109.Enabled = false
5263PointLight109.Range = 6
5264PointLight109.Brightness = 10
5265PointLight109.Shadows = true
5266BillboardGui110.Name = "FlashGui"
5267BillboardGui110.Parent = Part108
5268BillboardGui110.Enabled = false
5269BillboardGui110.Size = UDim2.new(1.10000002, 0, 1.10000002, 0)
5270ImageLabel111.Name = "Label"
5271ImageLabel111.Parent = BillboardGui110
5272ImageLabel111.Transparency = 1
5273ImageLabel111.Size = UDim2.new(1, 0, 1, 0)
5274ImageLabel111.BackgroundTransparency = 1
5275ImageLabel111.Image = "http://www.roblox.com/asset/?id=117472237"
5276CylinderMesh112.Parent = Part108
5277CylinderMesh112.Offset = Vector3.new(0, -0.248999998, 0)
5278CylinderMesh112.Scale = Vector3.new(0.600000024, 1, 0.600000024)
5279Part113.Name = "Mag"
5280Part113.Parent = Tool0
5281Part113.CFrame = CFrame.new(3.89249396, 2.71237612, -17.9999962, 0.996194005, 0.0871553645, 5.66544571e-08, -0.0871559605, 0.996194363, -1.36536862e-08, -9.90944926e-08, 2.56498343e-08, 0.999999404)
5282Part113.Orientation = Vector3.new(0, 0, -5)
5283Part113.Position = Vector3.new(3.89249396, 2.71237612, -17.9999962)
5284Part113.Rotation = Vector3.new(0, 0, -5)
5285Part113.Color = Color3.new(0, 1, 1)
5286Part113.Size = Vector3.new(0.400000006, 0.300000012, 0.200000003)
5287Part113.Anchored = true
5288Part113.BottomSurface = Enum.SurfaceType.Smooth
5289Part113.BrickColor = BrickColor.new("Toothpaste")
5290Part113.CanCollide = false
5291Part113.Material = Enum.Material.Neon
5292Part113.TopSurface = Enum.SurfaceType.Smooth
5293Part113.brickColor = BrickColor.new("Toothpaste")
5294Part113.FormFactor = Enum.FormFactor.Custom
5295Part113.formFactor = Enum.FormFactor.Custom
5296Part114.Name = "Mag"
5297Part114.Parent = Tool0
5298Part114.CFrame = CFrame.new(3.84585404, 2.45395589, -17.9999981, 0.965919852, 0.258814812, -1.02654766e-07, -0.258820683, 0.965922356, 6.84869477e-08, -2.7718275e-07, 4.61622776e-08, 0.999994636)
5299Part114.Orientation = Vector3.new(0, 0, -15)
5300Part114.Position = Vector3.new(3.84585404, 2.45395589, -17.9999981)
5301Part114.Rotation = Vector3.new(0, 0, -15)
5302Part114.Color = Color3.new(0, 1, 1)
5303Part114.Size = Vector3.new(0.400000006, 0.300000012, 0.200000003)
5304Part114.Anchored = true
5305Part114.BottomSurface = Enum.SurfaceType.Smooth
5306Part114.BrickColor = BrickColor.new("Toothpaste")
5307Part114.CanCollide = false
5308Part114.Material = Enum.Material.Neon
5309Part114.TopSurface = Enum.SurfaceType.Smooth
5310Part114.brickColor = BrickColor.new("Toothpaste")
5311Part114.FormFactor = Enum.FormFactor.Custom
5312Part114.formFactor = Enum.FormFactor.Custom
5313Part115.Name = "Mag"
5314Part115.Parent = Tool0
5315Part115.CFrame = CFrame.new(3.75835609, 2.204036, -17.9999981, 0.906307757, 0.42261827, 0, -0.42261827, 0.906307757, 0, 0, 0, 1)
5316Part115.Orientation = Vector3.new(0, 0, -25)
5317Part115.Position = Vector3.new(3.75835609, 2.204036, -17.9999981)
5318Part115.Rotation = Vector3.new(0, 0, -25)
5319Part115.Color = Color3.new(0, 1, 1)
5320Part115.Size = Vector3.new(0.400000006, 0.300000012, 0.200000003)
5321Part115.Anchored = true
5322Part115.BottomSurface = Enum.SurfaceType.Smooth
5323Part115.BrickColor = BrickColor.new("Toothpaste")
5324Part115.CanCollide = false
5325Part115.Material = Enum.Material.Neon
5326Part115.TopSurface = Enum.SurfaceType.Smooth
5327Part115.brickColor = BrickColor.new("Toothpaste")
5328Part115.FormFactor = Enum.FormFactor.Custom
5329Part115.formFactor = Enum.FormFactor.Custom
5330Part116.Name = "Handle"
5331Part116.Parent = Tool0
5332Part116.CFrame = CFrame.new(4.69999981, 2.3128159, -17.9999981, -2.98023224e-08, 2.3175307e-08, 0.999999821, 1.3152038e-07, 1, -2.3175275e-08, -0.999999821, 1.31520352e-07, -2.98023224e-08)
5333Part116.Orientation = Vector3.new(0, 90, 0)
5334Part116.Position = Vector3.new(4.69999981, 2.3128159, -17.9999981)
5335Part116.Rotation = Vector3.new(142.12999, 89.9700012, -142.12999)
5336Part116.Transparency = 1
5337Part116.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
5338Part116.Anchored = true
5339Part116.BottomSurface = Enum.SurfaceType.Smooth
5340Part116.CanCollide = false
5341Part116.Material = Enum.Material.Neon
5342Part116.TopSurface = Enum.SurfaceType.Smooth
5343Part116.FormFactor = Enum.FormFactor.Custom
5344Part116.formFactor = Enum.FormFactor.Custom
5345Sound117.Name = "FireSound"
5346Sound117.Parent = Part116
5347Sound117.Pitch = 1.6000000238419
5348Sound117.PlaybackSpeed = 1.6000000238419
5349Sound117.SoundId = "http://roblox.com/asset/?id=10209859"
5350Sound117.Volume = 1
5351Part118.Name = "AimPart"
5352Part118.Parent = Tool0
5353Part118.CFrame = CFrame.new(5.19999981, 3.31281304, -17.9999981, 0, 0, 1, -2.98023224e-08, 0.999999821, 0, -0.999999821, -2.98023224e-08, 0)
5354Part118.Orientation = Vector3.new(0, 90, 0)
5355Part118.Position = Vector3.new(5.19999981, 3.31281304, -17.9999981)
5356Part118.Rotation = Vector3.new(0, 90, 0)
5357Part118.Transparency = 1
5358Part118.Size = Vector3.new(0.300000012, 0.200000003, 0.200000003)
5359Part118.Anchored = true
5360Part118.BottomSurface = Enum.SurfaceType.Smooth
5361Part118.CanCollide = false
5362Part118.Material = Enum.Material.Neon
5363Part118.TopSurface = Enum.SurfaceType.Smooth
5364Part118.FormFactor = Enum.FormFactor.Custom
5365Part118.formFactor = Enum.FormFactor.Custom
5366for i,v in pairs(mas:GetChildren()) do
5367 v.Parent = workspace
5368 pcall(function() v:MakeJoints() end)
5369end
5370mas:Destroy()
5371for i,v in pairs(cors) do
5372 spawn(function()
5373 pcall(v)
5374 end)
5375end