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