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