SHOW:
|
|
- or go back to the newest paste.
1 | - | --[[ |
1 | + | --[[FN Five-SeveN Handgun. Developed by Fabrique National Herstal as a counterpart sidearm for |
2 | - | FN Five-SeveN Handgun. Developed by Fabrique National Herstal as a counterpart sidearm for |
2 | + | |
3 | rifle speeds.--]] | |
4 | - | rifle speeds. |
4 | + | |
5 | - | --]] |
5 | + | |
6 | Char = Player.Character | |
7 | animate = Char:findFirstChild("Animate") | |
8 | if animate then | |
9 | animate:Destroy() | |
10 | Name = "FN 5.7 FiveSeveN" | |
11 | MC = BrickColor.new("Really blue") | |
12 | GC = BrickColor.new("Bright orange") | |
13 | - | MC = BrickColor.new("Mid gray") |
13 | + | |
14 | - | GC = BrickColor.new("Really black") |
14 | + | |
15 | MR = 0.01 | |
16 | MagSize = 10000 | |
17 | Chamber = 1 | |
18 | canHit = false | |
19 | melee = true | |
20 | selected = false | |
21 | canDual = true | |
22 | dual = true | |
23 | Button1Down = false | |
24 | damage = 1 | |
25 | canFire = true | |
26 | - | damage = 56 |
26 | + | |
27 | readyTime = 0.1 | |
28 | automatic = false | |
29 | burst = false | |
30 | burstCount = 3 | |
31 | burstCountMax = 3 | |
32 | canSilence = true | |
33 | silenced = false | |
34 | canZoom = false | |
35 | zoom = false | |
36 | switchToSingle = true | |
37 | switchToBurst = false | |
38 | switchToAutomatic = false | |
39 | ammoGui = Instance.new("ScreenGui") | |
40 | ammoGui.Name = Name | |
41 | local frame = Instance.new("Frame") | |
42 | frame.Name = "Frame" | |
43 | frame.Size = UDim2.new(0, 165, 0, 60) | |
44 | frame.Position = UDim2.new(0, 0, 1, -400) | |
45 | frame.BackgroundColor3 = Color3.new(1, 1, 1) | |
46 | frame.BorderColor3 = Color3.new(0, 0, 0) | |
47 | frame.Parent = ammoGui | |
48 | local label = Instance.new("TextLabel") | |
49 | label.Name = "Weapon" | |
50 | label.Text = "Weapon: " ..Name | |
51 | label.Size = UDim2.new(1, 0, 0, 20) | |
52 | label.Position = UDim2.new(0, 0, 0, 0) | |
53 | label.BackgroundColor3 = Color3.new(1, 0, 0) | |
54 | label.BorderColor3 = Color3.new(0, 0, 0) | |
55 | label.Parent = frame | |
56 | local label = Instance.new("TextLabel") | |
57 | label.Name = "MagazinePrefix" | |
58 | label.Text = " Magazine:" | |
59 | label.TextXAlignment = "Left" | |
60 | label.Size = UDim2.new(1, 0, 0, 20) | |
61 | label.Position = UDim2.new(0, 0, 0, 20) | |
62 | label.BackgroundColor3 = Color3.new(1, 1, 1) | |
63 | label.BorderColor3 = Color3.new(0, 0, 0) | |
64 | label.Parent = frame | |
65 | local label = Instance.new("TextLabel") | |
66 | label.Name = "Magazine" | |
67 | label.Text = "0/0" | |
68 | label.TextXAlignment = "Right" | |
69 | label.Size = UDim2.new(1, 0, 0, 20) | |
70 | label.Position = UDim2.new(0, -10, 0, 20) | |
71 | label.BackgroundTransparency = 1 | |
72 | label.BorderSizePixel = 0 | |
73 | label.Parent = frame | |
74 | local label = Instance.new("TextLabel") | |
75 | label.Name = "AmmoPrefix" | |
76 | label.Text = " 5.7x28mm:" | |
77 | label.TextXAlignment = "Left" | |
78 | label.Size = UDim2.new(1, 0, 0, 20) | |
79 | label.Position = UDim2.new(0, 0, 0, 40) | |
80 | label.BackgroundColor3 = Color3.new(1, 1, 1) | |
81 | label.BorderColor3 = Color3.new(0, 0, 0) | |
82 | label.Parent = frame | |
83 | local label = Instance.new("TextLabel") | |
84 | label.Name = "Ammo" | |
85 | label.Text = "0/0" | |
86 | label.TextXAlignment = "Right" | |
87 | label.Size = UDim2.new(1, 0, 0, 20) | |
88 | label.Position = UDim2.new(0, -10, 0, 40) | |
89 | label.BackgroundTransparency = 1 | |
90 | label.BorderSizePixel = 0 | |
91 | label.Parent = frame | |
92 | function updateGui() | |
93 | if selected == false then return end | |
94 | if Player:FindFirstChild("PlayerGui") == nil then Instance.new("PlayerGui").Parent = Player end | |
95 | if Player.PlayerGui:FindFirstChild(Name) == nil then | |
96 | ammoGui:Clone().Parent = Player.PlayerGui | |
97 | end | |
98 | Player.PlayerGui[Name].Frame.Magazine.Text = tostring(magazine.Value).. "/" ..tostring(magazineMax.Value) | |
99 | Player.PlayerGui[Name].Frame.Ammo.Text = tostring(ammo.Value).. "/" ..tostring(ammoMax.Value) | |
100 | end | |
101 | function makeParts(format) | |
102 | local model = Instance.new("Model") | |
103 | model.Name = Name | |
104 | local pm2 = Instance.new("Part") | |
105 | pm2.Name = "WeldPoint" | |
106 | pm2.formFactor = "Symmetric" | |
107 | pm2.Size = Vector3.new(1, 1, 1) | |
108 | pm2.BrickColor = MC | |
109 | pm2.Reflectance = MR | |
110 | pm2.CanCollide = false | |
111 | pm2.Transparency = 1 | |
112 | pm2.Locked = true | |
113 | pm2.TopSurface = 0 | |
114 | pm2.BottomSurface = 0 | |
115 | pm2.Parent = model | |
116 | local m = Instance.new("SpecialMesh") | |
117 | m.MeshType = "Brick" | |
118 | m.Scale = Vector3.new(0.3, 0.8, 0.4) | |
119 | m.Parent = pm2 | |
120 | if format ~= nil then | |
121 | local w = Instance.new("Weld") | |
122 | w.Part0 = pm2 | |
123 | if format == "RightHand" then | |
124 | w.Part1 = Player.Character:FindFirstChild("Right Arm") | |
125 | w.C0 = CFrame.new(0, 0.9, 0.68) | |
126 | w.C1 = CFrame.new() | |
127 | elseif format == "LeftHand" then | |
128 | w.Part1 = Player.Character:FindFirstChild("Left Arm") | |
129 | w.C0 = CFrame.new(0, 0.9, 0.68) | |
130 | w.C1 = CFrame.new() | |
131 | model.Name = Name.. " (Left)" | |
132 | elseif format == "RightHolster" then | |
133 | w.Part1 = Player.Character:FindFirstChild("Right Leg") | |
134 | w.C0 = CFrame.new(-0.65, -0.25, 0) * CFrame.fromEulerAnglesXYZ(math.rad(25), 0, 0) | |
135 | w.C1 = CFrame.new() | |
136 | model.Name = Name.. " (Holstered)" | |
137 | elseif format == "LeftHolster" then | |
138 | w.Part1 = Player.Character:FindFirstChild("Left Leg") | |
139 | w.C0 = CFrame.new(0.65, -0.25, 0) * CFrame.fromEulerAnglesXYZ(math.rad(25), 0, 0) | |
140 | w.C1 = CFrame.new() | |
141 | model.Name = Name.. " (Holstered, Left)" | |
142 | end | |
143 | w.Parent = pm2 | |
144 | model.Parent = Player.Character | |
145 | end | |
146 | local pm = Instance.new("Part") | |
147 | pm.Name = "Handle" | |
148 | pm.formFactor = "Symmetric" | |
149 | pm.Size = Vector3.new(1, 1, 1) | |
150 | pm.CanCollide = false | |
151 | pm.Transparency = 1 | |
152 | pm.Locked = true | |
153 | pm.TopSurface = 0 | |
154 | pm.BottomSurface = 0 | |
155 | pm.Parent = model | |
156 | local w = Instance.new("Weld") | |
157 | w.Part0 = pm | |
158 | w.Part1 = pm2 | |
159 | w.C0 = CFrame.new() | |
160 | w.C1 = CFrame.new() | |
161 | w.Parent = pm | |
162 | local s = Instance.new("Sound") | |
163 | s.Name = "Melee" | |
164 | s.SoundId = "rbxasset://sounds/swordslash.wav" | |
165 | s.Volume = 1 | |
166 | s.Pitch = 2 | |
167 | s.Looped = false | |
168 | s.Parent = pm | |
169 | local s = Instance.new("Sound") | |
170 | s.Name = "Impact" | |
171 | s.SoundId = "http://www.roblox.com/Asset/?id=46153268" | |
172 | s.Volume = 0.5 | |
173 | s.Pitch = 1 | |
174 | s.Looped = false | |
175 | s.Parent = pm | |
176 | local s = Instance.new("Sound") | |
177 | s.Name = "Fire" | |
178 | s.SoundId = "http://www.roblox.com/Asset/?id=131139535" | |
179 | s.Volume = 1 | |
180 | s.Pitch = 3 | |
181 | s.Looped = false | |
182 | s.Parent = pm | |
183 | local s = Instance.new("Sound") | |
184 | s.Name = "Fire2" | |
185 | s.SoundId = "http://roblox.com/asset/?id=131257506" | |
186 | s.Volume = 1 | |
187 | s.Pitch = 3 | |
188 | s.Looped = false | |
189 | s.Parent = pm | |
190 | local s = Instance.new("Sound") | |
191 | s.Name = "Reload" | |
192 | s.SoundId = "http://www.roblox.com/Asset/?id=155729479" | |
193 | s.Volume = 1 | |
194 | s.Pitch = 3 | |
195 | s.Looped = false | |
196 | s.Parent = pm | |
197 | local s = Instance.new("Sound") | |
198 | s.Name = "Empty" | |
199 | s.SoundId = "http://www.roblox.com/asset/?id=132464034" | |
200 | s.Volume = 1 | |
201 | s.Pitch = 5 | |
202 | s.Looped = false | |
203 | s.Parent = pm | |
204 | local s = Instance.new("Sound") | |
205 | s.Name = "Lock" | |
206 | s.SoundId = "http://www.roblox.com/Asset/?id=132572980" | |
207 | s.Volume = 1 | |
208 | s.Pitch = 3 | |
209 | s.Looped = false | |
210 | s.Parent = pm | |
211 | local s = Instance.new("Sound") | |
212 | s.Name = "Release" | |
213 | s.SoundId = "http://www.roblox.com/Asset/?id=155729479" | |
214 | s.Volume = 1 | |
215 | s.Pitch = 4 | |
216 | s.Looped = false | |
217 | s.Parent = pm | |
218 | local s = Instance.new("Sound") | |
219 | s.Name = "Switch" | |
220 | s.SoundId = "http://www.roblox.com/asset/?id=2697295" | |
221 | s.Volume = 1 | |
222 | s.Pitch = 10 | |
223 | s.Looped = false | |
224 | s.Parent = pm | |
225 | local p = Instance.new("Part") | |
226 | p.Name = "ShellOut" | |
227 | p.formFactor = "Symmetric" | |
228 | p.Size = Vector3.new(1, 1, 1) | |
229 | p.Transparency = 1 | |
230 | p.Locked = true | |
231 | p.CanCollide = false | |
232 | p.TopSurface = 0 | |
233 | p.BottomSurface = 0 | |
234 | p.Parent = model | |
235 | local w = Instance.new("Weld") | |
236 | w.Part0 = p | |
237 | w.Part1 = pm | |
238 | w.C0 = CFrame.new(0.5, 0, 0.5) * CFrame.fromEulerAnglesXYZ(0, math.rad(45), 0) | |
239 | w.C1 = CFrame.new() | |
240 | w.Parent = p | |
241 | local p = Instance.new("Part") | |
242 | p.Name = "Grip" | |
243 | p.formFactor = "Symmetric" | |
244 | p.Size = Vector3.new(1, 1, 1) | |
245 | p.BrickColor = GC | |
246 | p.Reflectance = MR | |
247 | p.CanCollide = false | |
248 | p.Locked = true | |
249 | p.TopSurface = 0 | |
250 | p.BottomSurface = 0 | |
251 | p.Parent = model | |
252 | local m = Instance.new("SpecialMesh") | |
253 | m.MeshType = "Brick" | |
254 | m.Scale = Vector3.new(0.261, 0.42, 0.7) | |
255 | m.Parent = p | |
256 | local w = Instance.new("Weld") | |
257 | w.Part0 = p | |
258 | w.Part1 = pm | |
259 | w.C0 = CFrame.new(0, -0.022, -0.4) * CFrame.fromEulerAnglesXYZ(math.rad(15), 0, 0) | |
260 | w.C1 = CFrame.new() | |
261 | w.Parent = p | |
262 | local p = Instance.new("Part") | |
263 | p.Name = "Magazine" | |
264 | p.formFactor = "Symmetric" | |
265 | p.Size = Vector3.new(1, 1, 1) | |
266 | p.BrickColor = MC | |
267 | p.Reflectance = MR | |
268 | p.CanCollide = false | |
269 | p.Locked = true | |
270 | p.TopSurface = 0 | |
271 | p.BottomSurface = 0 | |
272 | p.Parent = model | |
273 | local m = Instance.new("SpecialMesh") | |
274 | m.MeshType = "Brick" | |
275 | m.Scale = Vector3.new(0.24, 0.38, 0.74) | |
276 | m.Parent = p | |
277 | local w = Instance.new("Weld") | |
278 | w.Part0 = p | |
279 | w.Part1 = pm | |
280 | w.C0 = CFrame.new(0, -0.02, -0.42) * CFrame.fromEulerAnglesXYZ(math.rad(15), 0, 0) | |
281 | w.C1 = CFrame.new() | |
282 | w.Parent = p | |
283 | local p = Instance.new("Part") | |
284 | p.Name = "Rail" | |
285 | p.CanCollide = false | |
286 | p.formFactor = "Symmetric" | |
287 | p.Size = Vector3.new(1, 1, 1) | |
288 | p.BrickColor = GC | |
289 | p.Reflectance = MR | |
290 | p.Locked = true | |
291 | p.TopSurface = 0 | |
292 | p.BottomSurface = 0 | |
293 | p.Parent = model | |
294 | local m = Instance.new("BlockMesh") | |
295 | m.Scale = Vector3.new(0.15, 0.05, 0.1) | |
296 | m.Parent = p | |
297 | local w = Instance.new("Weld") | |
298 | w.Part0 = p | |
299 | w.Part1 = pm | |
300 | w.C0 = CFrame.new(0, 0.55, -0.08) | |
301 | w.C1 = CFrame.new() | |
302 | w.Parent = p | |
303 | local p = Instance.new("Part") | |
304 | p.Name = "Rail" | |
305 | p.CanCollide = false | |
306 | p.formFactor = "Symmetric" | |
307 | p.Size = Vector3.new(1, 1, 1) | |
308 | p.BrickColor = GC | |
309 | p.Reflectance = MR | |
310 | p.Locked = true | |
311 | p.TopSurface = 0 | |
312 | p.BottomSurface = 0 | |
313 | p.Parent = model | |
314 | local m = Instance.new("BlockMesh") | |
315 | m.Scale = Vector3.new(0.15, 0.05, 0.1) | |
316 | m.Parent = p | |
317 | local w = Instance.new("Weld") | |
318 | w.Part0 = p | |
319 | w.Part1 = pm | |
320 | w.C0 = CFrame.new(0, 0.65, -0.08) | |
321 | w.C1 = CFrame.new() | |
322 | w.Parent = p | |
323 | local p = Instance.new("Part") | |
324 | p.Name = "Rail" | |
325 | p.CanCollide = false | |
326 | p.formFactor = "Symmetric" | |
327 | p.Size = Vector3.new(1, 1, 1) | |
328 | p.BrickColor = GC | |
329 | p.Reflectance = MR | |
330 | p.Locked = true | |
331 | p.TopSurface = 0 | |
332 | p.BottomSurface = 0 | |
333 | p.Parent = model | |
334 | local m = Instance.new("BlockMesh") | |
335 | m.Scale = Vector3.new(0.15, 0.05, 0.1) | |
336 | m.Parent = p | |
337 | local w = Instance.new("Weld") | |
338 | w.Part0 = p | |
339 | w.Part1 = pm | |
340 | w.C0 = CFrame.new(0, 0.75, -0.08) | |
341 | w.C1 = CFrame.new() | |
342 | w.Parent = p | |
343 | local p = Instance.new("Part") | |
344 | p.Name = "Trigger" | |
345 | p.formFactor = "Symmetric" | |
346 | p.Size = Vector3.new(1, 1, 1) | |
347 | p.BrickColor = BrickColor.new("Black") | |
348 | p.Reflectance = MR | |
349 | p.CanCollide = false | |
350 | p.Locked = true | |
351 | p.TopSurface = 0 | |
352 | p.BottomSurface = 0 | |
353 | p.Parent = model | |
354 | local m = Instance.new("BlockMesh") | |
355 | m.Scale = Vector3.new(0.1, 0.4, 0.16) | |
356 | m.Parent = p | |
357 | local w = Instance.new("Weld") | |
358 | w.Part0 = p | |
359 | w.Part1 = pm | |
360 | w.C0 = CFrame.new(0, 0.06, -0.25) | |
361 | w.C1 = CFrame.new() | |
362 | w.Parent = p | |
363 | local p = Instance.new("Part") | |
364 | p.Name = "TriggerGuard" | |
365 | p.formFactor = "Symmetric" | |
366 | p.Size = Vector3.new(1, 1, 1) | |
367 | p.BrickColor = GC | |
368 | p.CanCollide = false | |
369 | p.Locked = true | |
370 | p.TopSurface = 0 | |
371 | p.BottomSurface = 0 | |
372 | p.Parent = model | |
373 | local m = Instance.new("SpecialMesh") | |
374 | m.MeshType = "FileMesh" | |
375 | m.MeshId = "http://www.roblox.com/asset/?id=3270017" | |
376 | m.Scale = Vector3.new(0.34, 0.34, 0.8) | |
377 | m.Parent = p | |
378 | local w = Instance.new("Weld") | |
379 | w.Part0 = p | |
380 | w.Part1 = pm | |
381 | w.C0 = CFrame.new(-0.25, 0.18, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0) | |
382 | w.C1 = CFrame.new() | |
383 | w.Parent = p | |
384 | local p = Instance.new("Part") | |
385 | p.Name = "Base" | |
386 | p.CanCollide = false | |
387 | p.formFactor = "Symmetric" | |
388 | p.Size = Vector3.new(1, 1, 1) | |
389 | p.BrickColor = GC | |
390 | p.Reflectance = MR | |
391 | p.Locked = true | |
392 | p.TopSurface = 0 | |
393 | p.BottomSurface = 0 | |
394 | p.Parent = model | |
395 | local m = Instance.new("SpecialMesh") | |
396 | m.MeshType = "Brick" | |
397 | m.Scale = Vector3.new(0.261, 0.9, 0.248) | |
398 | m.Parent = p | |
399 | local w = Instance.new("Weld") | |
400 | w.Part0 = p | |
401 | w.Part1 = pm | |
402 | w.C0 = CFrame.new(0, 0.045, -0.066) | |
403 | w.C1 = CFrame.new() | |
404 | w.Parent = p | |
405 | local p = Instance.new("Part") | |
406 | p.Name = "Base" | |
407 | p.CanCollide = false | |
408 | p.formFactor = "Symmetric" | |
409 | p.Size = Vector3.new(1, 1, 1) | |
410 | p.BrickColor = GC | |
411 | p.Reflectance = MR | |
412 | p.Locked = true | |
413 | p.TopSurface = 0 | |
414 | p.BottomSurface = 0 | |
415 | p.Parent = model | |
416 | local m = Instance.new("SpecialMesh") | |
417 | m.MeshType = "Brick" | |
418 | m.Scale = Vector3.new(0.221, 0.5, 0.15) | |
419 | m.Parent = p | |
420 | local w = Instance.new("Weld") | |
421 | w.Part0 = p | |
422 | w.Part1 = pm | |
423 | w.C0 = CFrame.new(0, 0.6, -0.04) | |
424 | w.C1 = CFrame.new() | |
425 | w.Parent = p | |
426 | local ps = Instance.new("Part") | |
427 | ps.Name = "Slide" | |
428 | ps.CanCollide = false | |
429 | ps.formFactor = "Symmetric" | |
430 | ps.Size = Vector3.new(1, 1, 1) | |
431 | ps.BrickColor = MC | |
432 | ps.Reflectance = MR | |
433 | ps.Locked = true | |
434 | ps.TopSurface = 0 | |
435 | ps.BottomSurface = 0 | |
436 | ps.Parent = model | |
437 | local m = Instance.new("SpecialMesh") | |
438 | m.MeshType = "Brick" | |
439 | m.Name = "Mesh" | |
440 | m.Scale = Vector3.new(0.26, 0.2, 0.24) | |
441 | m.Offset = Vector3.new(0, 0, 0.2) | |
442 | m.Parent = ps | |
443 | local w = Instance.new("Weld") | |
444 | w.Part0 = ps | |
445 | w.Part1 = pm | |
446 | if magazine.Value ~= 0 then | |
447 | w.C0 = CFrame.new(0, 0.4, 0.06) | |
448 | else | |
449 | w.C0 = CFrame.new(0, 0.1, 0.06) | |
450 | end | |
451 | w.C1 = CFrame.new() | |
452 | w.Parent = ps | |
453 | local p = Instance.new("Part") | |
454 | p.Name = "SlideBottom" | |
455 | p.CanCollide = false | |
456 | p.formFactor = "Symmetric" | |
457 | p.Size = Vector3.new(1, 1, 1) | |
458 | p.BrickColor = MC | |
459 | p.Reflectance = MR | |
460 | p.Locked = true | |
461 | p.TopSurface = 0 | |
462 | p.BottomSurface = 0 | |
463 | p.Parent = model | |
464 | local m = Instance.new("SpecialMesh") | |
465 | m.MeshType = "Brick" | |
466 | m.Name = "Mesh" | |
467 | m.Scale = Vector3.new(0.26, 0.9, 0.16) | |
468 | m.Parent = p | |
469 | local w = Instance.new("Weld") | |
470 | w.Part0 = p | |
471 | w.Part1 = ps | |
472 | w.C0 = CFrame.new(0, -0.35, -0.06) | |
473 | w.C1 = CFrame.new() | |
474 | w.Parent = p | |
475 | local p = Instance.new("Part") | |
476 | p.Name = "GuideBottom" | |
477 | p.CanCollide = false | |
478 | p.formFactor = "Symmetric" | |
479 | p.Size = Vector3.new(1, 1, 1) | |
480 | p.BrickColor = MC | |
481 | p.Reflectance = MR | |
482 | p.Locked = true | |
483 | p.TopSurface = 0 | |
484 | p.BottomSurface = 0 | |
485 | p.Parent = model | |
486 | local m = Instance.new("SpecialMesh") | |
487 | m.MeshType = "Brick" | |
488 | m.Name = "Mesh" | |
489 | m.Scale = Vector3.new(0.22, 0.5, 0.22) | |
490 | m.Parent = p | |
491 | local w = Instance.new("Weld") | |
492 | w.Part0 = p | |
493 | w.Part1 = ps | |
494 | w.C0 = CFrame.new(0, 0.2, -0.04) | |
495 | w.C1 = CFrame.new() | |
496 | w.Parent = p | |
497 | local p = Instance.new("Part") | |
498 | p.Name = "Guide" | |
499 | p.CanCollide = false | |
500 | p.formFactor = "Symmetric" | |
501 | p.Size = Vector3.new(1, 1, 1) | |
502 | p.BrickColor = MC | |
503 | p.Reflectance = MR | |
504 | p.Locked = true | |
505 | p.TopSurface = 0 | |
506 | p.BottomSurface = 0 | |
507 | p.Parent = model | |
508 | local m = Instance.new("SpecialMesh") | |
509 | m.MeshType = "Brick" | |
510 | m.Name = "Mesh" | |
511 | m.Scale = Vector3.new(0.22, 0.5, 0.22) | |
512 | m.Parent = p | |
513 | local w = Instance.new("Weld") | |
514 | w.Part0 = p | |
515 | w.Part1 = ps | |
516 | w.C0 = CFrame.new(0, 0.2, 0.01) | |
517 | w.C1 = CFrame.new() | |
518 | w.Parent = p | |
519 | local p = Instance.new("Part") | |
520 | p.Name = "Slide1" | |
521 | p.CanCollide = false | |
522 | p.formFactor = "Symmetric" | |
523 | p.Size = Vector3.new(1, 1, 1) | |
524 | p.BrickColor = MC | |
525 | p.Reflectance = MR | |
526 | p.Locked = true | |
527 | p.TopSurface = 0 | |
528 | p.BottomSurface = 0 | |
529 | p.Parent = model | |
530 | local m = Instance.new("SpecialMesh") | |
531 | m.MeshType = "Brick" | |
532 | m.Name = "Mesh" | |
533 | m.Scale = Vector3.new(0.13, 0.6, 0.24) | |
534 | m.Parent = p | |
535 | local w = Instance.new("Weld") | |
536 | w.Part0 = p | |
537 | w.Part1 = ps | |
538 | w.C0 = CFrame.new(0.065, -0.2, 0) | |
539 | w.C1 = CFrame.new() | |
540 | w.Parent = p | |
541 | local p = Instance.new("Part") | |
542 | p.Name = "Slide2" | |
543 | p.CanCollide = false | |
544 | p.formFactor = "Symmetric" | |
545 | p.Size = Vector3.new(1, 1, 1) | |
546 | p.BrickColor = MC | |
547 | p.Reflectance = MR | |
548 | p.Locked = true | |
549 | p.TopSurface = 0 | |
550 | p.BottomSurface = 0 | |
551 | p.Parent = model | |
552 | local m = Instance.new("SpecialMesh") | |
553 | m.MeshType = "Brick" | |
554 | m.Name = "Mesh" | |
555 | m.Scale = Vector3.new(0.26, 0.6, 0.12) | |
556 | m.Parent = p | |
557 | local w = Instance.new("Weld") | |
558 | w.Part0 = p | |
559 | w.Part1 = ps | |
560 | w.C0 = CFrame.new(0, -0.2, -0.03) | |
561 | w.C1 = CFrame.new() | |
562 | w.Parent = p | |
563 | local p = Instance.new("Part") | |
564 | p.Name = "Slide3" | |
565 | p.CanCollide = false | |
566 | p.formFactor = "Symmetric" | |
567 | p.Size = Vector3.new(1, 1, 1) | |
568 | p.BrickColor = MC | |
569 | p.Reflectance = MR | |
570 | p.Locked = true | |
571 | p.TopSurface = 0 | |
572 | p.BottomSurface = 0 | |
573 | p.Parent = model | |
574 | local m = Instance.new("SpecialMesh") | |
575 | m.MeshType = "Brick" | |
576 | m.Name = "Mesh" | |
577 | m.Scale = Vector3.new(0.26, 0.45, 0.24) | |
578 | m.Parent = p | |
579 | local w = Instance.new("Weld") | |
580 | w.Part0 = p | |
581 | w.Part1 = ps | |
582 | w.C0 = CFrame.new(0, -0.58, 0) | |
583 | w.C1 = CFrame.new() | |
584 | w.Parent = p | |
585 | local p = Instance.new("Part") | |
586 | p.Name = "Slide3" | |
587 | p.CanCollide = false | |
588 | p.formFactor = "Symmetric" | |
589 | p.Size = Vector3.new(1, 1, 1) | |
590 | p.BrickColor = MC | |
591 | p.Reflectance = MR | |
592 | p.Locked = true | |
593 | p.TopSurface = 0 | |
594 | p.BottomSurface = 0 | |
595 | p.Parent = model | |
596 | local m = Instance.new("SpecialMesh") | |
597 | m.MeshType = "Brick" | |
598 | m.Name = "Mesh" | |
599 | m.Scale = Vector3.new(0.33, 0.18, 0.22) | |
600 | m.Parent = p | |
601 | local w = Instance.new("Weld") | |
602 | w.Part0 = p | |
603 | w.Part1 = ps | |
604 | w.C0 = CFrame.new(0, -0.64, -0.01) | |
605 | w.C1 = CFrame.new() | |
606 | w.Parent = p | |
607 | local p = Instance.new("Part") | |
608 | p.Name = "Shell" | |
609 | p.formFactor = "Custom" | |
610 | p.Size = Vector3.new(0.2, 0.26, 0.2) | |
611 | p.BrickColor = BrickColor.new("Really black") | |
612 | if magazine.Value ~= 0 then | |
613 | p.Transparency = 0 | |
614 | else | |
615 | p.Transparency = 1 | |
616 | end | |
617 | p.Reflectance = 0 | |
618 | p.CanCollide = false | |
619 | p.Locked = true | |
620 | p.TopSurface = 0 | |
621 | p.BottomSurface = 0 | |
622 | p.Parent = model | |
623 | local m = Instance.new("CylinderMesh") | |
624 | m.Scale = Vector3.new(0.4, 1, 0.4) | |
625 | m.Parent = p | |
626 | local w = Instance.new("Weld") | |
627 | w.Part0 = p | |
628 | w.Part1 = pm | |
629 | w.C0 = CFrame.new(0, -0.07, 0.07) | |
630 | w.C1 = CFrame.new() | |
631 | w.Parent = p | |
632 | local p = Instance.new("Part") | |
633 | p.Name = "RearSight" | |
634 | p.CanCollide = false | |
635 | p.formFactor = "Symmetric" | |
636 | p.Size = Vector3.new(1, 1, 1) | |
637 | p.BrickColor = MC | |
638 | p.Reflectance = MR | |
639 | p.Locked = true | |
640 | p.TopSurface = 0 | |
641 | p.BottomSurface = 0 | |
642 | p.Parent = model | |
643 | local m = Instance.new("BlockMesh") | |
644 | m.Name = "Mesh" | |
645 | m.Scale = Vector3.new(0.08, 0.08, 0.08) | |
646 | m.Parent = p | |
647 | local w = Instance.new("Weld") | |
648 | w.Part0 = p | |
649 | w.Part1 = ps | |
650 | w.C0 = CFrame.new(0.07, -0.7, 0.12) | |
651 | w.C1 = CFrame.new() | |
652 | w.Parent = p | |
653 | local p = Instance.new("Part") | |
654 | p.Name = "RearSight" | |
655 | p.CanCollide = false | |
656 | p.formFactor = "Symmetric" | |
657 | p.Size = Vector3.new(1, 1, 1) | |
658 | p.BrickColor = SC | |
659 | p.Reflectance = MR | |
660 | p.Locked = true | |
661 | p.TopSurface = 0 | |
662 | p.BottomSurface = 0 | |
663 | p.Parent = model | |
664 | local m = Instance.new("CylinderMesh") | |
665 | m.Name = "Mesh" | |
666 | m.Scale = Vector3.new(0.04, 0.084, 0.04) | |
667 | m.Parent = p | |
668 | local w = Instance.new("Weld") | |
669 | w.Part0 = p | |
670 | w.Part1 = ps | |
671 | w.C0 = CFrame.new(0.07, -0.705, 0.12) | |
672 | w.C1 = CFrame.new() | |
673 | w.Parent = p | |
674 | local p = Instance.new("Part") | |
675 | p.Name = "RearSight" | |
676 | p.CanCollide = false | |
677 | p.formFactor = "Symmetric" | |
678 | p.Size = Vector3.new(1, 1, 1) | |
679 | p.BrickColor = SC | |
680 | p.Reflectance = MR | |
681 | p.Locked = true | |
682 | p.TopSurface = 0 | |
683 | p.BottomSurface = 0 | |
684 | p.Parent = model | |
685 | local m = Instance.new("CylinderMesh") | |
686 | m.Name = "Mesh" | |
687 | m.Scale = Vector3.new(0.04, 0.084, 0.04) | |
688 | m.Parent = p | |
689 | local w = Instance.new("Weld") | |
690 | w.Part0 = p | |
691 | w.Part1 = ps | |
692 | w.C0 = CFrame.new(-0.07, -0.705, 0.12) | |
693 | w.C1 = CFrame.new() | |
694 | w.Parent = p | |
695 | local p = Instance.new("Part") | |
696 | p.Name = "RearSight" | |
697 | p.CanCollide = false | |
698 | p.formFactor = "Symmetric" | |
699 | p.Size = Vector3.new(1, 1, 1) | |
700 | p.BrickColor = MC | |
701 | p.Reflectance = MR | |
702 | p.Locked = true | |
703 | p.TopSurface = 0 | |
704 | p.BottomSurface = 0 | |
705 | p.Parent = model | |
706 | local m = Instance.new("BlockMesh") | |
707 | m.Name = "Mesh" | |
708 | m.Scale = Vector3.new(0.08, 0.08, 0.08) | |
709 | m.Parent = p | |
710 | local w = Instance.new("Weld") | |
711 | w.Part0 = p | |
712 | w.Part1 = ps | |
713 | w.C0 = CFrame.new(-0.07, -0.7, 0.12) | |
714 | w.C1 = CFrame.new() | |
715 | w.Parent = p | |
716 | local p = Instance.new("Part") | |
717 | p.Name = "FrontSight" | |
718 | p.CanCollide = false | |
719 | p.formFactor = "Symmetric" | |
720 | p.Size = Vector3.new(1, 1, 1) | |
721 | p.BrickColor = MC | |
722 | p.Reflectance = MR | |
723 | p.Locked = true | |
724 | p.TopSurface = 0 | |
725 | p.BottomSurface = 0 | |
726 | p.Parent = model | |
727 | local m = Instance.new("BlockMesh") | |
728 | m.Name = "Mesh" | |
729 | m.Scale = Vector3.new(0.08, 0.08, 0.08) | |
730 | m.Parent = p | |
731 | local w = Instance.new("Weld") | |
732 | w.Part0 = p | |
733 | w.Part1 = ps | |
734 | w.C0 = CFrame.new(0, 0.35, 0.12) | |
735 | w.C1 = CFrame.new() | |
736 | w.Parent = p | |
737 | local p = Instance.new("Part") | |
738 | p.Name = "FrontSight" | |
739 | p.CanCollide = false | |
740 | p.formFactor = "Symmetric" | |
741 | p.Size = Vector3.new(1, 1, 1) | |
742 | p.BrickColor = SC | |
743 | p.Reflectance = MR | |
744 | p.Locked = true | |
745 | p.TopSurface = 0 | |
746 | p.BottomSurface = 0 | |
747 | p.Parent = model | |
748 | local m = Instance.new("CylinderMesh") | |
749 | m.Scale = Vector3.new(0.04, 0.084, 0.04) | |
750 | m.Parent = p | |
751 | local w = Instance.new("Weld") | |
752 | w.Part0 = p | |
753 | w.Part1 = ps | |
754 | w.C0 = CFrame.new(0, 0.346, 0.12) | |
755 | w.C1 = CFrame.new() | |
756 | w.Parent = p | |
757 | local p = Instance.new("Part") | |
758 | p.Name = "Hole" | |
759 | p.formFactor = "Symmetric" | |
760 | p.Size = Vector3.new(1, 1, 1) | |
761 | p.BrickColor = BrickColor.new("Really black") | |
762 | p.Reflectance = 0 | |
763 | p.CanCollide = false | |
764 | p.Locked = true | |
765 | p.TopSurface = 0 | |
766 | p.BottomSurface = 0 | |
767 | p.Parent = model | |
768 | local m = Instance.new("CylinderMesh") | |
769 | m.Scale = Vector3.new(0.09, 0.901, 0.09) | |
770 | m.Offset = Vector3.new(0, 0.34, 0) | |
771 | m.Parent = p | |
772 | local w = Instance.new("Weld") | |
773 | w.Part0 = p | |
774 | w.Part1 = pm | |
775 | w.C0 = CFrame.new(0, 0.75, 0.07) | |
776 | w.C1 = CFrame.new() | |
777 | w.Parent = p | |
778 | local p = Instance.new("Part") | |
779 | if silenced == false then | |
780 | p.Name = "Muzzle" | |
781 | else | |
782 | p.Name = "Muzzle 2" | |
783 | end | |
784 | p.formFactor = "Symmetric" | |
785 | p.Size = Vector3.new(1, 1, 1) | |
786 | p.BrickColor = BrickColor.new("Really black") | |
787 | p.Reflectance = 0.06 | |
788 | p.CanCollide = false | |
789 | p.Locked = true | |
790 | p.TopSurface = 0 | |
791 | p.BottomSurface = 0 | |
792 | p.Parent = model | |
793 | local m = Instance.new("CylinderMesh") | |
794 | m.Scale = Vector3.new(0.11, 0.9, 0.11) | |
795 | m.Offset = Vector3.new(0, 0.34, 0) | |
796 | m.Parent = p | |
797 | local w = Instance.new("Weld") | |
798 | w.Part0 = p | |
799 | w.Part1 = pm | |
800 | w.C0 = CFrame.new(0, 0.75, 0.07) | |
801 | w.C1 = CFrame.new() | |
802 | w.Parent = p | |
803 | local s = Instance.new("Smoke") | |
804 | s.Enabled = false | |
805 | s.Name = "Smoke" | |
806 | s.RiseVelocity = -5 | |
807 | s.Opacity = 0.3 | |
808 | s.Color = Color3.new(75 / 225, 75 / 225, 75 / 225) | |
809 | s.Size = 1 | |
810 | s.Parent = p | |
811 | local f = Instance.new("Fire") | |
812 | f.Enabled = false | |
813 | f.Name = "Fire" | |
814 | f.Heat = -35 | |
815 | f.Size = 1 | |
816 | f.Parent = p | |
817 | p.Touched:connect(function(hit) onTouched(hit, p, "pistol") end) | |
818 | local p = Instance.new("Part") | |
819 | if silenced == false then | |
820 | p.Name = "Silencer" | |
821 | p.Transparency = 1 | |
822 | else | |
823 | p.Name = "Muzzle" | |
824 | p.Transparency = 0 | |
825 | end | |
826 | p.formFactor = "Symmetric" | |
827 | p.Size = Vector3.new(1, 1, 1) | |
828 | p.BrickColor = BrickColor.new("Really black") | |
829 | p.Reflectance = 0 | |
830 | p.CanCollide = false | |
831 | p.Locked = true | |
832 | p.TopSurface = 0 | |
833 | p.BottomSurface = 0 | |
834 | p.Parent = model | |
835 | local m = Instance.new("CylinderMesh") | |
836 | m.Scale = Vector3.new(0.2, 0.8, 0.2) | |
837 | m.Parent = p | |
838 | local w = Instance.new("Weld") | |
839 | w.Part0 = p | |
840 | w.Part1 = pm | |
841 | w.C0 = CFrame.new(0, 1.26, 0.07) | |
842 | w.C1 = CFrame.new() | |
843 | w.Parent = p | |
844 | local p = Instance.new("Part") | |
845 | p.Name = "Silencer1" | |
846 | if silenced == false then | |
847 | p.Transparency = 1 | |
848 | else | |
849 | p.Transparency = 0 | |
850 | end | |
851 | p.formFactor = "Symmetric" | |
852 | p.Size = Vector3.new(1, 1, 1) | |
853 | p.BrickColor = BrickColor.new("Black") | |
854 | p.Reflectance = 0 | |
855 | p.CanCollide = false | |
856 | p.Locked = true | |
857 | p.TopSurface = 0 | |
858 | p.BottomSurface = 0 | |
859 | p.Parent = model | |
860 | local m = Instance.new("CylinderMesh") | |
861 | m.Scale = Vector3.new(0.21, 0.6, 0.21) | |
862 | m.Parent = p | |
863 | local w = Instance.new("Weld") | |
864 | w.Part0 = p | |
865 | w.Part1 = pm | |
866 | w.C0 = CFrame.new(0, 1.26, 0.07) | |
867 | w.C1 = CFrame.new() | |
868 | w.Parent = p | |
869 | return model | |
870 | end | |
871 | function removeParts(format) | |
872 | if format == "RightHand" then | |
873 | pcall(function() Player.Character[Name]:Remove() end) | |
874 | elseif format == "LeftHand" then | |
875 | pcall(function() Player.Character[Name.. " (Left)"]:Remove() end) | |
876 | elseif format == "RightHolster" then | |
877 | pcall(function() Player.Character[Name.. " (Holstered)"]:Remove() end) | |
878 | elseif format == "LeftHolster" then | |
879 | pcall(function() Player.Character[Name.. " (Holstered, Left)"]:Remove() end) | |
880 | end | |
881 | end | |
882 | function onTouched(hit, source, format) | |
883 | if format == "pistol" then | |
884 | if hit.Parent:FindFirstChild("Humanoid") ~= nil and hit.Parent ~= Player.Character then | |
885 | tagHumanoid(hit.Parent.Humanoid) | |
886 | if canHit == true and melee == true then | |
887 | hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - 0 | |
888 | Player.Character[Name].Handle.Impact:Play() | |
889 | hit.Parent.Humanoid.Sit = true | |
890 | melee = false | |
891 | wait(0.8) | |
892 | melee = true | |
893 | end | |
894 | delay(3, function() untagHumanoid(hit.Parent.Humanoid) end) | |
895 | end | |
896 | end | |
897 | end | |
898 | function SetAngle(Joint, Angle, Character) | |
899 | if Character == nil then return false end | |
900 | local Joints = { | |
901 | Character.Torso:FindFirstChild("Right Shoulder 2"), | |
902 | Character.Torso:FindFirstChild("Left Shoulder 2"), | |
903 | Character.Torso:FindFirstChild("Right Hip 2"), | |
904 | Character.Torso:FindFirstChild("Left Hip 2") | |
905 | } | |
906 | if Joints[Joint] == nil then return false end | |
907 | if Joint == 1 or Joint == 3 then | |
908 | Joints[Joint].DesiredAngle = Angle | |
909 | end | |
910 | if Joint == 2 or Joint == 4 then | |
911 | Joints[Joint].DesiredAngle = -Angle | |
912 | end | |
913 | end | |
914 | function ForceAngle(Joint, Angle, Character) | |
915 | if Character == nil then return false end | |
916 | local Joints = { | |
917 | Character.Torso:FindFirstChild("Right Shoulder 2"), | |
918 | Character.Torso:FindFirstChild("Left Shoulder 2"), | |
919 | Character.Torso:FindFirstChild("Right Hip 2"), | |
920 | Character.Torso:FindFirstChild("Left Hip 2") | |
921 | } | |
922 | if Joints[Joint] == nil then return false end | |
923 | if Joint == 1 or Joint == 3 then | |
924 | Joints[Joint].DesiredAngle = Angle | |
925 | Joints[Joint].CurrentAngle = Angle | |
926 | end | |
927 | if Joint == 2 or Joint == 4 then | |
928 | Joints[Joint].DesiredAngle = -Angle | |
929 | Joints[Joint].CurrentAngle = -Angle | |
930 | end | |
931 | end | |
932 | function SetSpeed(Joint, Speed, Character) | |
933 | if Character == nil then return false end | |
934 | local Joints = { | |
935 | Character.Torso:FindFirstChild("Right Shoulder 2"), | |
936 | Character.Torso:FindFirstChild("Left Shoulder 2"), | |
937 | Character.Torso:FindFirstChild("Right Hip 2"), | |
938 | Character.Torso:FindFirstChild("Left Hip 2") | |
939 | } | |
940 | if Joints[Joint] == nil then return false end | |
941 | Joints[Joint].MaxVelocity = Speed | |
942 | end | |
943 | function DisableLimb(Limb, Character) | |
944 | if Character == nil then return false end | |
945 | if Character:FindFirstChild("Torso") == nil then return false end | |
946 | local Joints = { | |
947 | Character.Torso:FindFirstChild("Right Shoulder"), | |
948 | Character.Torso:FindFirstChild("Left Shoulder"), | |
949 | Character.Torso:FindFirstChild("Right Hip"), | |
950 | Character.Torso:FindFirstChild("Left Hip") | |
951 | } | |
952 | local Limbs = { | |
953 | Character:FindFirstChild("Right Arm"), | |
954 | Character:FindFirstChild("Left Arm"), | |
955 | Character:FindFirstChild("Right Leg"), | |
956 | Character:FindFirstChild("Left Leg") | |
957 | } | |
958 | if Joints[Limb] == nil then return false end | |
959 | if Limbs[Limb] == nil then return false end | |
960 | local Joint = Instance.new("Motor") | |
961 | Joint.Parent = Character.Torso | |
962 | Joint.Part0 = Character.Torso | |
963 | Joint.Part1 = Limbs[Limb] | |
964 | if Limb == 1 then | |
965 | Joint.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0) | |
966 | Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0) | |
967 | Joint.Name = "Right Shoulder 2" | |
968 | elseif Limb == 2 then | |
969 | Joint.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0) | |
970 | Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0) | |
971 | Joint.Name = "Left Shoulder 2" | |
972 | elseif Limb == 3 then | |
973 | Joint.C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0) | |
974 | Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0) | |
975 | Joint.Name = "Right Hip 2" | |
976 | elseif Limb == 4 then | |
977 | Joint.C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0) | |
978 | Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0) | |
979 | Joint.Name = "Left Hip 2" | |
980 | end | |
981 | Joint.MaxVelocity = Joints[Limb].MaxVelocity | |
982 | Joint.CurrentAngle = Joints[Limb].CurrentAngle | |
983 | Joint.DesiredAngle = Joints[Limb].DesiredAngle | |
984 | Joints[Limb]:Remove() | |
985 | end | |
986 | function ResetLimbCFrame(Limb, Character) | |
987 | if Character == nil then return false end | |
988 | if Character.Parent == nil then return false end | |
989 | if Character:FindFirstChild("Torso") == nil then return false end | |
990 | local Joints = { | |
991 | Character.Torso:FindFirstChild("Right Shoulder 2"), | |
992 | Character.Torso:FindFirstChild("Left Shoulder 2"), | |
993 | Character.Torso:FindFirstChild("Right Hip 2"), | |
994 | Character.Torso:FindFirstChild("Left Hip 2") | |
995 | } | |
996 | local Limbs = { | |
997 | Character:FindFirstChild("Right Arm"), | |
998 | Character:FindFirstChild("Left Arm"), | |
999 | Character:FindFirstChild("Right Leg"), | |
1000 | Character:FindFirstChild("Left Leg") | |
1001 | } | |
1002 | if Joints[Limb] == nil then return false end | |
1003 | if Limbs[Limb] == nil then return false end | |
1004 | if Limb == 1 then | |
1005 | Joints[Limb].C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0) | |
1006 | Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0) | |
1007 | elseif Limb == 2 then | |
1008 | Joints[Limb].C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0) | |
1009 | Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0) | |
1010 | elseif Limb == 3 then | |
1011 | Joints[Limb].C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0) | |
1012 | Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0) | |
1013 | elseif Limb == 4 then | |
1014 | Joints[Limb].C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0) | |
1015 | Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0) | |
1016 | end | |
1017 | end | |
1018 | function EnableLimb(Limb, Character) | |
1019 | if Character == nil then return false end | |
1020 | if Character:FindFirstChild("Torso") == nil then return false end | |
1021 | local Joints = { | |
1022 | Character.Torso:FindFirstChild("Right Shoulder 2"), | |
1023 | Character.Torso:FindFirstChild("Left Shoulder 2"), | |
1024 | Character.Torso:FindFirstChild("Right Hip 2"), | |
1025 | Character.Torso:FindFirstChild("Left Hip 2") | |
1026 | } | |
1027 | local Limbs = { | |
1028 | Character:FindFirstChild("Right Arm"), | |
1029 | Character:FindFirstChild("Left Arm"), | |
1030 | Character:FindFirstChild("Right Leg"), | |
1031 | Character:FindFirstChild("Left Leg") | |
1032 | } | |
1033 | if Joints[Limb] == nil then return false end | |
1034 | if Limbs[Limb] == nil then return false end | |
1035 | if Limb == 1 then | |
1036 | Joints[Limb].Name = "Right Shoulder" | |
1037 | elseif Limb == 2 then | |
1038 | Joints[Limb].Name = "Left Shoulder" | |
1039 | elseif Limb == 3 then | |
1040 | Joints[Limb].Name = "Right Hip" | |
1041 | elseif Limb == 4 then | |
1042 | Joints[Limb].Name = "Left Hip" | |
1043 | end | |
1044 | Animate = Character:FindFirstChild("Animate") | |
1045 | if Animate == nil then return false end | |
1046 | Animate = Animate:Clone() | |
1047 | Character.Animate:Remove() | |
1048 | Animate.Parent = Character | |
1049 | end | |
1050 | function playAnimation(format, mouse) | |
1051 | if format == "equip" then | |
1052 | Player.Character[Name.. " (Holstered)"].Handle.Weld:Remove() | |
1053 | local w = Instance.new("Weld") | |
1054 | w.Part0 = Player.Character[Name.. " (Holstered)"].Handle | |
1055 | w.Part1 = Player.Character:FindFirstChild("Right Arm") | |
1056 | w.C0 = CFrame.new(0, 1.2, 0.7) | |
1057 | w.C1 = CFrame.new() | |
1058 | w.Parent = Player.Character[Name.. " (Holstered)"].Handle | |
1059 | for i = 0.01, 1, 0.1 do | |
1060 | if Player.Character:FindFirstChild("Torso") ~= nil then | |
1061 | if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then | |
1062 | Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new() | |
1063 | Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new((-0.55 * i) + (1.5 * (1 - i)), 0.75 * i, 0.35 * i) * CFrame.fromEulerAnglesXYZ(math.rad(315 + ((1 - i) * 50)), 0, math.rad(-90) * i) | |
1064 | Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new() | |
1065 | Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new((-1 * i) + (-1.5 * (1 - i)), 0.5 * i, 0.6 * i) * CFrame.fromEulerAnglesXYZ(math.rad(-90 * i), math.rad(-5 * i), 0) | |
1066 | wait() | |
1067 | else return false end | |
1068 | else return false end | |
1069 | end | |
1070 | return playAnimation("hold") | |
1071 | end | |
1072 | if format == "rightEquip" then | |
1073 | Player.Character[Name.. " (Holstered)"].Handle.Weld:Remove() | |
1074 | local w = Instance.new("Weld") | |
1075 | w.Part0 = Player.Character[Name.. " (Holstered)"].Handle | |
1076 | w.Part1 = Player.Character:FindFirstChild("Right Arm") | |
1077 | w.C0 = CFrame.new(0, 1.2, 0.7) | |
1078 | w.C1 = CFrame.new() | |
1079 | w.Parent = Player.Character[Name.. " (Holstered)"].Handle | |
1080 | for i = 0.01, 1, 0.1 do | |
1081 | if Player.Character:FindFirstChild("Torso") ~= nil then | |
1082 | if Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then | |
1083 | Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new() | |
1084 | Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new((-1 * i) + (-1.5 * (1 - i)), 0.5 * i, 0.6 * i) * CFrame.fromEulerAnglesXYZ(math.rad(-90 * i), math.rad(-5 * i), 0) | |
1085 | wait() | |
1086 | else return false end | |
1087 | else return false end | |
1088 | end | |
1089 | return playAnimation("rightHold") | |
1090 | end | |
1091 | if format == "leftEquip" then | |
1092 | Player.Character[Name.. " (Holstered, Left)"].Handle.Weld:Remove() | |
1093 | local w = Instance.new("Weld") | |
1094 | w.Part0 = Player.Character[Name.. " (Holstered, Left)"].Handle | |
1095 | w.Part1 = Player.Character:FindFirstChild("Left Arm") | |
1096 | w.C0 = CFrame.new(0, 1.2, 0.7) | |
1097 | w.C1 = CFrame.new() | |
1098 | w.Parent = Player.Character[Name.. " (Holstered, Left)"].Handle | |
1099 | for i = 0.01, 1, 0.1 do | |
1100 | if Player.Character:FindFirstChild("Torso") ~= nil then | |
1101 | if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil then | |
1102 | Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new() | |
1103 | Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new((1 * i) + (1.5 * (1 - i)), 0.5 * i, 0.6 * i) * CFrame.fromEulerAnglesXYZ(math.rad(-90 * i), math.rad(5 * i), 0) | |
1104 | wait() | |
1105 | else return false end | |
1106 | else return false end | |
1107 | end | |
1108 | return playAnimation("leftHold") | |
1109 | end | |
1110 | if format == "unequip" then | |
1111 | for i = 1, 0.01, -0.1 do | |
1112 | if Player.Character:FindFirstChild("Torso") ~= nil then | |
1113 | if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then | |
1114 | Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new() | |
1115 | Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new((-0.55 * i) + (1.5 * (1 - i)), 0.75 * i, 0.35 * i) * CFrame.fromEulerAnglesXYZ(math.rad(315 + ((1 - i) * 50)), 0, math.rad(-90) * i) | |
1116 | Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new() | |
1117 | Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new((-1 * i) + (-1.5 * (1 - i)), 0.5 * i, 0.6 * i) * CFrame.fromEulerAnglesXYZ(math.rad(-90 * i), math.rad(-5 * i), 0) | |
1118 | wait() | |
1119 | else return false end | |
1120 | else return false end | |
1121 | end | |
1122 | return true | |
1123 | end | |
1124 | if format == "leftUnequip" then | |
1125 | for i = 1, 0.01, -0.1 do | |
1126 | if Player.Character:FindFirstChild("Torso") ~= nil then | |
1127 | if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil then | |
1128 | Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new() | |
1129 | Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new((1 * i) + (1.5 * (1 - i)), 0.5 * i, 0.6 * i) * CFrame.fromEulerAnglesXYZ(math.rad(-90 * i), math.rad(5 * i), 0) | |
1130 | wait() | |
1131 | else return false end | |
1132 | else return false end | |
1133 | end | |
1134 | return true | |
1135 | end | |
1136 | if format == "rightUnequip" then | |
1137 | for i = 1, 0.01, -0.1 do | |
1138 | if Player.Character:FindFirstChild("Torso") ~= nil then | |
1139 | if Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then | |
1140 | Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new() | |
1141 | Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new((-1 * i) + (-1.5 * (1 - i)), 0.5 * i, 0.6 * i) * CFrame.fromEulerAnglesXYZ(math.rad(-90 * i), math.rad(-5 * i), 0) | |
1142 | wait() | |
1143 | else return false end | |
1144 | else return false end | |
1145 | end | |
1146 | return true | |
1147 | end | |
1148 | if format == "hold" then | |
1149 | if Player.Character:FindFirstChild("Torso") ~= nil then | |
1150 | if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then | |
1151 | Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new() | |
1152 | Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55, 0.75, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(315), 0, math.rad(-90)) | |
1153 | Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new() | |
1154 | Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5), 0) | |
1155 | else return false end | |
1156 | else return false end | |
1157 | end | |
1158 | if format == "rightHold" then | |
1159 | if Player.Character:FindFirstChild("Torso") ~= nil then | |
1160 | if Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then | |
1161 | Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new() | |
1162 | Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.72, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5), math.rad(-5)) | |
1163 | else return false end | |
1164 | else return false end | |
1165 | end | |
1166 | if format == "leftHold" then | |
1167 | if Player.Character:FindFirstChild("Torso") ~= nil then | |
1168 | if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil then | |
1169 | Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new() | |
1170 | Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(0.72, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(5), math.rad(5)) | |
1171 | else return false end | |
1172 | else return false end | |
1173 | end | |
1174 | if format == "reload" then | |
1175 | coroutine.wrap(function() | |
1176 | Player.Character[Name].WeldPoint.Weld.C0 = CFrame.new(0, 0.7, 0.68) | |
1177 | for i = 0, 30, 15 do | |
1178 | pcall(function() Player.Character[Name].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(-i), 0, 0) end) | |
1179 | wait() | |
1180 | end | |
1181 | pcall(function() Player.Character[Name].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(-30), 0, 0) end) | |
1182 | end)() | |
1183 | Player.Character[Name].Handle.Empty:Play() | |
1184 | for i = 0, 25, 7.5 do | |
1185 | if Player.Character:FindFirstChild("Torso") ~= nil then | |
1186 | if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then | |
1187 | Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new() | |
1188 | Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5 + (i * 0.025), 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(5 + (i * 0.8)), 0) | |
1189 | wait() | |
1190 | else return false end | |
1191 | else return false end | |
1192 | end | |
1193 | Player.Character[Name].Handle.Release:Play() | |
1194 | Player.Character[Name].Shell.Transparency = 1 | |
1195 | Player.Character[Name].Magazine.Transparency = 1 | |
1196 | CamShake(15, 50000) | |
1197 | local magazineDrop = Player.Character[Name].Magazine:Clone() | |
1198 | magazineDrop.Transparency = 0 | |
1199 | magazineDrop.Parent = game:GetService("Workspace") | |
1200 | coroutine.resume(coroutine.create(function(part) wait(4.5) for i = 0, 1, 0.1 do part.Transparency = i wait() end part:Remove() end), magazineDrop) | |
1201 | delay(0.1, function() magazineDrop.CanCollide = true end) | |
1202 | Player.Character[Name].Handle.Reload:Play() | |
1203 | local magazineNew = Player.Character[Name].Magazine:Clone() | |
1204 | magazineNew.Name = "New Magazine" | |
1205 | magazineNew.Transparency = 0 | |
1206 | magazineNew.Parent = Player.Character[Name] | |
1207 | local w = Instance.new("Weld") | |
1208 | w.Part0 = magazineNew | |
1209 | w.Part1 = Player.Character:FindFirstChild("Left Arm") | |
1210 | w.C0 = CFrame.new(0, 1.1, 0) | |
1211 | w.C1 = CFrame.new() * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0) | |
1212 | w.Parent = magazineNew | |
1213 | for i = 25, 0, -5 do | |
1214 | if Player.Character:FindFirstChild("Torso") ~= nil then | |
1215 | if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then | |
1216 | Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new() | |
1217 | Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55 + (i / 50), 0.75 - (i / 50), 0.35 + (i / 22.5)) * CFrame.fromEulerAnglesXYZ(math.rad(315 - (i * 2)), math.rad(-i * 3.5), math.rad(-90)) | |
1218 | wait() | |
1219 | else return false end | |
1220 | else return false end | |
1221 | end | |
1222 | Player.Character[Name].Magazine.Transparency = 0 | |
1223 | Player.Character[Name].Shell.Transparency = 0 | |
1224 | Player.Character[Name]["New Magazine"]:Remove() | |
1225 | for i = 25, 0, -7.5 do | |
1226 | if Player.Character:FindFirstChild("Torso") ~= nil then | |
1227 | if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then | |
1228 | Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new() | |
1229 | Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5 + (i * 0.025), 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(5 + (i * 0.8)), 0) | |
1230 | wait() | |
1231 | else return false end | |
1232 | else return false end | |
1233 | end | |
1234 | coroutine.wrap(function() | |
1235 | Player.Character[Name].WeldPoint.Weld.C0 = CFrame.new(0, 0.9, 0.68) | |
1236 | for i = 30, 0, -15 do | |
1237 | pcall(function() Player.Character[Name].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(-i), 0, 0) end) | |
1238 | wait() | |
1239 | end | |
1240 | pcall(function() Player.Character[Name].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(0), 0, 0) end) | |
1241 | end)() | |
1242 | for i = 0, 10, 5 do | |
1243 | if Player.Character:FindFirstChild("Torso") ~= nil then | |
1244 | if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then | |
1245 | Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new() | |
1246 | Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55, 0.75, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(315), math.rad(-i), math.rad(-90)) | |
1247 | Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new() | |
1248 | Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 + i), math.rad(-5), 0) | |
1249 | wait() | |
1250 | else return false end | |
1251 | else return false end | |
1252 | end | |
1253 | if magazine.Value == 0 then | |
1254 | wait(0.02) | |
1255 | Player.Character[Name].Handle.Lock.Pitch = 1.5 | |
1256 | Player.Character[Name].Handle.Lock:Play() | |
1257 | Player.Character[Name].Slide.Weld.C0 = CFrame.new(0, 0.4, 0.06) | |
1258 | CamShake(1, 50000) | |
1259 | CamShake(1, -50000) | |
1260 | wait(0.02) | |
1261 | else end | |
1262 | for i = 10, 0, -5 do | |
1263 | if Player.Character:FindFirstChild("Torso") ~= nil then | |
1264 | if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then | |
1265 | Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new() | |
1266 | Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55, 0.75, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(315), math.rad(-i), math.rad(-90)) | |
1267 | Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new() | |
1268 | Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 + i), math.rad(-5), 0) | |
1269 | wait() | |
1270 | else return false end | |
1271 | else return false end | |
1272 | end | |
1273 | wait(0.04) | |
1274 | end | |
1275 | if format == "reloadDual" then | |
1276 | for i = 0, 25, 7.5 do | |
1277 | if Player.Character:FindFirstChild("Torso") ~= nil then | |
1278 | if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then | |
1279 | Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new() | |
1280 | Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(5), 0) | |
1281 | Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new() | |
1282 | Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0) | |
1283 | wait() | |
1284 | else return false end | |
1285 | else return false end | |
1286 | end | |
1287 | coroutine.wrap(function() | |
1288 | Player.Character[Name].WeldPoint.Weld.C0 = CFrame.new(0, 0.9, 1) | |
1289 | Player.Character[Name.. " (Left)"].WeldPoint.Weld.C0 = CFrame.new(0, 0.9, 1) | |
1290 | for i = 0, 360, 15 do | |
1291 | pcall(function() Player.Character[Name].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(-i), 0, 0) end) | |
1292 | pcall(function() Player.Character[Name.. " (Left)"].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(-i), 0, 0) end) | |
1293 | wait() | |
1294 | end | |
1295 | pcall(function() Player.Character[Name].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(-360), 0, 0) end) | |
1296 | pcall(function() Player.Character[Name.. " (Left)"].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(-360), 0, 0) end) | |
1297 | end)() | |
1298 | if magazine.Value == 0 then | |
1299 | Player.Character[Name].Shell.Transparency = 1 | |
1300 | Player.Character[Name.. " (Left)"].Shell.Transparency = 1 | |
1301 | Player.Character[Name].Slide.Weld.C0 = CFrame.new(0, 0.1, 0.06) | |
1302 | Player.Character[Name.. " (Left)"].Slide.Weld.C0 = CFrame.new(0, 0.1, 0.06) | |
1303 | else end | |
1304 | wait(0.1) | |
1305 | CamShake(1, 40000) | |
1306 | Player.Character[Name].Handle.Release:Play() | |
1307 | Player.Character[Name].Magazine.Transparency = 1 | |
1308 | local magazineDrop = Player.Character[Name].Magazine:Clone() | |
1309 | magazineDrop.Transparency = 0 | |
1310 | magazineDrop.Parent = game:GetService("Workspace") | |
1311 | coroutine.resume(coroutine.create(function(part) wait(4.5) for i = 0, 1, 0.1 do part.Transparency = i wait() end part:Remove() end), magazineDrop) | |
1312 | delay(0.1, function() magazineDrop.CanCollide = true end) | |
1313 | wait(math.random(0.1, 0.25)) | |
1314 | Player.Character[Name].Handle.Release:Play() | |
1315 | Player.Character[Name.. " (Left)"].Magazine.Transparency = 1 | |
1316 | local magazineDropDual = Player.Character[Name.. " (Left)"].Magazine:Clone() | |
1317 | magazineDropDual.Transparency = 0 | |
1318 | magazineDropDual.Parent = game:GetService("Workspace") | |
1319 | coroutine.resume(coroutine.create(function(part) wait(4.5) for i = 0, 1, 0.1 do part.Transparency = i wait() end part:Remove() end), magazineDropDual) | |
1320 | delay(0.1, function() magazineDropDual.CanCollide = true end) | |
1321 | for i = 0, 25, 7.5 do | |
1322 | if Player.Character:FindFirstChild("Torso") ~= nil then | |
1323 | if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then | |
1324 | Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new() | |
1325 | Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(5), 0) | |
1326 | Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new() | |
1327 | Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0) | |
1328 | wait() | |
1329 | else return false end | |
1330 | else return false end | |
1331 | end | |
1332 | local magazineNew = Player.Character[Name].Magazine:Clone() | |
1333 | magazineNew.Name = "New Magazine" | |
1334 | magazineNew.Transparency = 0 | |
1335 | magazineNew.Parent = Player.Character[Name] | |
1336 | local w = Instance.new("Weld") | |
1337 | w.Part0 = magazineNew | |
1338 | w.Part1 = Player.Character:FindFirstChild("Right Arm") | |
1339 | w.C0 = CFrame.new(0, 1.1, 0) | |
1340 | w.C1 = CFrame.new() | |
1341 | w.Parent = magazineNew | |
1342 | local magazineNewL = Player.Character[Name.. " (Left)"].Magazine:Clone() | |
1343 | magazineNewL.Name = "New Magazine L" | |
1344 | magazineNewL.Transparency = 0 | |
1345 | magazineNewL.Parent = Player.Character[Name.. " (Left)"] | |
1346 | local w = Instance.new("Weld") | |
1347 | w.Part0 = magazineNewL | |
1348 | w.Part1 = Player.Character:FindFirstChild("Left Arm") | |
1349 | w.C0 = CFrame.new(0, 1.1, 0) | |
1350 | w.C1 = CFrame.new() | |
1351 | w.Parent = magazineNewL | |
1352 | for i = 125, 0, -15 do | |
1353 | if Player.Character:FindFirstChild("Torso") ~= nil then | |
1354 | if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then | |
1355 | Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new() | |
1356 | Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad((-90 - i) + 100), math.rad(5), 0) | |
1357 | Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new() | |
1358 | Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad((-90 - i) + 100), math.rad(-5), 0) | |
1359 | wait() | |
1360 | else return false end | |
1361 | else return false end | |
1362 | end | |
1363 | Player.Character[Name].Handle.Reload:Play() | |
1364 | Player.Character[Name].Magazine.Transparency = 0 | |
1365 | Player.Character[Name].Shell.Transparency = 0 | |
1366 | Player.Character[Name.. " (Left)"].Magazine.Transparency = 0 | |
1367 | Player.Character[Name.. " (Left)"].Shell.Transparency = 0 | |
1368 | Player.Character[Name]["New Magazine"]:Remove() | |
1369 | Player.Character[Name.. " (Left)"]["New Magazine L"]:Remove() | |
1370 | Player.Character[Name].WeldPoint.Weld.C0 = CFrame.new(0, 0.9, 0.68) | |
1371 | Player.Character[Name.. " (Left)"].WeldPoint.Weld.C0 = CFrame.new(0, 0.9, 0.68) | |
1372 | for i = 0, 125, 15 do | |
1373 | if Player.Character:FindFirstChild("Torso") ~= nil then | |
1374 | if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then | |
1375 | Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new() | |
1376 | Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad((-90 - i) + 100), math.rad(5), 0) | |
1377 | Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new() | |
1378 | Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad((-90 - i) + 100), math.rad(-5), 0) | |
1379 | wait() | |
1380 | else return false end | |
1381 | else return false end | |
1382 | end | |
1383 | if magazine.Value == 0 then | |
1384 | Player.Character[Name].Handle.Lock.Pitch = 1.5 | |
1385 | Player.Character[Name].Handle.Lock:Play() | |
1386 | Player.Character[Name].Slide.Weld.C0 = CFrame.new(0, 0.4, 0.06) | |
1387 | Player.Character[Name.. " (Left)"].Slide.Weld.C0 = CFrame.new(0, 0.4, 0.06) | |
1388 | CamShake(1, 30000) | |
1389 | CamShake(1, -30000) | |
1390 | else end | |
1391 | for i = 25, 0, -5 do | |
1392 | if Player.Character:FindFirstChild("Torso") ~= nil then | |
1393 | if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then | |
1394 | Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new() | |
1395 | Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(5), 0) | |
1396 | Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new() | |
1397 | Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0) | |
1398 | wait() | |
1399 | else return false end | |
1400 | else return false end | |
1401 | end | |
1402 | playAnimation("rightHold") | |
1403 | playAnimation("leftHold") | |
1404 | return true | |
1405 | end | |
1406 | if format == "fire" then | |
1407 | Player.Character[Name].Slide.Weld.C0 = CFrame.new(0, 0.1, 0.06) | |
1408 | if Player.Character[Name]:FindFirstChild("Handle") ~= nil then | |
1409 | if silenced then | |
1410 | Player.Character[Name].Handle.Fire2.Volume = math.random(3, 8) / 10 | |
1411 | Player.Character[Name].Handle.Fire2.Pitch = math.random(1.8, 2) | |
1412 | Player.Character[Name].Handle.Fire2:Play() | |
1413 | CamShake(15, 50000) | |
1414 | else | |
1415 | Player.Character[Name].Handle.Fire.Volume = math.random(8, 12) / 10 | |
1416 | Player.Character[Name].Handle.Fire.Pitch = math.random(25, 35) / 20 | |
1417 | Player.Character[Name].Handle.Fire:Play() | |
1418 | CamShake(15, 50000) | |
1419 | end | |
1420 | else return false end | |
1421 | if Player.Character[Name]:FindFirstChild("Muzzle") ~= nil then | |
1422 | if silenced == false then | |
1423 | coroutine.resume(coroutine.create(function() Player.Character[Name].Muzzle.Smoke.Enabled = true Player.Character[Name].Muzzle.Fire.Enabled = true wait(0.1) Player.Character[Name].Muzzle.Smoke.Enabled = false Player.Character[Name].Muzzle.Fire.Enabled = false end)) | |
1424 | else end | |
1425 | else return false end | |
1426 | for i = 0, 10, 5 do | |
1427 | if Player.Character:FindFirstChild("Torso") ~= nil then | |
1428 | if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then | |
1429 | Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new() | |
1430 | Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55, 0.75, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(315), math.rad(i), math.rad(-90)) | |
1431 | Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new() | |
1432 | Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0) | |
1433 | wait() | |
1434 | else return false end | |
1435 | else return false end | |
1436 | end | |
1437 | makeShell(Player.Character[Name]:FindFirstChild("ShellOut")) | |
1438 | if magazine.Value ~= 0 then | |
1439 | Player.Character[Name].Slide.Weld.C0 = CFrame.new(0, 0.4, 0.06) | |
1440 | elseif magazine.Value == 0 then | |
1441 | Player.Character[Name].Handle.Lock.Pitch = 3 | |
1442 | Player.Character[Name].Shell.Transparency = 1 | |
1443 | Player.Character[Name].Handle.Lock:Play() | |
1444 | end | |
1445 | for i = 10, 0, -5 do | |
1446 | if Player.Character:FindFirstChild("Torso") ~= nil then | |
1447 | if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then | |
1448 | Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new() | |
1449 | Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55, 0.75, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(315), math.rad(i), math.rad(-90)) | |
1450 | Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new() | |
1451 | Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0) | |
1452 | wait() | |
1453 | else return false end | |
1454 | else return false end | |
1455 | end | |
1456 | end | |
1457 | if format == "rightFire" then | |
1458 | Player.Character[Name].Slide.Weld.C0 = CFrame.new(0, 0.1, 0.06) | |
1459 | if Player.Character[Name]:FindFirstChild("Handle") ~= nil then | |
1460 | if silenced then | |
1461 | Player.Character[Name].Handle.Fire2.Volume = math.random(3, 8) / 10 | |
1462 | Player.Character[Name].Handle.Fire2.Pitch = math.random(1.8, 2) | |
1463 | Player.Character[Name].Handle.Fire2:Play() | |
1464 | CamShake(15, 50000) | |
1465 | else | |
1466 | Player.Character[Name].Handle.Fire.Volume = math.random(8, 12) / 10 | |
1467 | Player.Character[Name].Handle.Fire.Pitch = math.random(25, 35) / 20 | |
1468 | Player.Character[Name].Handle.Fire:Play() | |
1469 | CamShake(15, 50000) | |
1470 | end | |
1471 | else return false end | |
1472 | if Player.Character[Name]:FindFirstChild("Muzzle") ~= nil then | |
1473 | if silenced == false then | |
1474 | coroutine.resume(coroutine.create(function() Player.Character[Name].Muzzle.Smoke.Enabled = true Player.Character[Name].Muzzle.Fire.Enabled = true wait(0.1) Player.Character[Name].Muzzle.Smoke.Enabled = false Player.Character[Name].Muzzle.Fire.Enabled = false end)) | |
1475 | else end | |
1476 | else return false end | |
1477 | for i = 0, 10, 5 do | |
1478 | if Player.Character:FindFirstChild("Torso") ~= nil then | |
1479 | if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then | |
1480 | Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new() | |
1481 | Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.72, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), math.rad(-5)) | |
1482 | wait() | |
1483 | else return false end | |
1484 | else return false end | |
1485 | end | |
1486 | makeShell(Player.Character[Name]:FindFirstChild("ShellOut")) | |
1487 | if magazine.Value ~= 0 then | |
1488 | Player.Character[Name].Slide.Weld.C0 = CFrame.new(0, 0.4, 0.06) | |
1489 | elseif magazine.Value == 0 then | |
1490 | Player.Character[Name].Handle.Lock.Pitch = 3 | |
1491 | Player.Character[Name].Handle.Lock:Play() | |
1492 | Player.Character[Name].Shell.Transparency = 1 | |
1493 | Player.Character[Name.. " (Left)"].Shell.Transparency = 1 | |
1494 | Player.Character[Name.. " (Left)"].Slide.Weld.C0 = CFrame.new(0, 0.1, 0.06) | |
1495 | end | |
1496 | for i = 10, 0, -5 do | |
1497 | if Player.Character:FindFirstChild("Torso") ~= nil then | |
1498 | if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then | |
1499 | Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new() | |
1500 | Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.72, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), math.rad(-5)) | |
1501 | wait() | |
1502 | else return false end | |
1503 | else return false end | |
1504 | end | |
1505 | end | |
1506 | if format == "leftFire" then | |
1507 | Player.Character[Name.. " (Left)"].Slide.Weld.C0 = CFrame.new(0, 0.1, 0.06) | |
1508 | if Player.Character[Name.. " (Left)"]:FindFirstChild("Handle") ~= nil then | |
1509 | if silenced then | |
1510 | Player.Character[Name.. " (Left)"].Handle.Fire2.Volume = math.random(3, 8) / 10 | |
1511 | Player.Character[Name.. " (Left)"].Handle.Fire2.Pitch = math.random(1.8, 2) | |
1512 | Player.Character[Name.. " (Left)"].Handle.Fire2:Play() | |
1513 | CamShake(15, 50000) | |
1514 | else | |
1515 | Player.Character[Name.. " (Left)"].Handle.Fire.Volume = math.random(8, 12) / 10 | |
1516 | Player.Character[Name.. " (Left)"].Handle.Fire.Pitch = math.random(25, 35) / 20 | |
1517 | Player.Character[Name.. " (Left)"].Handle.Fire:Play() | |
1518 | CamShake(15, 50000) | |
1519 | end | |
1520 | end | |
1521 | if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle") ~= nil then | |
1522 | if silenced == false then | |
1523 | coroutine.resume(coroutine.create(function() Player.Character[Name.. " (Left)"].Muzzle.Smoke.Enabled = true Player.Character[Name.. " (Left)"].Muzzle.Fire.Enabled = true wait(0.1) Player.Character[Name.. " (Left)"].Muzzle.Smoke.Enabled = false Player.Character[Name.. " (Left)"].Muzzle.Fire.Enabled = false end)) | |
1524 | else end | |
1525 | end | |
1526 | for i = 0, 10, 5 do | |
1527 | if Player.Character:FindFirstChild("Torso") ~= nil then | |
1528 | if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then | |
1529 | Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new() | |
1530 | Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(0.72, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(5), math.rad(5)) | |
1531 | wait() | |
1532 | else return false end | |
1533 | else return false end | |
1534 | end | |
1535 | makeShell(Player.Character[Name.. " (Left)"]:FindFirstChild("ShellOut")) | |
1536 | if magazine.Value ~= 0 then | |
1537 | Player.Character[Name.. " (Left)"].Slide.Weld.C0 = CFrame.new(0, 0.4, 0.06) | |
1538 | elseif magazine.Value == 0 then | |
1539 | Player.Character[Name].Handle.Lock.Pitch = 3 | |
1540 | Player.Character[Name].Handle.Lock:Play() | |
1541 | Player.Character[Name].Shell.Transparency = 1 | |
1542 | Player.Character[Name.. " (Left)"].Shell.Transparency = 1 | |
1543 | Player.Character[Name].Slide.Weld.C0 = CFrame.new(0, 0.1, 0.06) | |
1544 | end | |
1545 | for i = 10, 0, -5 do | |
1546 | if Player.Character:FindFirstChild("Torso") ~= nil then | |
1547 | if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then | |
1548 | Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new() | |
1549 | Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(0.72, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(5), math.rad(5)) | |
1550 | wait() | |
1551 | else return false end | |
1552 | else return false end | |
1553 | end | |
1554 | end | |
1555 | if format == "whip" then | |
1556 | Player.Character[Name].Handle.Melee:Play() | |
1557 | for i = 0, 10, 5 do | |
1558 | if Player.Character:FindFirstChild("Torso") ~= nil then | |
1559 | if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then | |
1560 | Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new() | |
1561 | Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55, 0.75, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(315), math.rad(-i * 2), math.rad(-90)) | |
1562 | Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new() | |
1563 | Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5 - i * 3), 0) | |
1564 | wait() | |
1565 | else return false end | |
1566 | else return false end | |
1567 | end | |
1568 | wait(0.1) | |
1569 | for i = 0, 10, 5 do | |
1570 | if Player.Character:FindFirstChild("Torso") ~= nil then | |
1571 | if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then | |
1572 | Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new() | |
1573 | Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1 + i * 0.05, 0.5 + i * 0.05, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5 + i * 5), 0) | |
1574 | wait() | |
1575 | else return false end | |
1576 | else return false end | |
1577 | end | |
1578 | for i = 10, 0, -5 do | |
1579 | if Player.Character:FindFirstChild("Torso") ~= nil then | |
1580 | if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then | |
1581 | Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new() | |
1582 | Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1 + i * 0.05, 0.5 + i * 0.05, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5 + i * 5), 0) | |
1583 | Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new() | |
1584 | Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55, 0.75, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(315), math.rad(-i * 2), math.rad(-90)) | |
1585 | wait() | |
1586 | else return false end | |
1587 | else return false end | |
1588 | end | |
1589 | if dual ~= true then | |
1590 | playAnimation("hold") | |
1591 | return true | |
1592 | else | |
1593 | playAnimation("rightHold") | |
1594 | playAnimation("leftHold") | |
1595 | return true | |
1596 | end | |
1597 | end | |
1598 | return true | |
1599 | end | |
1600 | function CamShake(time, freq) | |
1601 | coroutine.resume(coroutine.create(function() | |
1602 | local cam = game:GetService("Workspace").CurrentCamera | |
1603 | local time = 10 | |
1604 | local seed = Vector3.new(math.random(100, 200) / freq, math.random(100, 200) / freq, 0) | |
1605 | if math.random(1, 2) == 1 then seed = Vector3.new(-seed.x, seed.y, 0) end | |
1606 | if math.random(1, 2) == 1 then seed = Vector3.new(seed.x, -seed.y, 0) end | |
1607 | cam.CoordinateFrame = (CFrame.new(cam.Focus.p) * (cam.CoordinateFrame - cam.CoordinateFrame.p) * CFrame.fromEulerAnglesXYZ(seed.x * time, seed.y * time, 0)) * CFrame.new(0, 0, (cam.CoordinateFrame.p - cam.Focus.p).magnitude) | |
1608 | for i = 1, time do | |
1609 | cam.CoordinateFrame = (CFrame.new(cam.Focus.p) * (cam.CoordinateFrame - cam.CoordinateFrame.p) * CFrame.fromEulerAnglesXYZ(-seed.x, -seed.y, 0)) * CFrame.new(0, 0, (cam.CoordinateFrame.p - cam.Focus.p).magnitude) | |
1610 | wait() | |
1611 | end | |
1612 | end)) | |
1613 | end | |
1614 | function makeShell(part) | |
1615 | if part == nil then return false end | |
1616 | local casing = Instance.new("Part") | |
1617 | casing.Name = "Shell" | |
1618 | casing.formFactor = "Custom" | |
1619 | casing.Size = Vector3.new(0.2, 0.26, 0.2) | |
1620 | casing.CFrame = CFrame.new(part.Position) * CFrame.fromEulerAnglesXYZ(math.rad(math.random(0, 360)), math.rad(math.random(0, 360)), math.rad(math.random(0, 360))) | |
1621 | casing.BrickColor = BrickColor.new("New Yeller") | |
1622 | local mesh = Instance.new("CylinderMesh") | |
1623 | mesh.Scale = Vector3.new(0.4, 1, 0.4) | |
1624 | mesh.Parent = casing | |
1625 | casing.Parent = game:GetService("Workspace") | |
1626 | casing:BreakJoints() | |
1627 | casing.Velocity = (part.CFrame.lookVector * 50) + Vector3.new(0, 10, 0) | |
1628 | coroutine.resume(coroutine.create(function() wait(4.5) for i = 0, 1, 0.1 do casing.Transparency = i wait() end casing:Remove() end)) | |
1629 | end | |
1630 | function Weld(x, y) | |
1631 | local weld = Instance.new("Weld") | |
1632 | weld.Part0 = x | |
1633 | weld.Part1 = y | |
1634 | CJ = CFrame.new(x.Position) | |
1635 | C0 = x.CFrame:inverse() * CJ | |
1636 | C1 = y.CFrame:inverse() * CJ | |
1637 | weld.C0 = C0 | |
1638 | weld.C1 = C1 | |
1639 | weld.Parent = x | |
1640 | end | |
1641 | function tagHumanoid(humanoid) | |
1642 | local tag = Instance.new("ObjectValue") | |
1643 | tag.Name = "creator" | |
1644 | tag.Value = Player | |
1645 | tag.Parent = humanoid | |
1646 | local tag = Instance.new("StringValue") | |
1647 | tag.Name = "creatorType1" | |
1648 | tag.Value = Name | |
1649 | tag.Parent = humanoid | |
1650 | local tag = Instance.new("StringValue") | |
1651 | tag.Name = "creatorType2" | |
1652 | tag.Value = "shot" | |
1653 | tag.Parent = humanoid | |
1654 | end | |
1655 | function untagHumanoid(humanoid) | |
1656 | if humanoid ~= nil then | |
1657 | local tag = humanoid:FindFirstChild("creator") | |
1658 | if tag ~= nil then | |
1659 | tag:Remove() | |
1660 | end | |
1661 | local tag = humanoid:FindFirstChild("creatorType1") | |
1662 | if tag ~= nil then | |
1663 | tag:Remove() | |
1664 | end | |
1665 | local tag = humanoid:FindFirstChild("creatorType2") | |
1666 | if tag ~= nil then | |
1667 | tag:Remove() | |
1668 | end | |
1669 | end | |
1670 | end | |
1671 | function fire(startPoint, endPoint, hit) | |
1672 | local trail = Instance.new("Part") | |
1673 | trail.Name = "Bullet Trail" | |
1674 | trail.BrickColor = BrickColor.new("Dark stone grey") | |
1675 | trail.TopSurface = 0 | |
1676 | trail.BottomSurface = 0 | |
1677 | trail.formFactor = 0 | |
1678 | trail.Size = Vector3.new(1, 1, 1) | |
1679 | trail.Transparency = 0.5 | |
1680 | trail.Anchored = true | |
1681 | trail.CanCollide = false | |
1682 | trail.CFrame = CFrame.new((startPoint + endPoint) / 2, endPoint) | |
1683 | trail.Parent = game:GetService("Workspace") | |
1684 | local mesh = Instance.new("SpecialMesh") | |
1685 | mesh.MeshType = "Brick" | |
1686 | mesh.Scale = Vector3.new(0.1, 0.1, (startPoint - endPoint).magnitude) | |
1687 | mesh.Parent = trail | |
1688 | coroutine.resume(coroutine.create(function(part) for i = 1, 10 do part.Mesh.Scale = Vector3.new(part.Mesh.Scale.x - 0.01, part.Mesh.Scale.y - 0.01, part.Mesh.Scale.z) wait() end part:Remove() end), trail) | |
1689 | if hit ~= nil then | |
1690 | if hit.Parent == nil then return end | |
1691 | if hit.Parent.ClassName == "Hat" then | |
1692 | if hit.Parent.Parent.Humanoid ~= nil then | |
1693 | hit.Parent.Parent.Humanoid:TakeDamage(damage * 5) | |
1694 | end | |
1695 | end | |
1696 | if hit.Parent:FindFirstChild("Humanoid") ~= nil then | |
1697 | tagHumanoid(hit.Parent.Humanoid) | |
1698 | if hit.Name == "Head" then | |
1699 | hit.Parent.Humanoid:TakeDamage(damage * 10) | |
1700 | elseif hit.Name == "Torso" then | |
1701 | hit.Parent.Humanoid:TakeDamage(damage * 2) | |
1702 | elseif hit.Name == "Left Leg" then | |
1703 | hit.Parent.Humanoid:TakeDamage(damage) | |
1704 | hit.Parent.Humanoid.Sit = true | |
1705 | elseif hit.Name == "Right Leg" then | |
1706 | hit.Parent.Humanoid:TakeDamage(damage) | |
1707 | hit.Parent.Humanoid.Sit = true | |
1708 | else | |
1709 | hit.Parent.Humanoid:TakeDamage(damage) | |
1710 | end | |
1711 | if math.random(1, 10) == 1 then | |
1712 | hit.Parent.Humanoid.Sit = true | |
1713 | end | |
1714 | delay(0.1, function() untagHumanoid(hit.Parent.Humanoid) end) | |
1715 | end | |
1716 | if hit.Anchored == false then | |
1717 | hit.Velocity = hit.Velocity + ((endPoint - startPoint).unit * (damage * 2)) | |
1718 | end | |
1719 | end | |
1720 | end | |
1721 | function onButton1Down(mouse) | |
1722 | if selected == false then return end | |
1723 | if Player.Character:FindFirstChild(Name) ~= nil and Button1Down == false and canFire == true and (function() if dual == true then if Player.Character:FindFirstChild(Name.. " (Left)") ~= nil then return true else return false end else return true end end)() == true then | |
1724 | if Player.Character[Name]:FindFirstChild("Handle") == nil then return end | |
1725 | if Player.Character[Name]:FindFirstChild("Muzzle") == nil then return end | |
1726 | if dual == true then if Player.Character[Name.. " (Left)"]:FindFirstChild("Handle") == nil then return end end | |
1727 | if dual == true then if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle") == nil then return end end | |
1728 | mouse.Icon = "http://www.roblox.com/asset/?id=59125642" | |
1729 | Button1Down = true | |
1730 | canFire = false | |
1731 | canFire2 = true | |
1732 | while canFire2 == true do | |
1733 | local humanoid = Player.Character:FindFirstChild("Humanoid") | |
1734 | if humanoid == nil then | |
1735 | canFire2 = false | |
1736 | break | |
1737 | end | |
1738 | if humanoid.Health <= 0 then | |
1739 | canFire2 = false | |
1740 | break | |
1741 | end | |
1742 | local fireLeft = false | |
1743 | if automatic == false and burst == false then | |
1744 | canFire2 = false | |
1745 | elseif automatic == false and burst == true then | |
1746 | if burstCount >= burstCountMax then | |
1747 | canFire2 = false | |
1748 | burstCount = 0 | |
1749 | break | |
1750 | end | |
1751 | burstCount = burstCount + 1 | |
1752 | elseif automatic == true and burst == false then | |
1753 | fireLeft = true | |
1754 | end | |
1755 | if magazine.Value > 0 then | |
1756 | magazine.Value = magazine.Value - 1 | |
1757 | updateGui() | |
1758 | if silenced == true then | |
1759 | CamShake(1, Spread) | |
1760 | else end | |
1761 | fire(Player.Character[Name].Muzzle.Position, mouse.Hit.p, mouse.Target) | |
1762 | coroutine.resume(coroutine.create(function() | |
1763 | if dual == true then | |
1764 | playAnimation("rightFire") | |
1765 | elseif dual == false then | |
1766 | playAnimation("fire") | |
1767 | end | |
1768 | end)) | |
1769 | if dual == true and magazine.Value ~= 0 then | |
1770 | magazine.Value = magazine.Value - 1 | |
1771 | updateGui() | |
1772 | wait(math.random(0, 0.15)) | |
1773 | fire(Player.Character[Name.. " (Left)"].Muzzle.Position, mouse.Hit.p, mouse.Target) | |
1774 | coroutine.resume(coroutine.create(function() | |
1775 | playAnimation("leftFire") | |
1776 | end)) | |
1777 | end | |
1778 | else | |
1779 | Player.Character[Name].Handle.Empty:Play() | |
1780 | end | |
1781 | if fireLeft == true and dual == true and automatic == true then | |
1782 | if magazine.Value > 0 then | |
1783 | coroutine.resume(coroutine.create(function() | |
1784 | wait(readyTime / 2) | |
1785 | magazine.Value = magazine.Value - 1 | |
1786 | updateGui() | |
1787 | fire(Player.Character[Name.. " (Left)"].Muzzle.Position, mouse.Hit.p, mouse.Target) | |
1788 | if silenced == true then | |
1789 | CamShake(1, Spread) | |
1790 | else end | |
1791 | playAnimation("leftFire") | |
1792 | end)) | |
1793 | else | |
1794 | coroutine.resume(coroutine.create(function() | |
1795 | wait(readyTime / 2) | |
1796 | Player.Character[Name].Handle.Empty:Play() | |
1797 | end)) | |
1798 | end | |
1799 | end | |
1800 | wait(readyTime) | |
1801 | end | |
1802 | if magazine.Value ~= 0 then | |
1803 | mouse.Icon = "http://www.roblox.com/asset/?id=59125633" | |
1804 | else end | |
1805 | canFire = true | |
1806 | end | |
1807 | end | |
1808 | function onButton1Up(mouse) | |
1809 | if selected == false then return end | |
1810 | Button1Down = false | |
1811 | canFire2 = false | |
1812 | burstCount = 0 | |
1813 | while canFire == false do wait() end | |
1814 | if dual == true and automatic == false then | |
1815 | if Player.Character[Name.. " (Left)"]:FindFirstChild("Handle") == nil then return end | |
1816 | if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle") == nil then return end | |
1817 | mouse.Icon = "http://www.roblox.com/asset/?id=59125642" | |
1818 | canFire = false | |
1819 | canFire2 = true | |
1820 | while canFire2 == true do | |
1821 | local humanoid = Player.Character:FindFirstChild("Humanoid") | |
1822 | if humanoid == nil then | |
1823 | canFire2 = false | |
1824 | break | |
1825 | end | |
1826 | if humanoid.Health <= 0 then | |
1827 | canFire2 = false | |
1828 | break | |
1829 | end | |
1830 | if burst == false then | |
1831 | canFire2 = false | |
1832 | elseif burst == true then | |
1833 | if burstCount >= burstCountMax then | |
1834 | canFire2 = false | |
1835 | burstCount = 0 | |
1836 | break | |
1837 | end | |
1838 | burstCount = burstCount + 1 | |
1839 | end | |
1840 | if magazine.Value <= 0 then | |
1841 | Player.Character[Name].Handle.Empty:Play() | |
1842 | else end | |
1843 | end | |
1844 | if magazine.Value ~= 0 then | |
1845 | mouse.Icon = "http://www.roblox.com/asset/?id=59125633" | |
1846 | else end | |
1847 | canFire = true | |
1848 | end | |
1849 | end | |
1850 | function onKeyDown(key, mouse) | |
1851 | if selected == false then return end | |
1852 | key = key:lower() | |
1853 | if key == "q" and Button1Down == false and canFire == true then | |
1854 | if mouse.Target == nil then return end | |
1855 | if game:GetService("Players"):GetPlayerFromCharacter(mouse.Target.Parent) ~= nil then | |
1856 | if dual == true then onKeyDown("t", mouse) end | |
1857 | onDeselected(mouse) | |
1858 | removeParts("RightHolster") | |
1859 | script.Parent.Parent = game:GetService("Players"):GetPlayerFromCharacter(mouse.Target.Parent).Backpack | |
1860 | end | |
1861 | end | |
1862 | if key == "e" and Button1Down == false and canFire == true and canSilence == true then | |
1863 | if silenced then | |
1864 | silenced = false | |
1865 | Player.Character[Name].Handle.Lock.Pitch = 5 | |
1866 | Player.Character[Name].Handle.Lock:Play() | |
1867 | if Player.Character:FindFirstChild(Name) == nil then return end | |
1868 | if Player.Character[Name]:FindFirstChild("Muzzle") == nil then return end | |
1869 | if Player.Character[Name]:FindFirstChild("Muzzle 2") == nil then return end | |
1870 | Player.Character[Name].Muzzle.Transparency = 1 | |
1871 | Player.Character[Name].Silencer1.Transparency = 1 | |
1872 | Player.Character[Name].Muzzle.Name = "Silencer" | |
1873 | Player.Character[Name]["Muzzle 2"].Name = "Muzzle" | |
1874 | if dual == true then | |
1875 | if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle") == nil then return end | |
1876 | if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle 2") == nil then return end | |
1877 | Player.Character[Name.. " (Left)"].Muzzle.Transparency = 1 | |
1878 | Player.Character[Name.. " (Left)"].Silencer1.Transparency = 1 | |
1879 | Player.Character[Name.. " (Left)"].Muzzle.Name = "Silencer" | |
1880 | Player.Character[Name.. " (Left)"]["Muzzle 2"].Name = "Muzzle" | |
1881 | end | |
1882 | else | |
1883 | silenced = true | |
1884 | Player.Character[Name].Handle.Lock.Pitch = 5 | |
1885 | Player.Character[Name].Handle.Lock:Play() | |
1886 | if Player.Character:FindFirstChild(Name) == nil then return end | |
1887 | if Player.Character[Name]:FindFirstChild("Silencer") == nil then return end | |
1888 | if Player.Character[Name]:FindFirstChild("Muzzle") == nil then return end | |
1889 | Player.Character[Name].Silencer.Transparency = 0 | |
1890 | Player.Character[Name].Silencer1.Transparency = 0 | |
1891 | Player.Character[Name].Muzzle.Name = "Muzzle 2" | |
1892 | Player.Character[Name].Silencer.Name = "Muzzle" | |
1893 | if dual == true then | |
1894 | if Player.Character[Name.. " (Left)"]:FindFirstChild("Silencer") == nil then return end | |
1895 | if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle") == nil then return end | |
1896 | Player.Character[Name.. " (Left)"].Silencer.Transparency = 0 | |
1897 | Player.Character[Name.. " (Left)"].Silencer1.Transparency = 0 | |
1898 | Player.Character[Name.. " (Left)"].Muzzle.Name = "Muzzle 2" | |
1899 | Player.Character[Name.. " (Left)"].Silencer.Name = "Muzzle" | |
1900 | end | |
1901 | end | |
1902 | end | |
1903 | if key == "r" and Button1Down == false and canFire == true then | |
1904 | if ammo.Value > 0 and magazine.Value ~= magazineMax.Value + Chamber then | |
1905 | canFire = false | |
1906 | burstCount = 0 | |
1907 | mouse.Icon = "http://www.roblox.com/asset/?id=59125642" | |
1908 | if magazine.Value > 0 then magazine.Value = Chamber end | |
1909 | updateGui() | |
1910 | if dual == true then | |
1911 | playAnimation("reloadDual") | |
1912 | elseif dual == false then | |
1913 | playAnimation("reload") | |
1914 | end | |
1915 | if ammo.Value - magazineMax.Value < 0 then | |
1916 | magazine.Value = ammo.Value | |
1917 | ammo.Value = 0 | |
1918 | elseif ammo.Value - magazineMax.Value >= 0 then | |
1919 | ammo.Value = ammo.Value - magazineMax.Value | |
1920 | magazine.Value = magazine.Value + MagSize | |
1921 | end | |
1922 | updateGui() | |
1923 | mouse.Icon = "http://www.roblox.com/asset/?id=59125633" | |
1924 | canFire = true | |
1925 | end | |
1926 | end | |
1927 | if key == "t" and Button1Down == false and canFire == true and canDual == true then | |
1928 | canFire = false | |
1929 | if dual == false then | |
1930 | local weapon = nil | |
1931 | for _, p in pairs(Player.Backpack:GetChildren()) do | |
1932 | if p.Name == Name and p ~= script.Parent then weapon = p break end | |
1933 | end | |
1934 | if weapon ~= nil then | |
1935 | dual = true | |
1936 | Chamber = 2 | |
1937 | MagSize = MagSize * 2 | |
1938 | weapon.Name = "Dual" | |
1939 | weapon.Parent = script | |
1940 | removeParts("RightHand") | |
1941 | makeParts("RightHand") | |
1942 | removeParts("RightHolster") | |
1943 | makeParts("LeftHolster") | |
1944 | playAnimation("leftEquip") | |
1945 | removeParts("LeftHolster") | |
1946 | makeParts("LeftHand") | |
1947 | magazineMax.Value = math.ceil(magazineMax.Value * 2) | |
1948 | ammoMax.Value = math.ceil(ammoMax.Value * 2) | |
1949 | magazine.Value = magazine.Value + weapon.Magazine.Value | |
1950 | ammo.Value = ammo.Value + weapon.Ammo.Value | |
1951 | updateGui() | |
1952 | end | |
1953 | elseif dual == true then | |
1954 | local weapon = script:FindFirstChild("Dual") | |
1955 | if weapon ~= nil then | |
1956 | dual = false | |
1957 | Chamber = 1 | |
1958 | MagSize = MagSize * 0.5 | |
1959 | weapon.Name = Name | |
1960 | weapon.Parent = Player.Backpack | |
1961 | removeParts("RightHand") | |
1962 | makeParts("RightHand") | |
1963 | playAnimation("leftUnequip") | |
1964 | removeParts("LeftHand") | |
1965 | makeParts("RightHolster") | |
1966 | playAnimation("hold") | |
1967 | weapon.Magazine.Value = math.floor(magazine.Value / 2) | |
1968 | weapon.Ammo.Value = math.floor(ammo.Value / 2) | |
1969 | magazineMax.Value = math.ceil(magazineMax.Value / 2) | |
1970 | ammoMax.Value = math.ceil(ammoMax.Value / 2) | |
1971 | magazine.Value = math.ceil(magazine.Value / 2) | |
1972 | ammo.Value = math.ceil(ammo.Value / 2) | |
1973 | updateGui() | |
1974 | end | |
1975 | end | |
1976 | canFire = true | |
1977 | end | |
1978 | if key == "y" and canZoom == true then | |
1979 | if zoom == false then | |
1980 | zoom = true | |
1981 | local pos = mouse.Hit.p | |
1982 | local target = mouse.Target | |
1983 | local cam = game:GetService("Workspace").CurrentCamera | |
1984 | focus = Instance.new("Part", workspace) | |
1985 | focus.Anchored = true | |
1986 | focus.CanCollide = false | |
1987 | focus.Transparency = 1 | |
1988 | focus.TopSurface = 0 | |
1989 | focus.BottomSurface = 0 | |
1990 | focus.formFactor = "Plate" | |
1991 | focus.Size = Vector3.new(0, 0, 0) | |
1992 | focus.CFrame = CFrame.new(pos) * (CFrame.new(Player.Character.Torso.CFrame.p, pos) - CFrame.new(Player.Character.Torso.CFrame.p, pos).p) | |
1993 | cam.CameraSubject = focus | |
1994 | cam.CameraType = "Attach" | |
1995 | while zoom == true and selected == true do | |
1996 | local set = false | |
1997 | if target ~= nil then | |
1998 | if target.Parent ~= nil then | |
1999 | if target.Anchored == false then | |
2000 | focus.CFrame = CFrame.new(target.CFrame.p) * (CFrame.new(Player.Character.Torso.CFrame.p, target.CFrame.p) - CFrame.new(Player.Character.Torso.CFrame.p, target.CFrame.p).p) | |
2001 | set = true | |
2002 | end | |
2003 | end | |
2004 | end | |
2005 | if set == false then | |
2006 | focus.CFrame = CFrame.new(pos) * (CFrame.new(Player.Character.Torso.CFrame.p, pos) - CFrame.new(Player.Character.Torso.CFrame.p, pos).p) | |
2007 | end | |
2008 | wait() | |
2009 | end | |
2010 | if focus ~= nil then focus:Remove() focus = nil end | |
2011 | local cam = game:GetService("Workspace").CurrentCamera | |
2012 | cam.CameraSubject = Player.Character:FindFirstChild("Humanoid") | |
2013 | cam.CameraType = "Custom" | |
2014 | else | |
2015 | zoom = false | |
2016 | end | |
2017 | end | |
2018 | if key == "u" and Button1Down == false and canFire == true then | |
2019 | if automatic == false and burst == false then | |
2020 | if switchToBurst == true then | |
2021 | burst = true | |
2022 | local m = Instance.new("Message", Player) | |
2023 | m.Text = "Burst" | |
2024 | pcall(function() Player.Character[Name].Handle.Switch:Play() end) | |
2025 | delay(2.5, function() m:Remove() end) | |
2026 | elseif switchToAutomatic == true then | |
2027 | automatic = true | |
2028 | local m = Instance.new("Message", Player) | |
2029 | m.Text = "Automatic" | |
2030 | pcall(function() Player.Character[Name].Handle.Switch:Play() end) | |
2031 | delay(2.5, function() m:Remove() end) | |
2032 | end | |
2033 | elseif automatic == false and burst == true then | |
2034 | if switchToAutomatic == true then | |
2035 | automatic = true | |
2036 | burst = false | |
2037 | local m = Instance.new("Message", Player) | |
2038 | m.Text = "Automatic" | |
2039 | pcall(function() Player.Character[Name].Handle.Switch:Play() end) | |
2040 | delay(2.5, function() m:Remove() end) | |
2041 | elseif switchToSingle == true then | |
2042 | burst = false | |
2043 | local m = Instance.new("Message", Player) | |
2044 | m.Text = "Single" | |
2045 | pcall(function() Player.Character[Name].Handle.Switch:Play() end) | |
2046 | delay(2.5, function() m:Remove() end) | |
2047 | end | |
2048 | elseif automatic == true and burst == false then | |
2049 | if switchToSingle == true then | |
2050 | automatic = false | |
2051 | local m = Instance.new("Message", Player) | |
2052 | m.Text = "Single" | |
2053 | pcall(function() Player.Character[Name].Handle.Switch:Play() end) | |
2054 | delay(2.5, function() m:Remove() end) | |
2055 | elseif switchToBurst == true then | |
2056 | automatic = false | |
2057 | burst = true | |
2058 | local m = Instance.new("Message", Player) | |
2059 | m.Text = "Burst" | |
2060 | pcall(function() Player.Character[Name].Handle.Switch:Play() end) | |
2061 | delay(2.5, function() m:Remove() end) | |
2062 | end | |
2063 | end | |
2064 | end | |
2065 | if key == "f" and canFire == true then | |
2066 | canFire = false | |
2067 | canHit = true | |
2068 | playAnimation("whip") | |
2069 | canHit = false | |
2070 | wait(1) | |
2071 | canFire = true | |
2072 | end | |
2073 | end | |
2074 | function onSelected(mouse) | |
2075 | if selected == true then return end | |
2076 | selected = true | |
2077 | canFire = false | |
2078 | mouse.Icon = "http://www.roblox.com/asset/?id=59125642" | |
2079 | while Player.Character:FindFirstChild("WeaponActivated") ~= nil do | |
2080 | if Player.Character.WeaponActivated.Value == nil then break end | |
2081 | if Player.Character.WeaponActivated.Value.Parent == nil then break end | |
2082 | wait() | |
2083 | end | |
2084 | updateGui() | |
2085 | local weapon = Instance.new("ObjectValue") | |
2086 | weapon.Name = "WeaponActivated" | |
2087 | weapon.Value = script.Parent | |
2088 | weapon.Parent = Player.Character | |
2089 | DisableLimb(1, Player.Character) | |
2090 | DisableLimb(2, Player.Character) | |
2091 | ForceAngle(1, 0, Player.Character) | |
2092 | ForceAngle(2, 0, Player.Character) | |
2093 | if dual == true then | |
2094 | coroutine.resume(coroutine.create(function() playAnimation("leftEquip") end)) | |
2095 | playAnimation("rightEquip") | |
2096 | removeParts("LeftHolster") | |
2097 | makeParts("LeftHand") | |
2098 | else | |
2099 | playAnimation("equip") | |
2100 | end | |
2101 | removeParts("RightHolster") | |
2102 | makeParts("RightHand") | |
2103 | mouse.Button1Down:connect(function() onButton1Down(mouse) end) | |
2104 | mouse.Button1Up:connect(function() onButton1Up(mouse) end) | |
2105 | mouse.KeyDown:connect(function(key) onKeyDown(key, mouse) end) | |
2106 | mouse.Icon = "http://www.roblox.com/asset/?id=59125633" | |
2107 | canFire = true | |
2108 | end | |
2109 | function onDeselected(mouse) | |
2110 | if selected == false then return end | |
2111 | Button1Down = false | |
2112 | while canFire == false do | |
2113 | wait() | |
2114 | end | |
2115 | selected = false | |
2116 | if dual == true then | |
2117 | if math.random(1, 2) == 1 then | |
2118 | coroutine.resume(coroutine.create(function() playAnimation("leftUnequip") end)) | |
2119 | wait(math.random(1, 10) / 10) | |
2120 | playAnimation("rightUnequip") | |
2121 | else | |
2122 | coroutine.resume(coroutine.create(function() playAnimation("rightUnequip") end)) | |
2123 | wait(math.random(1, 10) / 10) | |
2124 | playAnimation("leftUnequip") | |
2125 | end | |
2126 | removeParts("LeftHand") | |
2127 | makeParts("LeftHolster") | |
2128 | else | |
2129 | playAnimation("unequip") | |
2130 | end | |
2131 | removeParts("RightHand") | |
2132 | makeParts("RightHolster") | |
2133 | ForceAngle(5, 6, Player.Character) | |
2134 | ForceAngle(8, 4, Player.Character) | |
2135 | ResetLimbCFrame(1, Player.Character) | |
2136 | ResetLimbCFrame(2, Player.Character) | |
2137 | EnableLimb(1, Player.Character) | |
2138 | EnableLimb(2, Player.Character) | |
2139 | if Player.PlayerGui:FindFirstChild(Name) ~= nil then Player.PlayerGui[Name]:Remove() end | |
2140 | if Player.Character:FindFirstChild("WeaponActivated") ~= nil then | |
2141 | if Player.Character.WeaponActivated.Value == script.Parent then | |
2142 | Player.Character.WeaponActivated:Remove() | |
2143 | end | |
2144 | end | |
2145 | while Player.Character:FindFirstChild("WeaponActivated") ~= nil do | |
2146 | if Player.Character.WeaponActivated.Value == nil then break end | |
2147 | if Player.Character.WeaponActivated.Value.Parent == nil then break end | |
2148 | wait() | |
2149 | end | |
2150 | end | |
2151 | if script.Parent.ClassName ~= "HopperBin" then | |
2152 | if Player == nil then print("Error: Player not found!") return end | |
2153 | Tool = Instance.new("HopperBin") | |
2154 | Tool.Name = Name | |
2155 | Tool.Parent = Player.Backpack | |
2156 | script.Name = "Main" | |
2157 | script.Parent = Tool | |
2158 | end wait() if script.Parent.ClassName == "HopperBin" then | |
2159 | while script.Parent.Parent.ClassName ~= "Backpack" do | |
2160 | wait() | |
2161 | end | |
2162 | if script.Parent:FindFirstChild("MagazineMax") == nil then | |
2163 | magazineMax = Instance.new("NumberValue") | |
2164 | magazineMax.Name = "MagazineMax" | |
2165 | magazineMax.Value = 20 | |
2166 | magazineMax.Parent = script.Parent | |
2167 | else | |
2168 | magazineMax = script.Parent.MagazineMax | |
2169 | end | |
2170 | if script.Parent:FindFirstChild("Magazine") == nil then | |
2171 | magazine = Instance.new("NumberValue") | |
2172 | magazine.Name = "Magazine" | |
2173 | magazine.Value = 20 | |
2174 | magazine.Parent = script.Parent | |
2175 | else | |
2176 | magazine = script.Parent.Magazine | |
2177 | end | |
2178 | if script.Parent:FindFirstChild("AmmoMax") == nil then | |
2179 | ammoMax = Instance.new("NumberValue") | |
2180 | ammoMax.Name = "AmmoMax" | |
2181 | ammoMax.Value = 600 | |
2182 | ammoMax.Parent = script.Parent | |
2183 | else | |
2184 | ammoMax = script.Parent.AmmoMax | |
2185 | end | |
2186 | if script.Parent:FindFirstChild("Ammo") == nil then | |
2187 | ammo = Instance.new("NumberValue") | |
2188 | ammo.Name = "Ammo" | |
2189 | ammo.Value = script.Parent.AmmoMax.Value | |
2190 | ammo.Parent = script.Parent | |
2191 | else | |
2192 | ammo = script.Parent.Ammo | |
2193 | end | |
2194 | Player = script.Parent.Parent.Parent | |
2195 | makeParts("RightHolster") | |
2196 | script.Parent.Selected:connect(onSelected) | |
2197 | script.Parent.Deselected:connect(onDeselected) | |
2198 | end | |
2199 | end |