SHOW:
|
|
- or go back to the newest paste.
1 | - | --MADE BY OneLegend (NOT THE SCRIPT) Credits to CyberFromLU for letting me publish REGULAR SCRIPT: Just hit CNTRL + H and where it says Find what type "YOURNAMEHERE" and where it says Replace with Put your name. |
1 | + | Player = script:FindFirstChild("Player") ~= nil and script.Player.Value or game:GetService("Players"):FindFirstChild("SmokeDelsin") |
2 | Name = "Spirit of Vengence" | |
3 | - | if script == nil then return end |
3 | + | |
4 | WSPenalty = 50 | |
5 | Reliability = 75 | |
6 | - | Player = script:FindFirstChild("Player") ~= nil and script.Player.Value or game:GetService("Players"):FindFirstChild("xxxGhostxxxx") |
6 | + | |
7 | Mode = 0 | |
8 | Spread = 900000 | |
9 | -- Appearance | |
10 | Reciever = 0 | |
11 | MC = BrickColor.new("White") | |
12 | DC = BrickColor.new("White") | |
13 | GC = BrickColor.new("White") | |
14 | MR = 0 | |
15 | GR = 0 | |
16 | Magazine = "Beta-C" | |
17 | Sight = 1 | |
18 | Grip = true | |
19 | Attachment = true | |
20 | Stock = 1 | |
21 | -- Stats/Abilities | |
22 | selected = false | |
23 | canDual = false | |
24 | dual = false | |
25 | Button1Down = false | |
26 | damage = 40 | |
27 | canFire = true | |
28 | canFire2 = false | |
29 | readyTime = 0.09 | |
30 | automatic = false | |
31 | burst = false | |
32 | burstCount = 0 | |
33 | burstCountMax = 15 | |
34 | canSilence = true | |
35 | silenced = false | |
36 | canZoom = false | |
37 | zoom = false | |
38 | switchToSingle = true | |
39 | switchToBurst = true | |
40 | switchToAutomatic = true | |
41 | ||
42 | ||
43 | ammoGui = Instance.new("ScreenGui") | |
44 | ammoGui.Name = Name | |
45 | local frame = Instance.new("Frame") | |
46 | frame.Name = "Frame" | |
47 | frame.Size = UDim2.new(0, 165, 0, 60) | |
48 | frame.Position = UDim2.new(0, 0, 1, -400) | |
49 | frame.BackgroundColor3 = Color3.new(1, 1, 1) | |
50 | frame.BorderColor3 = Color3.new(0, 0, 0) | |
51 | frame.Parent = ammoGui | |
52 | local label = Instance.new("TextLabel") | |
53 | label.Name = "Weapon" | |
54 | label.Text = "Weapon: " ..Name | |
55 | label.Size = UDim2.new(1, 0, 0, 20) | |
56 | label.Position = UDim2.new(0, 0, 0, 0) | |
57 | label.BackgroundColor3 = Color3.new(1, 0, 0) | |
58 | label.BorderColor3 = Color3.new(0, 0, 0) | |
59 | label.Parent = frame | |
60 | local label = Instance.new("TextLabel") | |
61 | label.Name = "MagazinePrefix" | |
62 | label.Text = " " ..Magazine.. " Magazine:" | |
63 | label.TextXAlignment = "Left" | |
64 | label.Size = UDim2.new(1, 0, 0, 20) | |
65 | label.Position = UDim2.new(0, 0, 0, 20) | |
66 | label.BackgroundColor3 = Color3.new(1, 1, 1) | |
67 | label.BorderColor3 = Color3.new(0, 0, 0) | |
68 | label.Parent = frame | |
69 | local label = Instance.new("TextLabel") | |
70 | label.Name = "Magazine" | |
71 | label.Text = "0/0" | |
72 | label.TextXAlignment = "Right" | |
73 | label.Size = UDim2.new(1, 0, 0, 20) | |
74 | label.Position = UDim2.new(0, -10, 0, 20) | |
75 | label.BackgroundTransparency = 1 | |
76 | label.BorderSizePixel = 0 | |
77 | label.Parent = frame | |
78 | local label = Instance.new("TextLabel") | |
79 | label.Name = "AmmoPrefix" | |
80 | label.Text = " 5.56x45mm NATO:" | |
81 | label.TextXAlignment = "Left" | |
82 | label.Size = UDim2.new(1, 0, 0, 20) | |
83 | label.Position = UDim2.new(0, 0, 0, 40) | |
84 | label.BackgroundColor3 = Color3.new(1, 1, 1) | |
85 | label.BorderColor3 = Color3.new(0, 0, 0) | |
86 | label.Parent = frame | |
87 | local label = Instance.new("TextLabel") | |
88 | label.Name = "Ammo" | |
89 | label.Text = "0/0" | |
90 | label.TextXAlignment = "Right" | |
91 | label.Size = UDim2.new(1, 0, 0, 20) | |
92 | label.Position = UDim2.new(0, -10, 0, 40) | |
93 | label.BackgroundTransparency = 1 | |
94 | label.BorderSizePixel = 0 | |
95 | label.Parent = frame | |
96 | ||
97 | ||
98 | function updateGui() | |
99 | if selected == false then return end | |
100 | if Player:FindFirstChild("PlayerGui") == nil then Instance.new("PlayerGui").Parent = Player end | |
101 | if Player.PlayerGui:FindFirstChild(Name) == nil then | |
102 | ammoGui:Clone().Parent = Player.PlayerGui | |
103 | end | |
104 | Player.PlayerGui[Name].Frame.Magazine.Text = tostring(magazine.Value).. "/" ..tostring(magazineMax.Value) | |
105 | Player.PlayerGui[Name].Frame.Ammo.Text = tostring(ammo.Value).. "/" ..tostring(ammoMax.Value) | |
106 | end | |
107 | ||
108 | ||
109 | function makeParts(format) | |
110 | local model = Instance.new("Model") | |
111 | model.Name = Name | |
112 | local pm = Instance.new("Part") | |
113 | pm.Name = "Handle" | |
114 | pm.formFactor = "Symmetric" | |
115 | pm.Size = Vector3.new(1, 1, 1) | |
116 | pm.BrickColor = MC | |
117 | pm.Reflectance = MR | |
118 | pm.CanCollide = false | |
119 | pm.Locked = true | |
120 | pm.TopSurface = 0 | |
121 | pm.BottomSurface = 0 | |
122 | pm.Parent = model | |
123 | local m = Instance.new("BlockMesh") | |
124 | m.Scale = Vector3.new(0.3, 1.1, 0.41) | |
125 | m.Offset = Vector3.new(0, -0.14, 0.07) | |
126 | m.Parent = pm | |
127 | if format ~= nil then | |
128 | local w = Instance.new("Weld") | |
129 | w.Part0 = pm | |
130 | if format == "RightHand" then | |
131 | w.Part1 = Player.Character:FindFirstChild("Right Arm") | |
132 | w.C0 = CFrame.new(0, 1.15, 0.7) | |
133 | w.C1 = CFrame.new() | |
134 | elseif format == "RightHolster" then | |
135 | w.Part1 = Player.Character:FindFirstChild("Torso") | |
136 | w.C0 = CFrame.new(-0.65, -0.6, 0.4) * CFrame.fromEulerAnglesXYZ(math.rad(40), math.rad(90), 0) | |
137 | w.C1 = CFrame.new() | |
138 | model.Name = Name.. " (Holstered)" | |
139 | end | |
140 | w.Parent = pm | |
141 | model.Parent = Player.Character | |
142 | end | |
143 | --[[ | |
144 | sniper1 http://www.roblox.com/asset/?id=1868836 | |
145 | equip http://www.roblox.com/asset/?id=13510737 | |
146 | fire1 http://www.roblox.com/asset/?id=2760979 | |
147 | fire2 http://www.roblox.com/asset/?id=13510352 | |
148 | fire3 http://www.roblox.com/asset/?id=2692806 | |
149 | fire4 http://www.roblox.com/asset/?id=2691586 | |
150 | fire5 http://www.roblox.com/asset/?id=2920959 | |
151 | fire6 http://www.roblox.com/asset/?id=2697431 | |
152 | fire7 http://www.roblox.com/asset/?id=2920959 | |
153 | reload1 http://www.roblox.com/asset/?id=2691591 | |
154 | reload2 http://www.roblox.com/asset/?id=2697432 | |
155 | reload3 http://www.roblox.com/asset/?id=2920960 | |
156 | reload4 http://www.roblox.com/asset/?id=2761842 | |
157 | shotgun1 http://www.roblox.com/asset/?id=2697294 | |
158 | --]] | |
159 | local s = Instance.new("Sound") | |
160 | s.Name = "Fire" | |
161 | s.SoundId = "http://www.roblox.com/Asset/?id=10209803" --"http://www.roblox.com/asset/?id=2920959" | |
162 | s.Volume = 1 | |
163 | s.Pitch = 2 | |
164 | s.Looped = false | |
165 | s.Parent = pm | |
166 | local s = Instance.new("Sound") | |
167 | s.Name = "Fire2" | |
168 | s.SoundId = "http://www.roblox.com/Asset/?id=10209633" | |
169 | s.Volume = 1 | |
170 | s.Pitch = 3 | |
171 | s.Looped = false | |
172 | s.Parent = pm | |
173 | local s = Instance.new("Sound") | |
174 | s.Name = "Jam" | |
175 | s.SoundId = "http://www.roblox.com/Asset/?id=10209636" | |
176 | s.Volume = 1 | |
177 | s.Pitch = 2 | |
178 | s.Looped = false | |
179 | s.Parent = pm | |
180 | local s = Instance.new("Sound") | |
181 | s.Name = "Lock" | |
182 | s.SoundId = "http://www.roblox.com/Asset/?id=10209845" | |
183 | s.Volume = 1 | |
184 | s.Pitch = 3 | |
185 | s.Looped = false | |
186 | s.Parent = pm | |
187 | local s = Instance.new("Sound") | |
188 | s.Name = "Release" | |
189 | s.SoundId = "http://www.roblox.com/Asset/?id=10209813" | |
190 | s.Volume = 1 | |
191 | s.Pitch = 2 | |
192 | s.Looped = false | |
193 | s.Parent = pm | |
194 | local s = Instance.new("Sound") | |
195 | s.Name = "Reload" | |
196 | s.SoundId = "http://www.roblox.com/asset/?id=2697295" | |
197 | s.Volume = 1 | |
198 | s.Pitch = 7.5 | |
199 | s.Looped = false | |
200 | s.Parent = pm | |
201 | local s = Instance.new("Sound") | |
202 | s.Name = "Empty" | |
203 | s.SoundId = "http://www.roblox.com/asset/?id=2697295" | |
204 | s.Volume = 1 | |
205 | s.Pitch = 5 | |
206 | s.Looped = false | |
207 | s.Parent = pm | |
208 | local s = Instance.new("Sound") | |
209 | s.Name = "Switch" | |
210 | s.SoundId = "http://www.roblox.com/asset/?id=2697295" | |
211 | s.Volume = 1 | |
212 | s.Pitch = 10 | |
213 | s.Looped = false | |
214 | s.Parent = pm | |
215 | local s = Instance.new("Sound") | |
216 | s.Name = "Equip" | |
217 | s.SoundId = "http://www.roblox.com/Asset/?id=10209845" | |
218 | s.Volume = 1 | |
219 | s.Pitch = 1.2 | |
220 | s.Looped = false | |
221 | s.Parent = pm | |
222 | local p = Instance.new("Part") | |
223 | p.Name = "ShellOut" | |
224 | p.formFactor = "Symmetric" | |
225 | p.Size = Vector3.new(1, 1, 1) | |
226 | p.Transparency = 1 | |
227 | p.Locked = true | |
228 | p.CanCollide = false | |
229 | p.TopSurface = 0 | |
230 | p.BottomSurface = 0 | |
231 | p.Parent = model | |
232 | local w = Instance.new("Weld") | |
233 | w.Part0 = p | |
234 | w.Part1 = pm | |
235 | w.C0 = CFrame.new(0, 0.4, 0.1) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0) | |
236 | w.C1 = CFrame.new() | |
237 | w.Parent = p | |
238 | local p = Instance.new("Part") | |
239 | p.Name = "Grip" | |
240 | p.formFactor = "Symmetric" | |
241 | p.Size = Vector3.new(1, 1, 1) | |
242 | p.BrickColor = GC | |
243 | p.Reflectance = GR | |
244 | p.CanCollide = false | |
245 | p.Locked = true | |
246 | p.TopSurface = 0 | |
247 | p.BottomSurface = 0 | |
248 | p.Parent = model | |
249 | local m = Instance.new("BlockMesh") | |
250 | m.Scale = Vector3.new(0.29, 0.38, 0.8) | |
251 | m.Parent = p | |
252 | local w = Instance.new("Weld") | |
253 | w.Part0 = p | |
254 | w.Part1 = pm | |
255 | w.C0 = CFrame.new(0, -0.15, -0.5) * CFrame.fromEulerAnglesXYZ(math.rad(15), 0, 0) | |
256 | w.C1 = CFrame.new() | |
257 | w.Parent = p | |
258 | local p = Instance.new("Part") | |
259 | p.Name = "Magazine Housing" | |
260 | p.formFactor = "Symmetric" | |
261 | p.Size = Vector3.new(1, 1, 1) | |
262 | p.BrickColor = MC | |
263 | p.Reflectance = MR | |
264 | p.CanCollide = false | |
265 | p.Locked = true | |
266 | p.TopSurface = 0 | |
267 | p.BottomSurface = 0 | |
268 | p.Parent = model | |
269 | local m = Instance.new("BlockMesh") | |
270 | m.Scale = Vector3.new(0.3, 0.46, 0.4) | |
271 | m.Parent = p | |
272 | local w = Instance.new("Weld") | |
273 | w.Part0 = p | |
274 | w.Part1 = pm | |
275 | w.C0 = CFrame.new(0, 0.46, -0.21) | |
276 | w.C1 = CFrame.new() | |
277 | w.Parent = p | |
278 | local p = Instance.new("Part") | |
279 | p.Name = "BoltHole" -------------- | |
280 | p.CanCollide = false | |
281 | p.formFactor = "Symmetric" | |
282 | p.Size = Vector3.new(1, 1, 1) | |
283 | p.BrickColor = BrickColor.new("Really black") | |
284 | p.Locked = true | |
285 | p.TopSurface = 0 | |
286 | p.BottomSurface = 0 | |
287 | p.Parent = model | |
288 | local m = Instance.new("CylinderMesh") | |
289 | m.Scale = Vector3.new(0.13, 0.29, 0.13) | |
290 | m.Parent = p | |
291 | local w = Instance.new("Weld") | |
292 | w.Part0 = p | |
293 | w.Part1 = pm | |
294 | w.C0 = CFrame.new(-0.1, 0.4, -0.04) | |
295 | w.C1 = CFrame.new() | |
296 | w.Parent = p | |
297 | local p = Instance.new("Part") | |
298 | p.Name = "MagazineHole" | |
299 | p.formFactor = "Symmetric" | |
300 | p.Size = Vector3.new(1, 1, 1) | |
301 | p.BrickColor = BrickColor.new("Really black") | |
302 | p.CanCollide = false | |
303 | p.Locked = true | |
304 | p.TopSurface = 0 | |
305 | p.BottomSurface = 0 | |
306 | p.Parent = model | |
307 | local m = Instance.new("BlockMesh") | |
308 | m.Scale = Vector3.new(0.28, 0.44, 0.406) | |
309 | m.Parent = p | |
310 | local w = Instance.new("Weld") | |
311 | w.Part0 = p | |
312 | w.Part1 = pm | |
313 | w.C0 = CFrame.new(0, 0.46, -0.21) | |
314 | w.C1 = CFrame.new() | |
315 | w.Parent = p | |
316 | if Magazine == "Beta-C" then | |
317 | local pm2 = Instance.new("Part") | |
318 | pm2.Name = "Magazine" | |
319 | pm2.formFactor = "Symmetric" | |
320 | pm2.Size = Vector3.new(1, 1, 1) | |
321 | pm2.BrickColor = BrickColor.new("Dark stone grey") | |
322 | pm2.Locked = true | |
323 | pm2.CanCollide = false | |
324 | pm2.TopSurface = 0 | |
325 | pm2.BottomSurface = 0 | |
326 | pm2.Parent = model | |
327 | local m = Instance.new("BlockMesh") | |
328 | m.Scale = Vector3.new(0.25, 0.43, 0.6) | |
329 | m.Parent = pm2 | |
330 | local w = Instance.new("Weld") | |
331 | w.Part0 = pm2 | |
332 | w.Part1 = pm | |
333 | w.C0 = CFrame.new(0, 0.425, -0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-6), 0, 0) | |
334 | w.C1 = CFrame.new() | |
335 | w.Parent = p | |
336 | local p = Instance.new("Part") | |
337 | p.Name = "MagPull1" | |
338 | p.formFactor = "Symmetric" | |
339 | p.Size = Vector3.new(1, 1, 1) | |
340 | p.BrickColor = BrickColor.new("Dark stone grey") | |
341 | p.Locked = true | |
342 | p.CanCollide = false | |
343 | p.TopSurface = 0 | |
344 | p.BottomSurface = 0 | |
345 | p.Parent = model | |
346 | local m = Instance.new("CylinderMesh") | |
347 | m.Scale = Vector3.new(0.5, 0.43, 0.5) | |
348 | m.Parent = p | |
349 | local w = Instance.new("Weld") | |
350 | w.Part0 = p | |
351 | w.Part1 = pm2 | |
352 | w.C0 = CFrame.new(-0.26, 0, -0.12) | |
353 | w.C1 = CFrame.new() | |
354 | w.Parent = p | |
355 | local p = Instance.new("Part") | |
356 | p.Name = "MagPull2" | |
357 | p.formFactor = "Symmetric" | |
358 | p.Size = Vector3.new(1, 1, 1) | |
359 | p.BrickColor = BrickColor.new("Dark stone grey") | |
360 | p.Locked = true | |
361 | p.CanCollide = false | |
362 | p.TopSurface = 0 | |
363 | p.BottomSurface = 0 | |
364 | p.Parent = model | |
365 | local m = Instance.new("CylinderMesh") | |
366 | m.Scale = Vector3.new(0.5, 0.43, 0.5) | |
367 | m.Parent = p | |
368 | local w = Instance.new("Weld") | |
369 | w.Part0 = p | |
370 | w.Part1 = pm2 | |
371 | w.C0 = CFrame.new(0.26, 0, -0.12) | |
372 | w.C1 = CFrame.new() | |
373 | w.Parent = p | |
374 | elseif Magazine == "STANAG" then | |
375 | local pm2 = Instance.new("Part") | |
376 | pm2.Name = "Magazine" | |
377 | pm2.formFactor = "Symmetric" | |
378 | pm2.Size = Vector3.new(1, 1, 1) | |
379 | pm2.BrickColor = BrickColor.new("Dark stone grey") | |
380 | pm2.Locked = true | |
381 | pm2.CanCollide = false | |
382 | pm2.TopSurface = 0 | |
383 | pm2.BottomSurface = 0 | |
384 | pm2.Parent = model | |
385 | local m = Instance.new("BlockMesh") | |
386 | m.Scale = Vector3.new(0.25, 0.43, 0.8) | |
387 | m.Parent = pm2 | |
388 | local w = Instance.new("Weld") | |
389 | w.Part0 = pm2 | |
390 | w.Part1 = pm | |
391 | w.C0 = CFrame.new(0, 0.425, -0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-6), 0, 0) | |
392 | w.C1 = CFrame.new() | |
393 | w.Parent = p | |
394 | local p = Instance.new("Part") | |
395 | p.Name = "MagPull1" | |
396 | p.formFactor = "Symmetric" | |
397 | p.Size = Vector3.new(1, 1, 1) | |
398 | p.BrickColor = BrickColor.new("Sand green") | |
399 | p.Locked = true | |
400 | p.CanCollide = false | |
401 | p.TopSurface = 0 | |
402 | p.BottomSurface = 0 | |
403 | p.Parent = model | |
404 | local m = Instance.new("BlockMesh") | |
405 | m.Scale = Vector3.new(0.26, 0.44, 0.2) | |
406 | m.Parent = p | |
407 | local w = Instance.new("Weld") | |
408 | w.Part0 = p | |
409 | w.Part1 = pm2 | |
410 | w.C0 = CFrame.new(0, 0, -0.15) | |
411 | w.C1 = CFrame.new() | |
412 | w.Parent = p | |
413 | local p = Instance.new("Part") | |
414 | p.Name = "MagPull2" | |
415 | p.formFactor = "Symmetric" | |
416 | p.Size = Vector3.new(1, 1, 1) | |
417 | p.BrickColor = BrickColor.new("Sand green") | |
418 | p.Locked = true | |
419 | p.CanCollide = false | |
420 | p.TopSurface = 0 | |
421 | p.BottomSurface = 0 | |
422 | p.Parent = model | |
423 | local m = Instance.new("BlockMesh") | |
424 | m.Scale = Vector3.new(0.26, 0.2, 0.3) | |
425 | m.Parent = p | |
426 | local w = Instance.new("Weld") | |
427 | w.Part0 = p | |
428 | w.Part1 = pm2 | |
429 | w.C0 = CFrame.new(0, 0, -0.3) | |
430 | w.C1 = CFrame.new() | |
431 | w.Parent = p | |
432 | else end | |
433 | local p = Instance.new("Part") | |
434 | p.Name = "Trigger Housing" | |
435 | p.formFactor = "Symmetric" | |
436 | p.Size = Vector3.new(1, 1, 1) | |
437 | p.BrickColor = MC | |
438 | p.Reflectance = MR | |
439 | p.CanCollide = false | |
440 | p.Locked = true | |
441 | p.TopSurface = 0 | |
442 | p.BottomSurface = 0 | |
443 | p.Parent = model | |
444 | local m = Instance.new("BlockMesh") | |
445 | m.Scale = Vector3.new(0.1, 0.4, 0.025) | |
446 | m.Parent = p | |
447 | local w = Instance.new("Weld") | |
448 | w.Part0 = p | |
449 | w.Part1 = pm | |
450 | w.C0 = CFrame.new(0, 0.1, -0.38) | |
451 | w.C1 = CFrame.new() | |
452 | w.Parent = p | |
453 | local p = Instance.new("Part") | |
454 | p.Name = "Trigger" | |
455 | p.formFactor = "Symmetric" | |
456 | p.Size = Vector3.new(1, 1, 1) | |
457 | p.BrickColor = MC | |
458 | p.Reflectance = MR | |
459 | p.CanCollide = false | |
460 | p.Locked = true | |
461 | p.TopSurface = 0 | |
462 | p.BottomSurface = 0 | |
463 | p.Parent = model | |
464 | local m = Instance.new("BlockMesh") | |
465 | m.Scale = Vector3.new(0.1, 0.05, 0.15) | |
466 | m.Parent = p | |
467 | local w = Instance.new("Weld") | |
468 | w.Part0 = p | |
469 | w.Part1 = pm | |
470 | w.C0 = CFrame.new(0, 0.03, -0.275) | |
471 | w.C1 = CFrame.new() | |
472 | w.Parent = p | |
473 | local p = Instance.new("Part") | |
474 | p.Name = "Center" -------------- | |
475 | p.CanCollide = false | |
476 | p.formFactor = "Symmetric" | |
477 | p.Size = Vector3.new(1, 1, 1) | |
478 | p.BrickColor = MC | |
479 | p.Reflectance = MR | |
480 | p.Locked = true | |
481 | p.TopSurface = 0 | |
482 | p.BottomSurface = 0 | |
483 | p.Parent = model | |
484 | local m = Instance.new("CylinderMesh") | |
485 | m.Scale = Vector3.new(0.32, 1.1, 0.32) | |
486 | m.Parent = p | |
487 | local w = Instance.new("Weld") | |
488 | w.Part0 = p | |
489 | w.Part1 = pm | |
490 | w.C0 = CFrame.new(0, 0.14, -0.04) | |
491 | w.C1 = CFrame.new() | |
492 | w.Parent = p | |
493 | local p = Instance.new("Part") | |
494 | p.Name = "CHandleC" -------------- | |
495 | p.CanCollide = false | |
496 | p.formFactor = "Symmetric" | |
497 | p.Size = Vector3.new(1, 1, 1) | |
498 | p.BrickColor = DC | |
499 | p.Reflectance = MR | |
500 | p.Locked = true | |
501 | p.TopSurface = 0 | |
502 | p.BottomSurface = 0 | |
503 | p.Parent = model | |
504 | local m = Instance.new("CylinderMesh") | |
505 | m.Scale = Vector3.new(0.32, 0.1, 0.32) | |
506 | m.Parent = p | |
507 | local w = Instance.new("Weld") | |
508 | w.Part0 = p | |
509 | w.Part1 = pm | |
510 | w.C0 = CFrame.new(0, -0.08, -0.38) * CFrame.fromEulerAnglesXYZ(math.rad(90), 0, 0) | |
511 | w.C1 = CFrame.new() | |
512 | w.Parent = p | |
513 | local p = Instance.new("Part") | |
514 | p.Name = "CHandleB" -------------- | |
515 | p.CanCollide = false | |
516 | p.formFactor = "Symmetric" | |
517 | p.Size = Vector3.new(1, 1, 1) | |
518 | p.BrickColor = DC | |
519 | p.Reflectance = MR | |
520 | p.Transparency = 1 | |
521 | p.Locked = true | |
522 | p.TopSurface = 0 | |
523 | p.BottomSurface = 0 | |
524 | p.Parent = model | |
525 | local m = Instance.new("CylinderMesh") | |
526 | m.Scale = Vector3.new(0.32, 0.1, 0.32) | |
527 | m.Parent = p | |
528 | local w = Instance.new("Weld") | |
529 | w.Part0 = p | |
530 | w.Part1 = pm | |
531 | w.C0 = CFrame.new(0, -0.08, -0.72) * CFrame.fromEulerAnglesXYZ(math.rad(90), 0, 0) | |
532 | w.C1 = CFrame.new() | |
533 | w.Parent = p | |
534 | local p = Instance.new("Part") | |
535 | p.Name = "CHandleB1" -------------- | |
536 | p.CanCollide = false | |
537 | p.formFactor = "Symmetric" | |
538 | p.Size = Vector3.new(1, 1, 1) | |
539 | p.BrickColor = DC | |
540 | p.Reflectance = MR | |
541 | p.Transparency = 1 | |
542 | p.Locked = true | |
543 | p.TopSurface = 0 | |
544 | p.BottomSurface = 0 | |
545 | p.Parent = model | |
546 | local m = Instance.new("BlockMesh") | |
547 | m.Scale = Vector3.new(0.15, 0.8, 0.1) | |
548 | m.Parent = p | |
549 | local w = Instance.new("Weld") | |
550 | w.Part0 = p | |
551 | w.Part1 = pm | |
552 | w.C0 = CFrame.new(0, -0.3, 0.08) | |
553 | w.C1 = CFrame.new() | |
554 | w.Parent = p | |
555 | local p = Instance.new("Part") | |
556 | p.Name = "Bolt" -------------- | |
557 | p.CanCollide = false | |
558 | p.formFactor = "Symmetric" | |
559 | p.Size = Vector3.new(1, 1, 1) | |
560 | p.BrickColor = BrickColor.new("Dark stone grey") | |
561 | p.Locked = true | |
562 | p.TopSurface = 0 | |
563 | p.BottomSurface = 0 | |
564 | p.Parent = model | |
565 | local m = Instance.new("CylinderMesh") | |
566 | m.Name = "Mesh" | |
567 | m.Scale = Vector3.new(0.14, 0.3, 0.14) | |
568 | m.Offset = Vector3.new(0, 0, 0) | |
569 | m.Parent = p | |
570 | local w = Instance.new("Weld") | |
571 | w.Part0 = p | |
572 | w.Part1 = pm | |
573 | w.C0 = CFrame.new(-0.1, 0.4, -0.04) | |
574 | w.C1 = CFrame.new() | |
575 | w.Parent = p | |
576 | local p = Instance.new("Part") | |
577 | p.Name = "DustCover" -------------- | |
578 | p.CanCollide = false | |
579 | p.formFactor = "Symmetric" | |
580 | p.Size = Vector3.new(1, 1, 1) | |
581 | p.BrickColor = DC | |
582 | p.Locked = true | |
583 | p.TopSurface = 0 | |
584 | p.BottomSurface = 0 | |
585 | p.Parent = model | |
586 | local m = Instance.new("BlockMesh") | |
587 | m.Name = "Mesh" | |
588 | m.Scale = Vector3.new(0.14, 0.34, 0.14) | |
589 | m.Offset = Vector3.new(0, 0, 0) | |
590 | m.Parent = p | |
591 | local s = Instance.new("Smoke") | |
592 | s.Enabled = false | |
593 | s.Name = "Smoke" | |
594 | s.RiseVelocity = 0 | |
595 | s.Opacity = 0.1 | |
596 | s.Color = Color3.new(90 / 225, 90 / 225, 90 / 225) | |
597 | s.Size = 0.2 | |
598 | s.Parent = p | |
599 | local w = Instance.new("Weld") | |
600 | w.Part0 = p | |
601 | w.Part1 = pm | |
602 | w.C0 = CFrame.new(0, 0, 1) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0) | |
603 | w.C1 = CFrame.new() | |
604 | w.Parent = p | |
605 | local w = Instance.new("Weld") | |
606 | w.Part0 = p | |
607 | w.Part1 = pm | |
608 | w.C0 = CFrame.new(-0.105, 0.4, -0.06) * CFrame.fromEulerAnglesXYZ(0, math.rad(-6), 0) | |
609 | w.C1 = CFrame.new() | |
610 | w.Parent = p | |
611 | local p = Instance.new("Part") | |
612 | p.Name = "ForeBarrel" | |
613 | p.CanCollide = false | |
614 | p.formFactor = "Symmetric" | |
615 | p.Size = Vector3.new(1, 1, 1) | |
616 | p.BrickColor = GC | |
617 | p.Reflectance = GR | |
618 | p.Locked = true | |
619 | p.TopSurface = 0 | |
620 | p.BottomSurface = 0 | |
621 | p.Parent = model | |
622 | local m = Instance.new("CylinderMesh") | |
623 | m.Scale = Vector3.new(0.36, 0.8, 0.36) | |
624 | m.Parent = p | |
625 | local w = Instance.new("Weld") | |
626 | w.Part0 = p | |
627 | w.Part1 = pm | |
628 | w.C0 = CFrame.new(0, 1.08, -0.04) | |
629 | w.C1 = CFrame.new() | |
630 | w.Parent = p | |
631 | local p = Instance.new("Part") | |
632 | p.Name = "Rail" -------------- | |
633 | p.CanCollide = false | |
634 | p.formFactor = "Symmetric" | |
635 | p.Size = Vector3.new(1, 1, 1) | |
636 | p.BrickColor = MC | |
637 | p.Reflectance = MR | |
638 | p.Locked = true | |
639 | p.TopSurface = 0 | |
640 | p.BottomSurface = 0 | |
641 | p.Parent = model | |
642 | local m = Instance.new("BlockMesh") | |
643 | m.Scale = Vector3.new(0.36, 0.7, 0.18) | |
644 | m.Parent = p | |
645 | local w = Instance.new("Weld") | |
646 | w.Part0 = p | |
647 | w.Part1 = pm | |
648 | w.C0 = CFrame.new(0, 1.08, -0.04) | |
649 | w.C1 = CFrame.new() | |
650 | w.Parent = p | |
651 | local p = Instance.new("Part") | |
652 | p.Name = "Rail" -------------- | |
653 | p.CanCollide = false | |
654 | p.formFactor = "Symmetric" | |
655 | p.Size = Vector3.new(1, 1, 1) | |
656 | p.BrickColor = MC | |
657 | p.Reflectance = MR | |
658 | p.Locked = true | |
659 | p.TopSurface = 0 | |
660 | p.BottomSurface = 0 | |
661 | p.Parent = model | |
662 | local m = Instance.new("BlockMesh") | |
663 | m.Scale = Vector3.new(0.18, 0.7, 0.36) | |
664 | m.Parent = p | |
665 | local w = Instance.new("Weld") | |
666 | w.Part0 = p | |
667 | w.Part1 = pm | |
668 | w.C0 = CFrame.new(0, 1.08, -0.04) | |
669 | w.C1 = CFrame.new() | |
670 | w.Parent = p | |
671 | if Reciever == 0 then | |
672 | local p = Instance.new("Part") | |
673 | p.Name = "Barrel 1" | |
674 | p.formFactor = "Symmetric" | |
675 | p.Size = Vector3.new(1, 1, 1) | |
676 | p.BrickColor = DC | |
677 | p.Reflectance = MR | |
678 | p.CanCollide = false | |
679 | p.Locked = true | |
680 | p.TopSurface = 0 | |
681 | p.BottomSurface = 0 | |
682 | p.Parent = model | |
683 | local m = Instance.new("CylinderMesh") | |
684 | m.Scale = Vector3.new(0.15, 0.8, 0.15) | |
685 | m.Parent = p | |
686 | local w = Instance.new("Weld") | |
687 | w.Part0 = p | |
688 | w.Part1 = pm | |
689 | w.C0 = CFrame.new(0, 1.6, -0.04) | |
690 | w.C1 = CFrame.new() | |
691 | w.Parent = p | |
692 | local p = Instance.new("Part") | |
693 | p.Name = "Hole" | |
694 | p.formFactor = "Symmetric" | |
695 | p.Size = Vector3.new(1, 1, 1) | |
696 | p.BrickColor = BrickColor.new("Really black") | |
697 | p.CanCollide = false | |
698 | p.Locked = true | |
699 | p.TopSurface = 0 | |
700 | p.BottomSurface = 0 | |
701 | p.Parent = model | |
702 | local m = Instance.new("CylinderMesh") | |
703 | m.Scale = Vector3.new(0.1, 0.4, 0.1) | |
704 | m.Offset = Vector3.new(0, 0.2, 0) | |
705 | m.Parent = p | |
706 | local w = Instance.new("Weld") | |
707 | w.Part0 = p | |
708 | w.Part1 = pm | |
709 | w.C0 = CFrame.new(0, 2.403, -0.04) | |
710 | w.C1 = CFrame.new() | |
711 | w.Parent = p | |
712 | local p = Instance.new("Part") | |
713 | if silenced == false then | |
714 | p.Name = "Muzzle" | |
715 | else | |
716 | p.Name = "Muzzle 2" | |
717 | end | |
718 | p.formFactor = "Symmetric" | |
719 | p.Size = Vector3.new(1, 1, 1) | |
720 | p.BrickColor = DC | |
721 | p.Reflectance = MR | |
722 | p.CanCollide = false | |
723 | p.Locked = true | |
724 | p.TopSurface = 0 | |
725 | p.BottomSurface = 0 | |
726 | p.Parent = model | |
727 | local m = Instance.new("CylinderMesh") | |
728 | m.Scale = Vector3.new(0.18, 0.4, 0.18) | |
729 | m.Offset = Vector3.new(0, 0.2, 0) | |
730 | m.Parent = p | |
731 | local w = Instance.new("Weld") | |
732 | w.Part0 = p | |
733 | w.Part1 = pm | |
734 | w.C0 = CFrame.new(0, 2.4, -0.04) | |
735 | w.C1 = CFrame.new() | |
736 | w.Parent = p | |
737 | local s = Instance.new("Smoke") | |
738 | s.Enabled = false | |
739 | s.Name = "Smoke" | |
740 | s.RiseVelocity = -5 | |
741 | s.Opacity = 0.3 | |
742 | s.Color = Color3.new(75 / 225, 75 / 225, 75 / 225) | |
743 | s.Size = 1 | |
744 | s.Parent = p | |
745 | local f = Instance.new("Fire") | |
746 | f.Enabled = false | |
747 | f.Name = "Fire" | |
748 | f.Heat = -35 | |
749 | f.Size = 1 | |
750 | f.Parent = p | |
751 | local p = Instance.new("Part") | |
752 | p.formFactor = "Symmetric" | |
753 | p.Size = Vector3.new(1, 1, 1) | |
754 | p.BrickColor = MC | |
755 | p.CanCollide = false | |
756 | if silenced == false then | |
757 | p.Name = "Silencer" | |
758 | p.Transparency = 1 | |
759 | else | |
760 | p.Name = "Muzzle" | |
761 | p.Transparency = 0 | |
762 | end | |
763 | p.Locked = true | |
764 | p.TopSurface = 0 | |
765 | p.BottomSurface = 0 | |
766 | p.Parent = model | |
767 | local m = Instance.new("CylinderMesh") | |
768 | m.Scale = Vector3.new(0.25, 0.8, 0.25) | |
769 | m.Parent = p | |
770 | local w = Instance.new("Weld") | |
771 | w.Part0 = p | |
772 | w.Part1 = pm | |
773 | w.C0 = CFrame.new(0, 2.5, -0.04) | |
774 | w.C1 = CFrame.new() | |
775 | w.Parent = p | |
776 | local p = Instance.new("Part") | |
777 | p.Name = "Silencer1" | |
778 | p.formFactor = "Symmetric" | |
779 | p.Size = Vector3.new(1, 1, 1) | |
780 | p.BrickColor = BrickColor.new("Dark stone grey") | |
781 | p.CanCollide = false | |
782 | if silenced == false then | |
783 | p.Transparency = 1 | |
784 | else | |
785 | p.Transparency = 0 | |
786 | end | |
787 | p.Locked = true | |
788 | p.TopSurface = 0 | |
789 | p.BottomSurface = 0 | |
790 | p.Parent = model | |
791 | local m = Instance.new("CylinderMesh") | |
792 | m.Scale = Vector3.new(0.255, 0.6, 0.255) | |
793 | m.Parent = p | |
794 | local w = Instance.new("Weld") | |
795 | w.Part0 = p | |
796 | w.Part1 = pm | |
797 | w.C0 = CFrame.new(0, 2.5, -0.04) | |
798 | w.C1 = CFrame.new() | |
799 | w.Parent = p | |
800 | local p = Instance.new("Part") | |
801 | p.Name = "Silencer2" | |
802 | p.formFactor = "Symmetric" | |
803 | p.Size = Vector3.new(1, 1, 1) | |
804 | p.BrickColor = BrickColor.new("Really black") | |
805 | p.CanCollide = false | |
806 | if silenced == false then | |
807 | p.Transparency = 1 | |
808 | else | |
809 | p.Transparency = 0 | |
810 | end | |
811 | p.Locked = true | |
812 | p.TopSurface = 0 | |
813 | p.BottomSurface = 0 | |
814 | p.Parent = model | |
815 | local m = Instance.new("CylinderMesh") | |
816 | m.Scale = Vector3.new(0.1, 0.803, 0.1) | |
817 | m.Parent = p | |
818 | local w = Instance.new("Weld") | |
819 | w.Part0 = p | |
820 | w.Part1 = pm | |
821 | w.C0 = CFrame.new(0, 2.5, -0.04) | |
822 | w.C1 = CFrame.new() | |
823 | w.Parent = p | |
824 | local p = Instance.new("Part") -- Gas Block | |
825 | p.Name = "Frontsight" | |
826 | p.formFactor = "Symmetric" | |
827 | p.Size = Vector3.new(1, 1, 1) | |
828 | p.BrickColor = DC | |
829 | p.Reflectance = MR | |
830 | p.CanCollide = false | |
831 | p.Locked = true | |
832 | p.TopSurface = 0 | |
833 | p.BottomSurface = 0 | |
834 | p.Parent = model | |
835 | local m = Instance.new("BlockMesh") | |
836 | m.Scale = Vector3.new(0.08, 0.1, 0.3) | |
837 | m.Parent = p | |
838 | local w = Instance.new("Weld") | |
839 | w.Part0 = p | |
840 | w.Part1 = pm | |
841 | w.C0 = CFrame.new(0, 1.7, 0.1) | |
842 | w.C1 = CFrame.new() | |
843 | w.Parent = p | |
844 | local p = Instance.new("Part") | |
845 | p.Name = "Frontsight" | |
846 | p.formFactor = "Symmetric" | |
847 | p.Size = Vector3.new(1, 1, 1) | |
848 | p.BrickColor = DC | |
849 | p.Reflectance = MR | |
850 | p.CanCollide = false | |
851 | p.Locked = true | |
852 | p.TopSurface = 0 | |
853 | p.BottomSurface = 0 | |
854 | p.Parent = model | |
855 | local m = Instance.new("CylinderMesh") | |
856 | m.Scale = Vector3.new(0.1, 0.1, 0.1) | |
857 | m.Parent = p | |
858 | local w = Instance.new("Weld") | |
859 | w.Part0 = p | |
860 | w.Part1 = pm | |
861 | w.C0 = CFrame.new(0, 1.7, 0.28) | |
862 | w.C1 = CFrame.new() | |
863 | w.Parent = p | |
864 | local p = Instance.new("Part") | |
865 | p.Name = "FrontSight" | |
866 | p.CanCollide = false | |
867 | p.formFactor = "Symmetric" | |
868 | p.Size = Vector3.new(1, 1, 1) | |
869 | p.BrickColor = MC | |
870 | p.Reflectance = MR | |
871 | p.Locked = true | |
872 | p.TopSurface = 0 | |
873 | p.BottomSurface = 0 | |
874 | p.Parent = model | |
875 | local m = Instance.new("SpecialMesh") | |
876 | m.MeshType = "Wedge" | |
877 | m.Scale = Vector3.new(0.08, 0.45, 0.3) | |
878 | m.Parent = p | |
879 | local w = Instance.new("Weld") | |
880 | w.Part0 = p | |
881 | w.Part1 = pm | |
882 | w.C0 = CFrame.new(0, 1.45, 0.14) | |
883 | w.C1 = CFrame.new() | |
884 | w.Parent = p | |
885 | elseif Reciever == 1 then | |
886 | local p = Instance.new("Part") | |
887 | p.Name = "Barrel 1" | |
888 | p.formFactor = "Symmetric" | |
889 | p.Size = Vector3.new(1, 1, 1) | |
890 | p.BrickColor = DC | |
891 | p.Reflectance = MR | |
892 | p.CanCollide = false | |
893 | p.Locked = true | |
894 | p.TopSurface = 0 | |
895 | p.BottomSurface = 0 | |
896 | p.Parent = model | |
897 | local m = Instance.new("CylinderMesh") | |
898 | m.Scale = Vector3.new(0.15, 0.8, 0.15) | |
899 | m.Parent = p | |
900 | local w = Instance.new("Weld") | |
901 | w.Part0 = p | |
902 | w.Part1 = pm | |
903 | w.C0 = CFrame.new(0, 1.4, -0.04) | |
904 | w.C1 = CFrame.new() | |
905 | w.Parent = p | |
906 | local p = Instance.new("Part") | |
907 | p.Name = "Hole" | |
908 | p.formFactor = "Symmetric" | |
909 | p.Size = Vector3.new(1, 1, 1) | |
910 | p.BrickColor = BrickColor.new("Really black") | |
911 | p.CanCollide = false | |
912 | p.Locked = true | |
913 | p.TopSurface = 0 | |
914 | p.BottomSurface = 0 | |
915 | p.Parent = model | |
916 | local m = Instance.new("CylinderMesh") | |
917 | m.Scale = Vector3.new(0.1, 0.4, 0.1) | |
918 | m.Offset = Vector3.new(0, 0.2, 0) | |
919 | m.Parent = p | |
920 | local w = Instance.new("Weld") | |
921 | w.Part0 = p | |
922 | w.Part1 = pm | |
923 | w.C0 = CFrame.new(0, 2.203, -0.04) | |
924 | w.C1 = CFrame.new() | |
925 | w.Parent = p | |
926 | local p = Instance.new("Part") | |
927 | if silenced == false then | |
928 | p.Name = "Muzzle" | |
929 | else | |
930 | p.Name = "Muzzle 2" | |
931 | end | |
932 | p.formFactor = "Symmetric" | |
933 | p.Size = Vector3.new(1, 1, 1) | |
934 | p.BrickColor = DC | |
935 | p.Reflectance = MR | |
936 | p.CanCollide = false | |
937 | p.Locked = true | |
938 | p.TopSurface = 0 | |
939 | p.BottomSurface = 0 | |
940 | p.Parent = model | |
941 | local m = Instance.new("CylinderMesh") | |
942 | m.Scale = Vector3.new(0.18, 0.4, 0.18) | |
943 | m.Offset = Vector3.new(0, 0.2, 0) | |
944 | m.Parent = p | |
945 | local w = Instance.new("Weld") | |
946 | w.Part0 = p | |
947 | w.Part1 = pm | |
948 | w.C0 = CFrame.new(0, 2.2, -0.04) | |
949 | w.C1 = CFrame.new() | |
950 | w.Parent = p | |
951 | local s = Instance.new("Smoke") | |
952 | s.Enabled = false | |
953 | s.Name = "Smoke" | |
954 | s.RiseVelocity = -5 | |
955 | s.Opacity = 0.3 | |
956 | s.Color = Color3.new(75 / 225, 75 / 225, 75 / 225) | |
957 | s.Size = 1 | |
958 | s.Parent = p | |
959 | local f = Instance.new("Fire") | |
960 | f.Enabled = false | |
961 | f.Name = "Fire" | |
962 | f.Heat = -35 | |
963 | f.Size = 1 | |
964 | f.Parent = p | |
965 | local p = Instance.new("Part") | |
966 | p.formFactor = "Symmetric" | |
967 | p.Size = Vector3.new(1, 1, 1) | |
968 | p.BrickColor = MC | |
969 | p.CanCollide = false | |
970 | if silenced == false then | |
971 | p.Name = "Silencer" | |
972 | p.Transparency = 1 | |
973 | else | |
974 | p.Name = "Muzzle" | |
975 | p.Transparency = 0 | |
976 | end | |
977 | p.Locked = true | |
978 | p.TopSurface = 0 | |
979 | p.BottomSurface = 0 | |
980 | p.Parent = model | |
981 | local m = Instance.new("CylinderMesh") | |
982 | m.Scale = Vector3.new(0.25, 0.8, 0.25) | |
983 | m.Parent = p | |
984 | local w = Instance.new("Weld") | |
985 | w.Part0 = p | |
986 | w.Part1 = pm | |
987 | w.C0 = CFrame.new(0, 2.3, -0.04) | |
988 | w.C1 = CFrame.new() | |
989 | w.Parent = p | |
990 | local p = Instance.new("Part") | |
991 | p.Name = "Silencer1" | |
992 | p.formFactor = "Symmetric" | |
993 | p.Size = Vector3.new(1, 1, 1) | |
994 | p.BrickColor = BrickColor.new("Dark stone grey") | |
995 | p.CanCollide = false | |
996 | if silenced == false then | |
997 | p.Transparency = 1 | |
998 | else | |
999 | p.Transparency = 0 | |
1000 | end | |
1001 | p.Locked = true | |
1002 | p.TopSurface = 0 | |
1003 | p.BottomSurface = 0 | |
1004 | p.Parent = model | |
1005 | local m = Instance.new("CylinderMesh") | |
1006 | m.Scale = Vector3.new(0.255, 0.6, 0.255) | |
1007 | m.Parent = p | |
1008 | local w = Instance.new("Weld") | |
1009 | w.Part0 = p | |
1010 | w.Part1 = pm | |
1011 | w.C0 = CFrame.new(0, 2.3, -0.04) | |
1012 | w.C1 = CFrame.new() | |
1013 | w.Parent = p | |
1014 | local p = Instance.new("Part") | |
1015 | p.Name = "Silencer2" | |
1016 | p.formFactor = "Symmetric" | |
1017 | p.Size = Vector3.new(1, 1, 1) | |
1018 | p.BrickColor = BrickColor.new("Really black") | |
1019 | p.CanCollide = false | |
1020 | if silenced == false then | |
1021 | p.Transparency = 1 | |
1022 | else | |
1023 | p.Transparency = 0 | |
1024 | end | |
1025 | p.Locked = true | |
1026 | p.TopSurface = 0 | |
1027 | p.BottomSurface = 0 | |
1028 | p.Parent = model | |
1029 | local m = Instance.new("CylinderMesh") | |
1030 | m.Scale = Vector3.new(0.1, 0.803, 0.1) | |
1031 | m.Parent = p | |
1032 | local w = Instance.new("Weld") | |
1033 | w.Part0 = p | |
1034 | w.Part1 = pm | |
1035 | w.C0 = CFrame.new(0, 2.3, -0.04) | |
1036 | w.C1 = CFrame.new() | |
1037 | w.Parent = p | |
1038 | local p = Instance.new("Part") -- Gas Block | |
1039 | p.Name = "GasBlock" | |
1040 | p.formFactor = "Symmetric" | |
1041 | p.Size = Vector3.new(1, 1, 1) | |
1042 | p.BrickColor = DC | |
1043 | p.Reflectance = MR | |
1044 | p.CanCollide = false | |
1045 | p.Locked = true | |
1046 | p.TopSurface = 0 | |
1047 | p.BottomSurface = 0 | |
1048 | p.Parent = model | |
1049 | local m = Instance.new("BlockMesh") | |
1050 | m.Scale = Vector3.new(0.14, 0.18, 0.15) | |
1051 | m.Parent = p | |
1052 | local w = Instance.new("Weld") | |
1053 | w.Part0 = p | |
1054 | w.Part1 = pm | |
1055 | w.C0 = CFrame.new(0, 1.55, 0.02) | |
1056 | w.C1 = CFrame.new() | |
1057 | w.Parent = p | |
1058 | else end | |
1059 | if Stock == 1 then | |
1060 | local p = Instance.new("Part") | |
1061 | p.Name = "StockHinge" | |
1062 | p.CanCollide = false | |
1063 | p.formFactor = "Symmetric" | |
1064 | p.Size = Vector3.new(1, 1, 1) | |
1065 | p.BrickColor = DC | |
1066 | p.Reflectance = MR | |
1067 | p.Locked = true | |
1068 | p.TopSurface = 0 | |
1069 | p.BottomSurface = 0 | |
1070 | p.Parent = model | |
1071 | local m = Instance.new("CylinderMesh") | |
1072 | m.Scale = Vector3.new(0.1, 0.26, 0.1) | |
1073 | m.Parent = p | |
1074 | local w = Instance.new("Weld") | |
1075 | w.Part0 = p | |
1076 | w.Part1 = pm | |
1077 | w.C0 = CFrame.new(-0.14, 0.15, -0.4) * CFrame.fromEulerAnglesXYZ(math.rad(90), 0, 0) | |
1078 | w.C1 = CFrame.new() | |
1079 | w.Parent = p | |
1080 | local ps = Instance.new("Part") -- Stock | |
1081 | ps.Name = "StockBase" | |
1082 | ps.CanCollide = false | |
1083 | ps.formFactor = "Symmetric" | |
1084 | ps.Size = Vector3.new(1, 1, 1) | |
1085 | ps.BrickColor = GC | |
1086 | ps.Reflectance = GR | |
1087 | ps.Locked = true | |
1088 | ps.TopSurface = 0 | |
1089 | ps.BottomSurface = 0 | |
1090 | ps.Parent = model | |
1091 | local m = Instance.new("BlockMesh") | |
1092 | m.Scale = Vector3.new(0.18, 0.6, 0.28) | |
1093 | m.Parent = ps | |
1094 | local w = Instance.new("Weld") | |
1095 | w.Part0 = ps | |
1096 | w.Part1 = pm | |
1097 | if selected == true then | |
1098 | w.C0 = CFrame.new(0, -0.65, -0.15) | |
1099 | else | |
1100 | w.C0 = CFrame.new(0.25, 0.1, -0.15) * CFrame.fromEulerAnglesXYZ(0, 0, math.rad(180)) | |
1101 | end | |
1102 | w.C1 = CFrame.new() | |
1103 | w.Parent = ps | |
1104 | local p = Instance.new("Part") | |
1105 | p.Name = "Stock 1" | |
1106 | p.CanCollide = false | |
1107 | p.formFactor = "Symmetric" | |
1108 | p.Size = Vector3.new(1, 1, 1) | |
1109 | p.BrickColor = GC | |
1110 | p.Reflectance = GR | |
1111 | p.Locked = true | |
1112 | p.TopSurface = 0 | |
1113 | p.BottomSurface = 0 | |
1114 | p.Parent = model | |
1115 | local m = Instance.new("BlockMesh") | |
1116 | m.Scale = Vector3.new(0.18, 1, 0.28) | |
1117 | m.Parent = p | |
1118 | local w = Instance.new("Weld") | |
1119 | w.Part0 = p | |
1120 | w.Part1 = ps | |
1121 | w.C0 = CFrame.new(0, -0.38, 0) | |
1122 | w.C1 = CFrame.new() | |
1123 | w.Parent = p | |
1124 | local p = Instance.new("Part") | |
1125 | p.Name = "Stock 2" | |
1126 | p.CanCollide = false | |
1127 | p.formFactor = "Symmetric" | |
1128 | p.Size = Vector3.new(1, 1, 1) | |
1129 | p.BrickColor = GC | |
1130 | p.Reflectance = GR | |
1131 | p.Locked = true | |
1132 | p.TopSurface = 0 | |
1133 | p.BottomSurface = 0 | |
1134 | p.Parent = model | |
1135 | local m = Instance.new("BlockMesh") | |
1136 | m.Scale = Vector3.new(0.18, 0.2, 0.58) | |
1137 | m.Parent = p | |
1138 | local w = Instance.new("Weld") | |
1139 | w.Part0 = p | |
1140 | w.Part1 = ps | |
1141 | w.C0 = CFrame.new(0, -0.775, -0.28) | |
1142 | w.C1 = CFrame.new() | |
1143 | w.Parent = p | |
1144 | local p = Instance.new("Part") | |
1145 | p.Name = "StockAngle1" | |
1146 | p.CanCollide = false | |
1147 | p.formFactor = "Symmetric" | |
1148 | p.Size = Vector3.new(1, 1, 1) | |
1149 | p.BrickColor = GC | |
1150 | p.Reflectance = GR | |
1151 | p.Locked = true | |
1152 | p.TopSurface = 0 | |
1153 | p.BottomSurface = 0 | |
1154 | p.Parent = model | |
1155 | local m = Instance.new("BlockMesh") | |
1156 | m.Scale = Vector3.new(0.18, 0.18, 0.65) | |
1157 | m.Parent = p | |
1158 | local w = Instance.new("Weld") | |
1159 | w.Part0 = p | |
1160 | w.Part1 = ps | |
1161 | w.C0 = CFrame.new(0, -0.12, -0.56) * CFrame.fromEulerAnglesXYZ(math.rad(48), 0, 0) | |
1162 | w.C1 = CFrame.new() | |
1163 | w.Parent = p | |
1164 | elseif Stock == 2 then | |
1165 | local p = Instance.new("Part") -- Standard Stock | |
1166 | p.Name = "StockC" | |
1167 | p.CanCollide = false | |
1168 | p.formFactor = "Symmetric" | |
1169 | p.Size = Vector3.new(1, 1, 1) | |
1170 | p.BrickColor = GC | |
1171 | p.Reflectance = GR | |
1172 | p.Locked = true | |
1173 | p.TopSurface = 0 | |
1174 | p.BottomSurface = 0 | |
1175 | p.Parent = model | |
1176 | local m = Instance.new("CylinderMesh") | |
1177 | m.Scale = Vector3.new(0.2, 1, 0.2) | |
1178 | m.Parent = p | |
1179 | local w = Instance.new("Weld") | |
1180 | w.Part0 = p | |
1181 | w.Part1 = pm | |
1182 | w.C0 = CFrame.new(0, -0.6, -0.1) | |
1183 | w.C1 = CFrame.new() | |
1184 | w.Parent = p | |
1185 | local pt = Instance.new("Part") | |
1186 | pt.Name = "StockT" | |
1187 | pt.CanCollide = false | |
1188 | pt.formFactor = "Symmetric" | |
1189 | pt.Size = Vector3.new(1, 1, 1) | |
1190 | pt.BrickColor = GC | |
1191 | pt.Reflectance = GR | |
1192 | pt.Locked = true | |
1193 | pt.TopSurface = 0 | |
1194 | pt.BottomSurface = 0 | |
1195 | pt.Parent = model | |
1196 | local m = Instance.new("CylinderMesh") | |
1197 | m.Scale = Vector3.new(0.25, 0.8, 0.25) | |
1198 | m.Offset = Vector3.new(0, 0.4, 0) | |
1199 | m.Parent = pt | |
1200 | local w = Instance.new("Weld") | |
1201 | w.Part0 = pt | |
1202 | w.Part1 = pm | |
1203 | if selected == true then | |
1204 | w.C0 = CFrame.new(0, -0.8, -0.1) | |
1205 | else | |
1206 | w.C0 = CFrame.new(0, -0.4, -0.1) | |
1207 | end | |
1208 | w.C1 = CFrame.new() | |
1209 | w.Parent = pt | |
1210 | local p = Instance.new("Part") | |
1211 | p.Name = "StockAngle1" | |
1212 | p.CanCollide = false | |
1213 | p.formFactor = "Symmetric" | |
1214 | p.Size = Vector3.new(1, 1, 1) | |
1215 | p.BrickColor = GC | |
1216 | p.Reflectance = GR | |
1217 | p.Locked = true | |
1218 | p.TopSurface = 0 | |
1219 | p.BottomSurface = 0 | |
1220 | p.Parent = model | |
1221 | local m = Instance.new("SpecialMesh") | |
1222 | m.MeshType = "Wedge" | |
1223 | m.Scale = Vector3.new(0.2, 0.5, 0.5) | |
1224 | m.Parent = p | |
1225 | local w = Instance.new("Weld") | |
1226 | w.Part0 = p | |
1227 | w.Part1 = pt | |
1228 | w.C0 = CFrame.new(0, -0.3, -0.55) * CFrame.fromEulerAnglesXYZ(math.rad(270), 0, math.rad(180)) | |
1229 | w.C1 = CFrame.new() | |
1230 | w.Parent = p | |
1231 | local p = Instance.new("Part") | |
1232 | p.Name = "StockAngle2" | |
1233 | p.CanCollide = false | |
1234 | p.formFactor = "Symmetric" | |
1235 | p.Size = Vector3.new(1, 1, 1) | |
1236 | p.BrickColor = GC | |
1237 | p.Reflectance = GR | |
1238 | p.Locked = true | |
1239 | p.TopSurface = 0 | |
1240 | p.BottomSurface = 0 | |
1241 | p.Parent = model | |
1242 | local m = Instance.new("SpecialMesh") | |
1243 | m.MeshType = "Wedge" | |
1244 | m.Scale = Vector3.new(0.2, 0.4, 0.6) | |
1245 | m.Parent = p | |
1246 | local w = Instance.new("Weld") | |
1247 | w.Part0 = p | |
1248 | w.Part1 = pt | |
1249 | w.C0 = CFrame.new(0, -0.24, -0.3) * CFrame.fromEulerAnglesXYZ(math.rad(270), 0, math.rad(180)) | |
1250 | w.C1 = CFrame.new() | |
1251 | w.Parent = p--]] | |
1252 | else end | |
1253 | if Sight == 0 then | |
1254 | local p = Instance.new("Part") | |
1255 | p.Name = "RearSight" | |
1256 | p.CanCollide = false | |
1257 | p.formFactor = "Symmetric" | |
1258 | p.Size = Vector3.new(1, 1, 1) | |
1259 | p.BrickColor = MC | |
1260 | p.Reflectance = MR | |
1261 | p.Locked = true | |
1262 | p.TopSurface = 0 | |
1263 | p.BottomSurface = 0 | |
1264 | p.Parent = model | |
1265 | local m = Instance.new("CylinderMesh") | |
1266 | m.Scale = Vector3.new(0.2, 0.46, 0.2) | |
1267 | m.Parent = p | |
1268 | local w = Instance.new("Weld") | |
1269 | w.Part0 = p | |
1270 | w.Part1 = pm | |
1271 | w.C0 = CFrame.new(0, -0.06, -0.26) * CFrame.fromEulerAnglesXYZ(math.rad(100), 0, 0) | |
1272 | w.C1 = CFrame.new() | |
1273 | w.Parent = p | |
1274 | if Reciever == 1 then | |
1275 | local p = Instance.new("Part") | |
1276 | p.Name = "Frontsight" | |
1277 | p.formFactor = "Symmetric" | |
1278 | p.Size = Vector3.new(1, 1, 1) | |
1279 | p.BrickColor = DC | |
1280 | p.Reflectance = MR | |
1281 | p.CanCollide = false | |
1282 | p.Locked = true | |
1283 | p.TopSurface = 0 | |
1284 | p.BottomSurface = 0 | |
1285 | p.Parent = model | |
1286 | local m = Instance.new("BlockMesh") | |
1287 | m.Scale = Vector3.new(0.08, 0.1, 0.3) | |
1288 | m.Parent = p | |
1289 | local w = Instance.new("Weld") | |
1290 | w.Part0 = p | |
1291 | w.Part1 = pm | |
1292 | w.C0 = CFrame.new(0, 1.3, 0.1) | |
1293 | w.C1 = CFrame.new() | |
1294 | w.Parent = p | |
1295 | local p = Instance.new("Part") | |
1296 | p.Name = "Frontsight" | |
1297 | p.formFactor = "Symmetric" | |
1298 | p.Size = Vector3.new(1, 1, 1) | |
1299 | p.BrickColor = DC | |
1300 | p.Reflectance = MR | |
1301 | p.CanCollide = false | |
1302 | p.Locked = true | |
1303 | p.TopSurface = 0 | |
1304 | p.BottomSurface = 0 | |
1305 | p.Parent = model | |
1306 | local m = Instance.new("CylinderMesh") | |
1307 | m.Scale = Vector3.new(0.1, 0.1, 0.1) | |
1308 | m.Parent = p | |
1309 | local w = Instance.new("Weld") | |
1310 | w.Part0 = p | |
1311 | w.Part1 = pm | |
1312 | w.C0 = CFrame.new(0, 1.3, 0.28) | |
1313 | w.C1 = CFrame.new() | |
1314 | w.Parent = p | |
1315 | else end | |
1316 | elseif Sight == 1 then | |
1317 | local p = Instance.new("Part") -------- RDS Attachment | |
1318 | p.Name = "Ring" | |
1319 | p.formFactor = "Symmetric" | |
1320 | p.Size = Vector3.new(1, 1, 1) | |
1321 | p.BrickColor = MC | |
1322 | p.Reflectance = MR | |
1323 | p.CanCollide = false | |
1324 | p.Locked = true | |
1325 | p.TopSurface = 0 | |
1326 | p.BottomSurface = 0 | |
1327 | p.Parent = model | |
1328 | local m = Instance.new("SpecialMesh") | |
1329 | m.MeshType = "FileMesh" | |
1330 | m.MeshId = "http://www.roblox.com/asset/?id=3270017" | |
1331 | m.Scale = Vector3.new(0.25, 0.25, 0.8) | |
1332 | m.Parent = p | |
1333 | local w = Instance.new("Weld") | |
1334 | w.Part0 = p | |
1335 | w.Part1 = pm | |
1336 | w.C0 = CFrame.new(0, -0.25, 0.34) * CFrame.fromEulerAnglesXYZ(math.rad(90), 0, 0) | |
1337 | w.C1 = CFrame.new() | |
1338 | w.Parent = p | |
1339 | local p = Instance.new("Part") | |
1340 | p.Name = "SightBottom" | |
1341 | p.CanCollide = false | |
1342 | p.formFactor = "Symmetric" | |
1343 | p.Size = Vector3.new(1, 1, 1) | |
1344 | p.BrickColor = MC | |
1345 | p.Reflectance = MR | |
1346 | p.Locked = true | |
1347 | p.TopSurface = 0 | |
1348 | p.BottomSurface = 0 | |
1349 | p.Parent = model | |
1350 | local m = Instance.new("BlockMesh") | |
1351 | m.Scale = Vector3.new(0.25, 0.4, 0.18) | |
1352 | m.Parent = p | |
1353 | local w = Instance.new("Weld") | |
1354 | w.Part0 = p | |
1355 | w.Part1 = pm | |
1356 | w.C0 = CFrame.new(0, 0.2, 0.1) | |
1357 | w.C1 = CFrame.new() | |
1358 | w.Parent = p | |
1359 | local p = Instance.new("Part") | |
1360 | p.Name = "Image" | |
1361 | p.CanCollide = false | |
1362 | p.formFactor = "Symmetric" | |
1363 | p.Size = Vector3.new(1, 1, 1) | |
1364 | p.BrickColor = MC | |
1365 | p.Transparency = 1 | |
1366 | p.Locked = true | |
1367 | p.TopSurface = 0 | |
1368 | p.BottomSurface = 0 | |
1369 | p.Parent = model | |
1370 | local d = Instance.new("Decal") | |
1371 | d.Face = "Top" | |
1372 | d.Texture = "http://www.roblox.com/asset/?id=29712167" | |
1373 | d.Parent = p | |
1374 | local m = Instance.new("BlockMesh") | |
1375 | m.Scale = Vector3.new(0.1, 0.001, 0.1) | |
1376 | m.Parent = p | |
1377 | local w = Instance.new("Weld") | |
1378 | w.Part0 = p | |
1379 | w.Part1 = pm | |
1380 | w.C0 = CFrame.new(0, 0.34, 0.25) | |
1381 | w.C1 = CFrame.new() | |
1382 | w.Parent = p | |
1383 | elseif Sight == 2 then | |
1384 | local c = Instance.new("Part") | |
1385 | c.Name = "SightCube" | |
1386 | c.CanCollide = false | |
1387 | c.formFactor = "Symmetric" | |
1388 | c.Size = Vector3.new(1, 1, 1) | |
1389 | c.BrickColor = DC | |
1390 | c.Reflectance = MR | |
1391 | c.Transparency = 0.8 | |
1392 | c.Locked = true | |
1393 | c.TopSurface = 0 | |
1394 | c.BottomSurface = 0 | |
1395 | c.Parent = model | |
1396 | local m = Instance.new("BlockMesh") | |
1397 | m.Scale = Vector3.new(0.25, 0.25, 0.25) | |
1398 | m.Parent = c | |
1399 | local w = Instance.new("Weld") | |
1400 | w.Part0 = c | |
1401 | w.Part1 = pm | |
1402 | w.C0 = CFrame.new(0, 0.1, 0.25) | |
1403 | w.C1 = CFrame.new() | |
1404 | w.Parent = c | |
1405 | local p = Instance.new("Part") | |
1406 | p.Name = "SightBottom" | |
1407 | p.CanCollide = false | |
1408 | p.formFactor = "Symmetric" | |
1409 | p.Size = Vector3.new(1, 1, 1) | |
1410 | p.BrickColor = DC | |
1411 | p.Reflectance = MR | |
1412 | p.Locked = true | |
1413 | p.TopSurface = 0 | |
1414 | p.BottomSurface = 0 | |
1415 | p.Parent = model | |
1416 | local m = Instance.new("BlockMesh") | |
1417 | m.Scale = Vector3.new(0.2, 0.5, 0.18) | |
1418 | m.Parent = p | |
1419 | local w = Instance.new("Weld") | |
1420 | w.Part0 = p | |
1421 | w.Part1 = c | |
1422 | w.C0 = CFrame.new(0, 0.125, -0.12) | |
1423 | w.C1 = CFrame.new() | |
1424 | w.Parent = p | |
1425 | local p = Instance.new("Part") | |
1426 | p.Name = "Image" | |
1427 | p.CanCollide = false | |
1428 | p.formFactor = "Symmetric" | |
1429 | p.Size = Vector3.new(1, 1, 1) | |
1430 | p.BrickColor = MC | |
1431 | p.Transparency = 1 | |
1432 | p.Locked = true | |
1433 | p.TopSurface = 0 | |
1434 | p.BottomSurface = 0 | |
1435 | p.Parent = model | |
1436 | local d = Instance.new("Decal") | |
1437 | d.Face = "Top" | |
1438 | d.Texture = "http://www.roblox.com/asset/?id=29712167" | |
1439 | d.Parent = p | |
1440 | local m = Instance.new("BlockMesh") | |
1441 | m.Scale = Vector3.new(0.1, 0.001, 0.1) | |
1442 | m.Parent = p | |
1443 | local w = Instance.new("Weld") | |
1444 | w.Part0 = p | |
1445 | w.Part1 = c | |
1446 | w.C0 = CFrame.new(0, 0, 0) | |
1447 | w.C1 = CFrame.new() | |
1448 | w.Parent = p | |
1449 | local p = Instance.new("Part") | |
1450 | p.Name = "SightBox" | |
1451 | p.CanCollide = false | |
1452 | p.formFactor = "Symmetric" | |
1453 | p.Size = Vector3.new(1, 1, 1) | |
1454 | p.BrickColor = DC | |
1455 | p.Reflectance = MR | |
1456 | p.Locked = true | |
1457 | p.TopSurface = 0 | |
1458 | p.BottomSurface = 0 | |
1459 | p.Parent = model | |
1460 | local m = Instance.new("BlockMesh") | |
1461 | m.Scale = Vector3.new(0.05, 0.25, 0.25) | |
1462 | m.Offset = Vector3.new(0.1, 0, 0) | |
1463 | m.Parent = p | |
1464 | local w = Instance.new("Weld") | |
1465 | w.Part0 = p | |
1466 | w.Part1 = c | |
1467 | w.C0 = CFrame.new(0, 0, 0) | |
1468 | w.C1 = CFrame.new() | |
1469 | w.Parent = p | |
1470 | local p = Instance.new("Part") | |
1471 | p.Name = "SightBox" | |
1472 | p.CanCollide = false | |
1473 | p.formFactor = "Symmetric" | |
1474 | p.Size = Vector3.new(1, 1, 1) | |
1475 | p.BrickColor = DC | |
1476 | p.Reflectance = MR | |
1477 | p.Locked = true | |
1478 | p.TopSurface = 0 | |
1479 | p.BottomSurface = 0 | |
1480 | p.Parent = model | |
1481 | local m = Instance.new("BlockMesh") | |
1482 | m.Scale = Vector3.new(0.05, 0.25, 0.25) | |
1483 | m.Offset = Vector3.new(-0.1, 0, 0) | |
1484 | m.Parent = p | |
1485 | local w = Instance.new("Weld") | |
1486 | w.Part0 = p | |
1487 | w.Part1 = c | |
1488 | w.C0 = CFrame.new(0, 0, 0) | |
1489 | w.C1 = CFrame.new() | |
1490 | w.Parent = p | |
1491 | local p = Instance.new("Part") | |
1492 | p.Name = "SightBox" | |
1493 | p.CanCollide = false | |
1494 | p.formFactor = "Symmetric" | |
1495 | p.Size = Vector3.new(1, 1, 1) | |
1496 | p.BrickColor = DC | |
1497 | p.Reflectance = MR | |
1498 | p.Locked = true | |
1499 | p.TopSurface = 0 | |
1500 | p.BottomSurface = 0 | |
1501 | p.Parent = model | |
1502 | local m = Instance.new("BlockMesh") | |
1503 | m.Scale = Vector3.new(0.25, 0.25, 0.05) | |
1504 | m.Offset = Vector3.new(0, 0, -0.1) | |
1505 | m.Parent = p | |
1506 | local w = Instance.new("Weld") | |
1507 | w.Part0 = p | |
1508 | w.Part1 = c | |
1509 | w.C0 = CFrame.new(0, 0, 0) | |
1510 | w.C1 = CFrame.new() | |
1511 | w.Parent = p | |
1512 | local p = Instance.new("Part") | |
1513 | p.Name = "SightBox" | |
1514 | p.CanCollide = false | |
1515 | p.formFactor = "Symmetric" | |
1516 | p.Size = Vector3.new(1, 1, 1) | |
1517 | p.BrickColor = DC | |
1518 | p.Reflectance = MR | |
1519 | p.Locked = true | |
1520 | p.TopSurface = 0 | |
1521 | p.BottomSurface = 0 | |
1522 | p.Parent = model | |
1523 | local m = Instance.new("BlockMesh") | |
1524 | m.Scale = Vector3.new(0.25, 0.25, 0.05) | |
1525 | m.Offset = Vector3.new(0, 0, 0.1) | |
1526 | m.Parent = p | |
1527 | local w = Instance.new("Weld") | |
1528 | w.Part0 = p | |
1529 | w.Part1 = c | |
1530 | w.C0 = CFrame.new(0, 0, 0) | |
1531 | w.C1 = CFrame.new() | |
1532 | w.Parent = p | |
1533 | elseif Sight == 3 then | |
1534 | local l = Instance.new("Part") -- Aimpoint Scope | |
1535 | l.Name = "SightBottom" | |
1536 | l.CanCollide = false | |
1537 | l.formFactor = "Symmetric" | |
1538 | l.Size = Vector3.new(1, 1, 1) | |
1539 | l.BrickColor = DC | |
1540 | l.Reflectance = MR | |
1541 | l.Locked = true | |
1542 | l.TopSurface = 0 | |
1543 | l.BottomSurface = 0 | |
1544 | l.Parent = model | |
1545 | local m = Instance.new("BlockMesh") | |
1546 | m.Scale = Vector3.new(0.2, 0.4, 0.18) | |
1547 | m.Parent = l | |
1548 | local w = Instance.new("Weld") | |
1549 | w.Part0 = l | |
1550 | w.Part1 = pm | |
1551 | w.C0 = CFrame.new(0, 0.26, 0.13) | |
1552 | w.C1 = CFrame.new() | |
1553 | w.Parent = l | |
1554 | canZoom = true | |
1555 | local p = Instance.new("Part") | |
1556 | p.Name = "Scope" | |
1557 | p.formFactor = "Symmetric" | |
1558 | p.Size = Vector3.new(1, 1, 1) | |
1559 | p.BrickColor = MC | |
1560 | p.Reflectance = MR | |
1561 | p.CanCollide = false | |
1562 | p.Locked = true | |
1563 | p.TopSurface = 0 | |
1564 | p.BottomSurface = 0 | |
1565 | p.Parent = model | |
1566 | local m = Instance.new("CylinderMesh") | |
1567 | m.Scale = Vector3.new(0.28, 0.5, 0.28) | |
1568 | m.Parent = p | |
1569 | local w = Instance.new("Weld") | |
1570 | w.Part0 = p | |
1571 | w.Part1 = l | |
1572 | w.C0 = CFrame.new(0, 0, 0.16) | |
1573 | w.C1 = CFrame.new() | |
1574 | w.Parent = p | |
1575 | local p = Instance.new("Part") | |
1576 | p.Name = "ScopeInt" | |
1577 | p.formFactor = "Symmetric" | |
1578 | p.Size = Vector3.new(1, 1, 1) | |
1579 | p.BrickColor = BrickColor.new("White") | |
1580 | p.Reflectance = 0.3 | |
1581 | p.CanCollide = false | |
1582 | p.Locked = true | |
1583 | p.TopSurface = 0 | |
1584 | p.BottomSurface = 0 | |
1585 | p.Parent = model | |
1586 | local m = Instance.new("CylinderMesh") | |
1587 | m.Scale = Vector3.new(0.26, 0.604, 0.26) | |
1588 | m.Parent = p | |
1589 | local w = Instance.new("Weld") | |
1590 | w.Part0 = p | |
1591 | w.Part1 = l | |
1592 | w.C0 = CFrame.new(0, 0, 0.16) | |
1593 | w.C1 = CFrame.new() | |
1594 | w.Parent = p | |
1595 | local p = Instance.new("Part") | |
1596 | p.Name = "Scope" | |
1597 | p.formFactor = "Symmetric" | |
1598 | p.Size = Vector3.new(1, 1, 1) | |
1599 | p.BrickColor = MC | |
1600 | p.Reflectance = MR | |
1601 | p.CanCollide = false | |
1602 | p.Locked = true | |
1603 | p.TopSurface = 0 | |
1604 | p.BottomSurface = 0 | |
1605 | p.Parent = model | |
1606 | local m = Instance.new("CylinderMesh") | |
1607 | m.Scale = Vector3.new(0.3, 0.1, 0.3) | |
1608 | m.Parent = p | |
1609 | local w = Instance.new("Weld") | |
1610 | w.Part0 = p | |
1611 | w.Part1 = l | |
1612 | w.C0 = CFrame.new(0, -0.25, 0.16) | |
1613 | w.C1 = CFrame.new() | |
1614 | w.Parent = p | |
1615 | local p = Instance.new("Part") | |
1616 | p.Name = "Scope" | |
1617 | p.formFactor = "Symmetric" | |
1618 | p.Size = Vector3.new(1, 1, 1) | |
1619 | p.BrickColor = MC | |
1620 | p.Reflectance = MR | |
1621 | p.CanCollide = false | |
1622 | p.Locked = true | |
1623 | p.TopSurface = 0 | |
1624 | p.BottomSurface = 0 | |
1625 | p.Parent = model | |
1626 | local m = Instance.new("CylinderMesh") | |
1627 | m.Scale = Vector3.new(0.3, 0.1, 0.3) | |
1628 | m.Parent = p | |
1629 | local w = Instance.new("Weld") | |
1630 | w.Part0 = p | |
1631 | w.Part1 = l | |
1632 | w.C0 = CFrame.new(0, 0.25, 0.16) | |
1633 | w.C1 = CFrame.new() | |
1634 | w.Parent = p | |
1635 | local p = Instance.new("Part") | |
1636 | p.Name = "Scope" | |
1637 | p.formFactor = "Symmetric" | |
1638 | p.Size = Vector3.new(1, 1, 1) | |
1639 | p.BrickColor = MC | |
1640 | p.Reflectance = MR | |
1641 | p.CanCollide = false | |
1642 | p.Locked = true | |
1643 | p.TopSurface = 0 | |
1644 | p.BottomSurface = 0 | |
1645 | p.Parent = model | |
1646 | local m = Instance.new("CylinderMesh") | |
1647 | m.Scale = Vector3.new(0.12, 0.5, 0.12) | |
1648 | m.Parent = p | |
1649 | local w = Instance.new("Weld") | |
1650 | w.Part0 = p | |
1651 | w.Part1 = l | |
1652 | w.C0 = CFrame.new(-0.12, 0, 0.24) | |
1653 | w.C1 = CFrame.new() | |
1654 | w.Parent = p | |
1655 | local p = Instance.new("Part") | |
1656 | p.Name = "Scope" | |
1657 | p.formFactor = "Symmetric" | |
1658 | p.Size = Vector3.new(1, 1, 1) | |
1659 | p.BrickColor = MC | |
1660 | p.Reflectance = MR | |
1661 | p.CanCollide = false | |
1662 | p.Locked = true | |
1663 | p.TopSurface = 0 | |
1664 | p.BottomSurface = 0 | |
1665 | p.Parent = model | |
1666 | local m = Instance.new("CylinderMesh") | |
1667 | m.Scale = Vector3.new(0.13, 0.1, 0.13) | |
1668 | m.Parent = p | |
1669 | local w = Instance.new("Weld") | |
1670 | w.Part0 = p | |
1671 | w.Part1 = l | |
1672 | w.C0 = CFrame.new(-0.12, 0.25, 0.24) | |
1673 | w.C1 = CFrame.new() | |
1674 | w.Parent = p | |
1675 | local p = Instance.new("Part") | |
1676 | p.Name = "Scope" | |
1677 | p.formFactor = "Symmetric" | |
1678 | p.Size = Vector3.new(1, 1, 1) | |
1679 | p.BrickColor = MC | |
1680 | p.Reflectance = MR | |
1681 | p.CanCollide = false | |
1682 | p.Locked = true | |
1683 | p.TopSurface = 0 | |
1684 | p.BottomSurface = 0 | |
1685 | p.Parent = model | |
1686 | local m = Instance.new("CylinderMesh") | |
1687 | m.Scale = Vector3.new(0.13, 0.1, 0.13) | |
1688 | m.Parent = p | |
1689 | local w = Instance.new("Weld") | |
1690 | w.Part0 = p | |
1691 | w.Part1 = l | |
1692 | w.C0 = CFrame.new(-0.12, -0.25, 0.24) | |
1693 | w.C1 = CFrame.new() | |
1694 | w.Parent = p | |
1695 | else end | |
1696 | if Grip == true then | |
1697 | local p = Instance.new("Part") --------------- ForeGrip Attachment | |
1698 | p.Name = "ForeGrip" | |
1699 | p.formFactor = "Symmetric" | |
1700 | p.Size = Vector3.new(1, 1, 1) | |
1701 | p.BrickColor = BrickColor.new("Black") | |
1702 | p.CanCollide = false | |
1703 | p.Locked = true | |
1704 | p.TopSurface = 0 | |
1705 | p.BottomSurface = 0 | |
1706 | p.Parent = model | |
1707 | local m = Instance.new("CylinderMesh") | |
1708 | m.Scale = Vector3.new(0.25, 0.6, 0.25) | |
1709 | m.Parent = p | |
1710 | local w = Instance.new("Weld") | |
1711 | w.Part0 = p | |
1712 | w.Part1 = pm | |
1713 | w.C0 = CFrame.new(0, 0.4, 1.1) * CFrame.fromEulerAnglesXYZ(math.rad(90), 0, 0) | |
1714 | w.C1 = CFrame.new() | |
1715 | w.Parent = p | |
1716 | else end | |
1717 | if Attachment == true then | |
1718 | local p = Instance.new("Part") | |
1719 | p.Name = "LaserPod" | |
1720 | p.formFactor = "Symmetric" | |
1721 | p.Size = Vector3.new(1, 1, 1) | |
1722 | p.CanCollide = false | |
1723 | p.BrickColor = DC | |
1724 | p.Reflectance = MR | |
1725 | p.Locked = true | |
1726 | p.TopSurface = 0 | |
1727 | p.BottomSurface = 0 | |
1728 | p.Parent = model | |
1729 | local m = Instance.new("BlockMesh") | |
1730 | m.Scale = Vector3.new(0.1, 0.35, 0.25) | |
1731 | m.Parent = p | |
1732 | local w = Instance.new("Weld") | |
1733 | w.Part0 = p | |
1734 | w.Part1 = pm | |
1735 | w.C0 = CFrame.new(-0.22, 1.1, -0.04) | |
1736 | w.C1 = CFrame.new() | |
1737 | w.Parent = p--]] | |
1738 | local p = Instance.new("Part") | |
1739 | p.Name = "LaserPod" | |
1740 | p.formFactor = "Symmetric" | |
1741 | p.Size = Vector3.new(1, 1, 1) | |
1742 | p.CanCollide = false | |
1743 | p.BrickColor = DC | |
1744 | p.Reflectance = MR | |
1745 | p.Locked = true | |
1746 | p.TopSurface = 0 | |
1747 | p.BottomSurface = 0 | |
1748 | p.Parent = model | |
1749 | local m = Instance.new("CylinderMesh") | |
1750 | m.Scale = Vector3.new(0.12, 0.35, 0.12) | |
1751 | m.Parent = p | |
1752 | local w = Instance.new("Weld") | |
1753 | w.Part0 = p | |
1754 | w.Part1 = pm | |
1755 | w.C0 = CFrame.new(-0.22, 1.1, 0.1) | |
1756 | w.C1 = CFrame.new() | |
1757 | w.Parent = p | |
1758 | local p = Instance.new("Part") | |
1759 | p.Name = "Laser" | |
1760 | p.CanCollide = false | |
1761 | p.formFactor = "Symmetric" | |
1762 | p.Size = Vector3.new(1, 1, 1) | |
1763 | p.BrickColor = BrickColor.new("Bright red") | |
1764 | p.Locked = true | |
1765 | if selected == true and Mode == 1 then | |
1766 | p.Transparency = 0.4 | |
1767 | else | |
1768 | p.Transparency = 1 | |
1769 | end | |
1770 | p.TopSurface = 0 | |
1771 | p.BottomSurface = 0 | |
1772 | p.Parent = model | |
1773 | local m = Instance.new("BlockMesh") | |
1774 | m.Scale = Vector3.new(0.01, 500, 0.01) | |
1775 | m.Offset = Vector3.new(0, -250, 0) | |
1776 | m.Parent = p | |
1777 | local w = Instance.new("Weld") | |
1778 | w.Part0 = p | |
1779 | w.Part1 = pm | |
1780 | w.C0 = CFrame.new(-0.22, 1.1, 0.1) | |
1781 | w.C1 = CFrame.new() | |
1782 | w.Parent = p | |
1783 | local p = Instance.new("Part") | |
1784 | p.Name = "LaserPod" | |
1785 | p.formFactor = "Symmetric" | |
1786 | p.Size = Vector3.new(1, 1, 1) | |
1787 | p.CanCollide = false | |
1788 | p.BrickColor = DC | |
1789 | p.Reflectance = MR | |
1790 | p.Locked = true | |
1791 | p.TopSurface = 0 | |
1792 | p.BottomSurface = 0 | |
1793 | p.Parent = model | |
1794 | local m = Instance.new("CylinderMesh") | |
1795 | m.Scale = Vector3.new(0.12, 0.35, 0.12) | |
1796 | m.Parent = p | |
1797 | local w = Instance.new("Weld") | |
1798 | w.Part0 = p | |
1799 | w.Part1 = pm | |
1800 | w.C0 = CFrame.new(-0.22, 1.1, -0.14) | |
1801 | w.C1 = CFrame.new() | |
1802 | w.Parent = p | |
1803 | local p = Instance.new("Part") | |
1804 | p.Name = "LightAttach" | |
1805 | p.formFactor = "Symmetric" | |
1806 | p.Size = Vector3.new(1, 1, 1) | |
1807 | p.CanCollide = false | |
1808 | p.BrickColor = DC | |
1809 | p.Reflectance = MR | |
1810 | p.Locked = true | |
1811 | p.TopSurface = 0 | |
1812 | p.BottomSurface = 0 | |
1813 | p.Parent = model | |
1814 | local m = Instance.new("CylinderMesh") | |
1815 | m.Scale = Vector3.new(0.2, 0.35, 0.2) | |
1816 | m.Parent = p | |
1817 | local w = Instance.new("Weld") | |
1818 | w.Part0 = p | |
1819 | w.Part1 = pm | |
1820 | w.C0 = CFrame.new(0.25, 1.1, -0.04) | |
1821 | w.C1 = CFrame.new() | |
1822 | w.Parent = p | |
1823 | local p = Instance.new("Part") | |
1824 | p.Name = "Light" | |
1825 | p.CanCollide = false | |
1826 | p.formFactor = "Custom" | |
1827 | p.Size = Vector3.new(0.2, 0.2, 0.2) | |
1828 | p.BrickColor = BrickColor.new("Bright yellow") | |
1829 | p.Locked = true | |
1830 | if selected == true and Mode == 2 and dual == false then | |
1831 | p.Transparency = 0.5 | |
1832 | else | |
1833 | p.Transparency = 1 | |
1834 | end | |
1835 | p.TopSurface = 0 | |
1836 | p.BottomSurface = 0 | |
1837 | p.Parent = model | |
1838 | local m = Instance.new("SpecialMesh") | |
1839 | m.MeshType = "FileMesh" | |
1840 | m.Scale = Vector3.new(2, 50, 2) | |
1841 | m.MeshId = "http://www.roblox.com/asset/?id=1033714" | |
1842 | m.Parent = p | |
1843 | local w = Instance.new("Weld") | |
1844 | w.Part0 = p | |
1845 | w.Part1 = pm | |
1846 | w.C0 = CFrame.new(0.25, 20, -0.04) | |
1847 | w.C1 = CFrame.new() | |
1848 | w.Parent = p | |
1849 | else end | |
1850 | return model | |
1851 | end | |
1852 | ||
1853 | ||
1854 | function removeParts(format) | |
1855 | if format == "RightHand" then | |
1856 | pcall(function() Player.Character[Name]:Remove() end) | |
1857 | elseif format == "LeftHand" then | |
1858 | pcall(function() Player.Character[Name.. " (Left)"]:Remove() end) | |
1859 | elseif format == "RightHolster" then | |
1860 | pcall(function() Player.Character[Name.. " (Holstered)"]:Remove() end) | |
1861 | elseif format == "LeftHolster" then | |
1862 | pcall(function() Player.Character[Name.. " (Holstered, Left)"]:Remove() end) | |
1863 | end | |
1864 | end | |
1865 | ||
1866 | ||
1867 | function SetAngle(Joint, Angle, Character) | |
1868 | if Character == nil then return false end | |
1869 | local Joints = { | |
1870 | Character.Torso:FindFirstChild("Right Shoulder 2"), | |
1871 | Character.Torso:FindFirstChild("Left Shoulder 2"), | |
1872 | Character.Torso:FindFirstChild("Right Hip 2"), | |
1873 | Character.Torso:FindFirstChild("Left Hip 2") | |
1874 | } | |
1875 | if Joints[Joint] == nil then return false end | |
1876 | if Joint == 1 or Joint == 3 then | |
1877 | Joints[Joint].DesiredAngle = Angle | |
1878 | end | |
1879 | if Joint == 2 or Joint == 4 then | |
1880 | Joints[Joint].DesiredAngle = -Angle | |
1881 | end | |
1882 | end | |
1883 | ||
1884 | ||
1885 | function ForceAngle(Joint, Angle, Character) | |
1886 | if Character == nil then return false end | |
1887 | local Joints = { | |
1888 | Character.Torso:FindFirstChild("Right Shoulder 2"), | |
1889 | Character.Torso:FindFirstChild("Left Shoulder 2"), | |
1890 | Character.Torso:FindFirstChild("Right Hip 2"), | |
1891 | Character.Torso:FindFirstChild("Left Hip 2") | |
1892 | } | |
1893 | if Joints[Joint] == nil then return false end | |
1894 | if Joint == 1 or Joint == 3 then | |
1895 | Joints[Joint].DesiredAngle = Angle | |
1896 | Joints[Joint].CurrentAngle = Angle | |
1897 | end | |
1898 | if Joint == 2 or Joint == 4 then | |
1899 | Joints[Joint].DesiredAngle = -Angle | |
1900 | Joints[Joint].CurrentAngle = -Angle | |
1901 | end | |
1902 | end | |
1903 | ||
1904 | ||
1905 | function SetSpeed(Joint, Speed, Character) | |
1906 | if Character == nil then return false end | |
1907 | local Joints = { | |
1908 | Character.Torso:FindFirstChild("Right Shoulder 2"), | |
1909 | Character.Torso:FindFirstChild("Left Shoulder 2"), | |
1910 | Character.Torso:FindFirstChild("Right Hip 2"), | |
1911 | Character.Torso:FindFirstChild("Left Hip 2") | |
1912 | } | |
1913 | if Joints[Joint] == nil then return false end | |
1914 | Joints[Joint].MaxVelocity = Speed | |
1915 | end | |
1916 | ||
1917 | ||
1918 | function DisableLimb(Limb, Character) | |
1919 | if Character == nil then return false end | |
1920 | if Character:FindFirstChild("Torso") == nil then return false end | |
1921 | local Joints = { | |
1922 | Character.Torso:FindFirstChild("Right Shoulder"), | |
1923 | Character.Torso:FindFirstChild("Left Shoulder"), | |
1924 | Character.Torso:FindFirstChild("Right Hip"), | |
1925 | Character.Torso:FindFirstChild("Left Hip") | |
1926 | } | |
1927 | local Limbs = { | |
1928 | Character:FindFirstChild("Right Arm"), | |
1929 | Character:FindFirstChild("Left Arm"), | |
1930 | Character:FindFirstChild("Right Leg"), | |
1931 | Character:FindFirstChild("Left Leg") | |
1932 | } | |
1933 | if Joints[Limb] == nil then return false end | |
1934 | if Limbs[Limb] == nil then return false end | |
1935 | local Joint = Instance.new("Motor") | |
1936 | Joint.Parent = Character.Torso | |
1937 | Joint.Part0 = Character.Torso | |
1938 | Joint.Part1 = Limbs[Limb] | |
1939 | if Limb == 1 then | |
1940 | Joint.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0) | |
1941 | Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0) | |
1942 | Joint.Name = "Right Shoulder 2" | |
1943 | elseif Limb == 2 then | |
1944 | Joint.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0) | |
1945 | Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0) | |
1946 | Joint.Name = "Left Shoulder 2" | |
1947 | elseif Limb == 3 then | |
1948 | Joint.C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0) | |
1949 | Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0) | |
1950 | Joint.Name = "Right Hip 2" | |
1951 | elseif Limb == 4 then | |
1952 | Joint.C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0) | |
1953 | Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0) | |
1954 | Joint.Name = "Left Hip 2" | |
1955 | end | |
1956 | Joint.MaxVelocity = Joints[Limb].MaxVelocity | |
1957 | Joint.CurrentAngle = Joints[Limb].CurrentAngle | |
1958 | Joint.DesiredAngle = Joints[Limb].DesiredAngle | |
1959 | Joints[Limb]:Remove() | |
1960 | end | |
1961 | ||
1962 | ||
1963 | function ResetLimbCFrame(Limb, Character) | |
1964 | if Character == nil then return false end | |
1965 | if Character.Parent == nil then return false end | |
1966 | if Character:FindFirstChild("Torso") == nil then return false end | |
1967 | local Joints = { | |
1968 | Character.Torso:FindFirstChild("Right Shoulder 2"), | |
1969 | Character.Torso:FindFirstChild("Left Shoulder 2"), | |
1970 | Character.Torso:FindFirstChild("Right Hip 2"), | |
1971 | Character.Torso:FindFirstChild("Left Hip 2") | |
1972 | } | |
1973 | local Limbs = { | |
1974 | Character:FindFirstChild("Right Arm"), | |
1975 | Character:FindFirstChild("Left Arm"), | |
1976 | Character:FindFirstChild("Right Leg"), | |
1977 | Character:FindFirstChild("Left Leg") | |
1978 | } | |
1979 | if Joints[Limb] == nil then return false end | |
1980 | if Limbs[Limb] == nil then return false end | |
1981 | if Limb == 1 then | |
1982 | Joints[Limb].C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0) | |
1983 | Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0) | |
1984 | elseif Limb == 2 then | |
1985 | Joints[Limb].C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0) | |
1986 | Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0) | |
1987 | elseif Limb == 3 then | |
1988 | Joints[Limb].C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0) | |
1989 | Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0) | |
1990 | elseif Limb == 4 then | |
1991 | Joints[Limb].C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0) | |
1992 | Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0) | |
1993 | end | |
1994 | end | |
1995 | ||
1996 | ||
1997 | function EnableLimb(Limb, Character) | |
1998 | if Character == nil then return false end | |
1999 | if Character:FindFirstChild("Torso") == nil then return false end | |
2000 | local Joints = { | |
2001 | Character.Torso:FindFirstChild("Right Shoulder 2"), | |
2002 | Character.Torso:FindFirstChild("Left Shoulder 2"), | |
2003 | Character.Torso:FindFirstChild("Right Hip 2"), | |
2004 | Character.Torso:FindFirstChild("Left Hip 2") | |
2005 | } | |
2006 | local Limbs = { | |
2007 | Character:FindFirstChild("Right Arm"), | |
2008 | Character:FindFirstChild("Left Arm"), | |
2009 | Character:FindFirstChild("Right Leg"), | |
2010 | Character:FindFirstChild("Left Leg") | |
2011 | } | |
2012 | if Joints[Limb] == nil then return false end | |
2013 | if Limbs[Limb] == nil then return false end | |
2014 | if Limb == 1 then | |
2015 | Joints[Limb].Name = "Right Shoulder" | |
2016 | elseif Limb == 2 then | |
2017 | Joints[Limb].Name = "Left Shoulder" | |
2018 | elseif Limb == 3 then | |
2019 | Joints[Limb].Name = "Right Hip" | |
2020 | elseif Limb == 4 then | |
2021 | Joints[Limb].Name = "Left Hip" | |
2022 | end | |
2023 | Animate = Character:FindFirstChild("Animate") | |
2024 | if Animate == nil then return false end | |
2025 | Animate = Animate:Clone() | |
2026 | Character.Animate:Remove() | |
2027 | Animate.Parent = Character | |
2028 | end | |
2029 | ||
2030 | ||
2031 | function playAnimation(format, mouse) | |
2032 | if format == "equip" then | |
2033 | Player.Character.Humanoid.WalkSpeed = WSPenalty | |
2034 | Player.Character[Name.. " (Holstered)"].Handle.Weld:Remove() | |
2035 | local w = Instance.new("Weld") | |
2036 | w.Part0 = Player.Character[Name.. " (Holstered)"].Handle | |
2037 | w.Part1 = Player.Character:FindFirstChild("Right Arm") | |
2038 | w.C0 = CFrame.new(0, 1.2, 0.7) | |
2039 | w.C1 = CFrame.new() | |
2040 | w.Parent = Player.Character[Name.. " (Holstered)"].Handle | |
2041 | for i = 0.01, 1, 0.1 do | |
2042 | if Player.Character:FindFirstChild("Torso") ~= nil then | |
2043 | if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then | |
2044 | Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new() | |
2045 | Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new((-0.5 * i) + (1.5 * (1 - i)), 1.2 * i, 0.8 * i) * CFrame.fromEulerAnglesXYZ(math.rad(300 + ((1 - i) * 50)), math.rad(10), math.rad(-90) * i) | |
2046 | Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new() | |
2047 | Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new((-0.9 * i) + (-1.5 * (1 - i)), -0.35 * i, 0.51 * i) * CFrame.fromEulerAnglesXYZ(math.rad(-90 * i), math.rad(-5 * i), 0) | |
2048 | wait() | |
2049 | else return false end | |
2050 | else return false end | |
2051 | end | |
2052 | return playAnimation("hold") | |
2053 | end | |
2054 | if format == "unequip" then | |
2055 | Mode = 0 | |
2056 | if Attachment == true then | |
2057 | Player.Character[Name].Laser.Transparency = 1 | |
2058 | Player.Character[Name].Light.Transparency = 1 | |
2059 | end | |
2060 | Player.Character.Humanoid.WalkSpeed = 16 | |
2061 | for i = 1, 0.01, -0.1 do | |
2062 | if Player.Character:FindFirstChild("Torso") ~= nil then | |
2063 | if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then | |
2064 | Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new() | |
2065 | Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new((-0.5 * i) + (1.5 * (1 - i)), 1.2 * i, 0.8 * i) * CFrame.fromEulerAnglesXYZ(math.rad(300 + ((1 - i) * 50)), math.rad(10), math.rad(-90) * i) | |
2066 | Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new() | |
2067 | Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new((-0.9 * i) + (-1.5 * (1 - i)), -0.35 * i, 0.51 * i) * CFrame.fromEulerAnglesXYZ(math.rad(-90 * i), math.rad(-5 * i), 0) | |
2068 | wait() | |
2069 | else return false end | |
2070 | else return false end | |
2071 | end | |
2072 | return true | |
2073 | end | |
2074 | if format == "hold" then | |
2075 | if Player.Character:FindFirstChild("Torso") ~= nil then | |
2076 | if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then | |
2077 | Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new() | |
2078 | Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.3, 1.2, 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(300), math.rad(10), math.rad(-90)) | |
2079 | Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new() | |
2080 | Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.9, -0.35, 0.51) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5), 0) | |
2081 | else return false end | |
2082 | else return false end | |
2083 | end | |
2084 | if format == "reload" then | |
2085 | for i = 5, 0, -1 do | |
2086 | if Player.Character:FindFirstChild("Torso") ~= nil then | |
2087 | if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then | |
2088 | Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new() | |
2089 | Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.3, 0.75, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(315 + (i * 1.5)), math.rad(i * 4), math.rad(-90)) | |
2090 | wait() | |
2091 | else return false end | |
2092 | else return false end | |
2093 | end | |
2094 | coroutine.resume(coroutine.create(function() | |
2095 | for i = 0, 25, 5 do | |
2096 | if Player.Character:FindFirstChild("Torso") ~= nil then | |
2097 | if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then | |
2098 | Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new() | |
2099 | Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.9, -0.35, 0.51) * CFrame.fromEulerAnglesXYZ(math.rad(-90 + i), math.rad(-5), 0) | |
2100 | wait() | |
2101 | else return false end | |
2102 | else return false end | |
2103 | end | |
2104 | end)) | |
2105 | Player.Character[Name].Handle.Release:Play() | |
2106 | Player.Character[Name].Magazine.Transparency = 1 | |
2107 | Player.Character[Name].MagPull1.Transparency = 1 | |
2108 | Player.Character[Name].MagPull2.Transparency = 1 | |
2109 | local Mag = Instance.new("Model") | |
2110 | Mag.Name = "Spent Magazine" | |
2111 | local source = Player.Character[Name]:FindFirstChild("Magazine") | |
2112 | if source == nil then return end | |
2113 | source = source:Clone() | |
2114 | source.CanCollide = true | |
2115 | source.Transparency = 0 | |
2116 | source.Parent = Mag | |
2117 | coroutine.resume(coroutine.create(function() wait(4.5) for i = 0, 1, 0.1 do source.Transparency = i wait() end source:Remove() end)) | |
2118 | for _, Part in pairs(Player.Character[Name]:GetChildren()) do | |
2119 | if Part.Name == "MagPull1" or Part.Name == "MagPull2" then | |
2120 | local new = Part:Clone() | |
2121 | new.Parent = Mag | |
2122 | new.Transparency = 0 | |
2123 | new.CanCollide = true | |
2124 | local w = Instance.new("Weld", new) | |
2125 | w.Part0 = w.Parent | |
2126 | w.Part1 = source | |
2127 | w.C0 = Part.Weld.C0 | |
2128 | w.C1 = Part.Weld.C1 | |
2129 | coroutine.resume(coroutine.create(function() wait(4.5) for i = 0, 1, 0.1 do new.Transparency = i wait() end new:Remove() end)) | |
2130 | else end | |
2131 | end | |
2132 | Mag.Parent = game.Workspace | |
2133 | for i = 0, 25, 5 do | |
2134 | if Player.Character:FindFirstChild("Torso") ~= nil then | |
2135 | if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then | |
2136 | Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new() | |
2137 | Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.5 + (i / 60), 1.2 - (i / 20), 0.8 + (i / 35)) * CFrame.fromEulerAnglesXYZ(math.rad(300 - i), math.rad(10 + -i * 3.5), math.rad(-90)) | |
2138 | wait() | |
2139 | else return false end | |
2140 | else return false end | |
2141 | end | |
2142 | magazineNew = Player.Character[Name].Magazine:Clone() | |
2143 | magazineNew.Name = "New Magazine" | |
2144 | magazineNew.Transparency = 0 | |
2145 | magazineNew.Parent = Player.Character[Name] | |
2146 | local w = Instance.new("Weld") | |
2147 | w.Part0 = magazineNew | |
2148 | w.Part1 = Player.Character:FindFirstChild("Left Arm") | |
2149 | w.C0 = CFrame.new(0, 1.1, 0) | |
2150 | w.C1 = CFrame.new() * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0) | |
2151 | w.Parent = magazineNew | |
2152 | wait(0.2) | |
2153 | for i = 25, 0, -5 do | |
2154 | if Player.Character:FindFirstChild("Torso") ~= nil then | |
2155 | if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then | |
2156 | Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new() | |
2157 | Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.3 + ((i + 10) / 60), 1.2 - ((i + 10) / 20), 0.8 + (i / 35)) * CFrame.fromEulerAnglesXYZ(math.rad(300 - (i - 10)), math.rad(10 + -i * 3.5), math.rad(-90)) | |
2158 | Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new() | |
2159 | Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.9 + ((25 - i) / 30), -0.35, 0.51 + ((25 - i) / 25)) * CFrame.fromEulerAnglesXYZ(math.rad(-90 + i), math.rad(-5), math.rad((25 * 2) - (i * 2))) | |
2160 | wait() | |
2161 | else return false end | |
2162 | else return false end | |
2163 | end | |
2164 | Player.Character[Name].Magazine.Transparency = 0 | |
2165 | Player.Character[Name].MagPull1.Transparency = 0 | |
2166 | Player.Character[Name].MagPull2.Transparency = 0 | |
2167 | CamShake(1, 30000) | |
2168 | CamShake(1, -30000) | |
2169 | Player.Character[Name]["New Magazine"]:Remove() | |
2170 | wait(0.1) | |
2171 | if Player.Character:FindFirstChild("Torso") ~= nil then | |
2172 | if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then | |
2173 | Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new() | |
2174 | Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.3, 1.2, 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(300), math.rad(10), math.rad(-90)) | |
2175 | Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new() | |
2176 | Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.9, -0.35, 0.51) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5), 0) | |
2177 | else return false end | |
2178 | else return false end | |
2179 | Player.Character[Name].Handle.Reload:Play() | |
2180 | Player.Character[Name].Handle.Jam:Play() | |
2181 | wait(0.2) | |
2182 | if magazine.Value == 0 or Jammed == true then | |
2183 | playAnimation("charge") | |
2184 | end | |
2185 | end | |
2186 | if format == "charge" then | |
2187 | Player.Character[Name].Handle.Weld:Remove() | |
2188 | local w = Instance.new("Weld") | |
2189 | w.Part0 = Player.Character[Name].Handle | |
2190 | w.Part1 = Player.Character:FindFirstChild("Left Arm") | |
2191 | w.C0 = CFrame.new(-0.85, -0.3, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(15), math.rad(90), 0) | |
2192 | w.C1 = CFrame.new(0, 0.4, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(40), 0, 0) | |
2193 | w.Parent = Player.Character[Name].Handle | |
2194 | if Player.Character:FindFirstChild("Torso") ~= nil then | |
2195 | if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then | |
2196 | Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new() | |
2197 | Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.4, 0.9, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(280), math.rad(-10), math.rad(-90)) | |
2198 | else return false end | |
2199 | else return false end | |
2200 | wait(0.2) | |
2201 | Player.Character[Name].Handle.Equip:Play() | |
2202 | Player.Character[Name].CHandleC.Transparency = 1 | |
2203 | Player.Character[Name].CHandleB.Transparency = 0 | |
2204 | Player.Character[Name].CHandleB1.Transparency = 0 | |
2205 | Player.Character[Name].Bolt.Mesh.Offset = Vector3.new(0, 0.115, 0) | |
2206 | Player.Character[Name].Bolt.Mesh.Scale = Vector3.new(0.14, 0.1, 0.14) | |
2207 | Player.Character[Name].DustCover.Mesh.Offset = Vector3.new(0, 0, 0.115) | |
2208 | Jammed = false | |
2209 | if magazine.Value ~= 0 then | |
2210 | makeShell(Player.Character[Name]:FindFirstChild("ShellOut")) | |
2211 | else end | |
2212 | for i = 0, 1, 0.25 do | |
2213 | if Player.Character:FindFirstChild("Torso") ~= nil then | |
2214 | if Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then | |
2215 | Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new() | |
2216 | Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1.2, 0 - (i / 1.5), 0.9) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5), 0) | |
2217 | wait() | |
2218 | else return false end | |
2219 | else return false end | |
2220 | end | |
2221 | wait(0.08) | |
2222 | Player.Character[Name].CHandleC.Transparency = 0 | |
2223 | Player.Character[Name].CHandleB.Transparency = 1 | |
2224 | Player.Character[Name].CHandleB1.Transparency = 1 | |
2225 | Player.Character[Name].Bolt.Mesh.Offset = Vector3.new(0, 0, 0) | |
2226 | Player.Character[Name].Bolt.Mesh.Scale = Vector3.new(0.14, 0.3, 0.14) | |
2227 | wait(0.02) | |
2228 | removeParts("RightHand") | |
2229 | makeParts("RightHand") | |
2230 | Player.Character[Name].DustCover.Mesh.Offset = Vector3.new(0, 0, 0.115) | |
2231 | playAnimation("hold") | |
2232 | return true | |
2233 | end | |
2234 | if format == "fire" then | |
2235 | Player.Character[Name].Bolt.Mesh.Offset = Vector3.new(0, 0.115, 0) | |
2236 | Player.Character[Name].Bolt.Mesh.Scale = Vector3.new(0.14, 0.1, 0.14) | |
2237 | Player.Character[Name].DustCover.Mesh.Offset = Vector3.new(0, 0, 0.115) | |
2238 | makeShell(Player.Character[Name]:FindFirstChild("ShellOut")) | |
2239 | if Player.Character[Name]:FindFirstChild("Handle") ~= nil then | |
2240 | if silenced then | |
2241 | Player.Character[Name].Handle.Fire2.Volume = math.random(8, 10) / 10 | |
2242 | Player.Character[Name].Handle.Fire2.Pitch = math.random(1.8, 2) | |
2243 | Player.Character[Name].Handle.Fire2:Play() | |
2244 | CamShake(10, 40000) | |
2245 | else | |
2246 | Player.Character[Name].Handle.Fire.Volume = math.random(9, 10) / 10 | |
2247 | Player.Character[Name].Handle.Fire.Pitch = math.random(1.6, 1.8) | |
2248 | Player.Character[Name].Handle.Fire:Play() | |
2249 | CamShake(10, 50000) | |
2250 | end | |
2251 | else return false end | |
2252 | if Player.Character[Name]:FindFirstChild("Muzzle") ~= nil then | |
2253 | if silenced == false then | |
2254 | coroutine.resume(coroutine.create(function() Player.Character[Name].DustCover.Smoke.Enabled = true Player.Character[Name].Muzzle.Smoke.Enabled = true Player.Character[Name].Muzzle.Fire.Enabled = true wait(0.1) Player.Character[Name].DustCover.Smoke.Enabled = false Player.Character[Name].Muzzle.Smoke.Enabled = false Player.Character[Name].Muzzle.Fire.Enabled = false end)) | |
2255 | else end | |
2256 | else return false end | |
2257 | for i = 0, 6, 3 do | |
2258 | if Player.Character:FindFirstChild("Torso") ~= nil then | |
2259 | if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then | |
2260 | Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new() | |
2261 | Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.3, 1.2, 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(300), math.rad(10 + i), math.rad(-90)) | |
2262 | Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new() | |
2263 | Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.9, -0.35, 0.51) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0) | |
2264 | wait() | |
2265 | else return false end | |
2266 | else return false end | |
2267 | end | |
2268 | if magazine.Value ~= 0 then | |
2269 | Player.Character[Name].Bolt.Mesh.Offset = Vector3.new(0, 0, 0) | |
2270 | Player.Character[Name].Bolt.Mesh.Scale = Vector3.new(0.14, 0.3, 0.14) | |
2271 | elseif magazine.Value == 0 then | |
2272 | Player.Character[Name].Handle.Lock:Play() | |
2273 | end | |
2274 | if math.random(1, Reliability) == 1 then | |
2275 | Jammed = true | |
2276 | Player.Character[Name].Handle.Jam:Play() | |
2277 | end | |
2278 | for i = 6, 0, -3 do | |
2279 | if Player.Character:FindFirstChild("Torso") ~= nil then | |
2280 | if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then | |
2281 | Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new() | |
2282 | Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.3, 1.2, 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(300), math.rad(10 + i), math.rad(-90)) | |
2283 | Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new() | |
2284 | Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.9, -0.35, 0.51) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0) | |
2285 | wait() | |
2286 | else return false end | |
2287 | else return false end | |
2288 | end | |
2289 | end | |
2290 | if format == "silence" then | |
2291 | Player.Character[Name].Handle.Jam:Play() | |
2292 | if Player.Character:FindFirstChild("Torso") ~= nil then | |
2293 | if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then | |
2294 | Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new() | |
2295 | Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.9, -0.6, 0.51) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5), 0) | |
2296 | else return false end | |
2297 | else return false end | |
2298 | for i = 0, 10, 1.5 do | |
2299 | if Player.Character:FindFirstChild("Torso") ~= nil then | |
2300 | if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil then | |
2301 | Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new() | |
2302 | Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.9, 1.4 - (i / 25), 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(290), 0, math.rad(-90)) | |
2303 | wait() | |
2304 | end | |
2305 | end | |
2306 | end | |
2307 | for i = 10, 0, -1.5 do | |
2308 | if Player.Character:FindFirstChild("Torso") ~= nil then | |
2309 | if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil then | |
2310 | Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new() | |
2311 | Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.9, 1.4 - (i / 25), 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(290), 0, math.rad(-90)) | |
2312 | wait() | |
2313 | end | |
2314 | end | |
2315 | end | |
2316 | playAnimation("hold") | |
2317 | return | |
2318 | end | |
2319 | if format == "attachment" then | |
2320 | Player.Character[Name].Handle.Switch:Play() | |
2321 | for i = 0, 10, 5 do | |
2322 | if Player.Character:FindFirstChild("Torso") ~= nil then | |
2323 | if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil then | |
2324 | Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new() | |
2325 | Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.5 - (i / 25), 1.2, 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(300 - i), math.rad(10 - i), math.rad(-90)) | |
2326 | wait() | |
2327 | end | |
2328 | end | |
2329 | end | |
2330 | for i = 10, 0, -5 do | |
2331 | if Player.Character:FindFirstChild("Torso") ~= nil then | |
2332 | if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil then | |
2333 | Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new() | |
2334 | Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.5 - (i / 25), 1.2, 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(300 - i), math.rad(10 - i), math.rad(-90)) | |
2335 | wait() | |
2336 | end | |
2337 | end | |
2338 | end | |
2339 | end | |
2340 | if format == "switch" then | |
2341 | for i = 10, 0, -3 do | |
2342 | if Player.Character:FindFirstChild("Torso") ~= nil then | |
2343 | if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then | |
2344 | Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new() | |
2345 | Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1 + (i / 30), -0.35, 0.51 + (i / 25)) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5), math.rad((25 * 2) - ((25 - i) * 2))) | |
2346 | wait() | |
2347 | else return false end | |
2348 | else return false end | |
2349 | end | |
2350 | end | |
2351 | return true | |
2352 | end | |
2353 | ||
2354 | ||
2355 | function CamShake(time, freq) | |
2356 | coroutine.resume(coroutine.create(function() | |
2357 | local cam = game:GetService("Workspace").CurrentCamera | |
2358 | local time = 10 | |
2359 | local seed = Vector3.new(math.random(100, 200) / freq, math.random(100, 200) / freq, 0) | |
2360 | if math.random(1, 2) == 1 then seed = Vector3.new(-seed.x, seed.y, 0) end | |
2361 | if math.random(1, 2) == 1 then seed = Vector3.new(seed.x, -seed.y, 0) end | |
2362 | 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) | |
2363 | for i = 1, time do | |
2364 | 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) | |
2365 | wait() | |
2366 | end | |
2367 | end)) | |
2368 | end | |
2369 | ||
2370 | ||
2371 | function makeShell(part) | |
2372 | if part == nil then return false end | |
2373 | local casing = Instance.new("Part") | |
2374 | casing.Name = "Shell" | |
2375 | casing.formFactor = "Custom" | |
2376 | casing.Size = Vector3.new(0.2, 0.25, 0.2) | |
2377 | 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))) | |
2378 | casing.BrickColor = BrickColor.new("New Yeller") | |
2379 | local mesh = Instance.new("CylinderMesh") | |
2380 | mesh.Scale = Vector3.new(0.3, 1, 0.3) | |
2381 | mesh.Parent = casing | |
2382 | casing.Parent = game:GetService("Workspace") | |
2383 | casing:BreakJoints() | |
2384 | casing.Velocity = (part.CFrame.lookVector * 50) + Vector3.new(0, 10, 0) | |
2385 | coroutine.resume(coroutine.create(function() wait(4.5) for i = 0, 1, 0.1 do casing.Transparency = i wait() end casing:Remove() end)) | |
2386 | end | |
2387 | ||
2388 | ||
2389 | function Weld(x, y) | |
2390 | local weld = Instance.new("Weld") | |
2391 | weld.Part0 = x | |
2392 | weld.Part1 = y | |
2393 | CJ = CFrame.new(x.Position) | |
2394 | C0 = x.CFrame:inverse() * CJ | |
2395 | C1 = y.CFrame:inverse() * CJ | |
2396 | weld.C0 = C0 | |
2397 | weld.C1 = C1 | |
2398 | weld.Parent = x | |
2399 | end | |
2400 | ||
2401 | ||
2402 | function tagHumanoid(humanoid) | |
2403 | local tag = Instance.new("ObjectValue") | |
2404 | tag.Name = "creator" | |
2405 | tag.Value = Player | |
2406 | tag.Parent = humanoid | |
2407 | local tag = Instance.new("StringValue") | |
2408 | tag.Name = "creatorType1" | |
2409 | tag.Value = Name | |
2410 | tag.Parent = humanoid | |
2411 | local tag = Instance.new("StringValue") | |
2412 | tag.Name = "creatorType2" | |
2413 | tag.Value = "shot" | |
2414 | tag.Parent = humanoid | |
2415 | end | |
2416 | ||
2417 | ||
2418 | function untagHumanoid(humanoid) | |
2419 | if humanoid ~= nil then | |
2420 | local tag = humanoid:FindFirstChild("creator") | |
2421 | if tag ~= nil then | |
2422 | tag:Remove() | |
2423 | end | |
2424 | local tag = humanoid:FindFirstChild("creatorType1") | |
2425 | if tag ~= nil then | |
2426 | tag:Remove() | |
2427 | end | |
2428 | local tag = humanoid:FindFirstChild("creatorType2") | |
2429 | if tag ~= nil then | |
2430 | tag:Remove() | |
2431 | end | |
2432 | end | |
2433 | end | |
2434 | ||
2435 | ||
2436 | function fire(startPoint, endPoint, hit) | |
2437 | local trail = Instance.new("Part") | |
2438 | trail.Name = "Bullet Trail" | |
2439 | trail.BrickColor = BrickColor.new("Dark stone grey") | |
2440 | trail.TopSurface = 0 | |
2441 | trail.BottomSurface = 0 | |
2442 | trail.formFactor = 0 | |
2443 | trail.Size = Vector3.new(1, 1, 1) | |
2444 | trail.Transparency = 0.5 | |
2445 | trail.Anchored = true | |
2446 | trail.CanCollide = false | |
2447 | trail.CFrame = CFrame.new((startPoint + endPoint) / 2, endPoint) | |
2448 | trail.Parent = game:GetService("Workspace") | |
2449 | local mesh = Instance.new("SpecialMesh") | |
2450 | mesh.MeshType = "Brick" | |
2451 | mesh.Scale = Vector3.new(0.1, 0.1, (startPoint - endPoint).magnitude) | |
2452 | mesh.Parent = trail | |
2453 | 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) | |
2454 | if hit ~= nil then | |
2455 | if hit.Parent == nil then return end | |
2456 | if hit.Parent.ClassName == "Hat" then | |
2457 | if hit.Parent.Parent.Humanoid ~= nil then | |
2458 | hit.Parent.Parent.Humanoid:TakeDamage(damage * 5) | |
2459 | end | |
2460 | end | |
2461 | if hit.Parent:FindFirstChild("Humanoid") ~= nil then | |
2462 | tagHumanoid(hit.Parent.Humanoid) | |
2463 | if hit.Name == "Head" then | |
2464 | hit.Parent.Humanoid:TakeDamage(damage * 10) | |
2465 | elseif hit.Name == "Torso" then | |
2466 | hit.Parent.Humanoid:TakeDamage(damage * 2) | |
2467 | elseif hit.Name == "Left Leg" then | |
2468 | hit.Parent.Humanoid:TakeDamage(damage) | |
2469 | hit.Parent.Humanoid.Sit = true | |
2470 | elseif hit.Name == "Right Leg" then | |
2471 | hit.Parent.Humanoid:TakeDamage(damage) | |
2472 | hit.Parent.Humanoid.Sit = true | |
2473 | else | |
2474 | hit.Parent.Humanoid:TakeDamage(damage) | |
2475 | end | |
2476 | if math.random(1, 10) == 1 then | |
2477 | hit.Parent.Humanoid.Sit = true | |
2478 | end | |
2479 | delay(0.1, function() untagHumanoid(hit.Parent.Humanoid) end) | |
2480 | end | |
2481 | if hit.Anchored == false then | |
2482 | hit.Velocity = hit.Velocity + ((endPoint - startPoint).unit * (damage * 2)) | |
2483 | end | |
2484 | end | |
2485 | end | |
2486 | ||
2487 | ||
2488 | function onButton1Down(mouse) | |
2489 | if selected == false then return end | |
2490 | 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 | |
2491 | if Player.Character[Name]:FindFirstChild("Handle") == nil then return end | |
2492 | if Player.Character[Name]:FindFirstChild("Muzzle") == nil then return end | |
2493 | if dual == true then if Player.Character[Name.. " (Left)"]:FindFirstChild("Handle") == nil then return end end | |
2494 | if dual == true then if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle") == nil then return end end | |
2495 | mouse.Icon = "http://www.roblox.com/asset/?id=59125642" | |
2496 | Button1Down = true | |
2497 | canFire = false | |
2498 | canFire2 = true | |
2499 | while canFire2 == true do | |
2500 | local humanoid = Player.Character:FindFirstChild("Humanoid") | |
2501 | if humanoid == nil then | |
2502 | canFire2 = false | |
2503 | break | |
2504 | end | |
2505 | if humanoid.Health <= 0 then | |
2506 | canFire2 = false | |
2507 | break | |
2508 | end | |
2509 | local fireLeft = false | |
2510 | if automatic == false and burst == false then | |
2511 | canFire2 = false | |
2512 | elseif automatic == false and burst == true then | |
2513 | if burstCount >= burstCountMax then | |
2514 | canFire2 = false | |
2515 | burstCount = 0 | |
2516 | break | |
2517 | end | |
2518 | burstCount = burstCount + 1 | |
2519 | elseif automatic == true and burst == false then | |
2520 | fireLeft = true | |
2521 | end | |
2522 | if Jammed ~= true then | |
2523 | if magazine.Value > 0 then | |
2524 | magazine.Value = magazine.Value - 1 | |
2525 | updateGui() | |
2526 | if silenced == true then | |
2527 | CamShake(1, Spread) | |
2528 | else end | |
2529 | fire(Player.Character[Name].Muzzle.Position, mouse.Hit.p, mouse.Target) | |
2530 | coroutine.resume(coroutine.create(function() | |
2531 | if dual == true then | |
2532 | playAnimation("rightFire") | |
2533 | elseif dual == false then | |
2534 | playAnimation("fire") | |
2535 | end | |
2536 | end)) | |
2537 | else | |
2538 | Player.Character[Name].Handle.Empty:Play() | |
2539 | end | |
2540 | else | |
2541 | Player.Character[Name].Handle.Jam:Play() | |
2542 | end | |
2543 | if fireLeft == true and dual == true and automatic == true then | |
2544 | if magazine.Value > 0 then | |
2545 | coroutine.resume(coroutine.create(function() | |
2546 | wait(readyTime / 2) | |
2547 | magazine.Value = magazine.Value - 1 | |
2548 | updateGui() | |
2549 | fire(Player.Character[Name.. " (Left)"].Muzzle.Position, mouse.Hit.p, mouse.Target) | |
2550 | playAnimation("leftFire") | |
2551 | end)) | |
2552 | else | |
2553 | coroutine.resume(coroutine.create(function() | |
2554 | wait(readyTime / 2) | |
2555 | Player.Character[Name].Handle.Empty:Play() | |
2556 | end)) | |
2557 | end | |
2558 | end | |
2559 | wait(readyTime) | |
2560 | end | |
2561 | if magazine.Value ~= 0 then | |
2562 | mouse.Icon = "http://www.roblox.com/asset/?id=59125633" | |
2563 | else end | |
2564 | canFire = true | |
2565 | end | |
2566 | end | |
2567 | ||
2568 | ||
2569 | function onButton1Up(mouse) | |
2570 | if selected == false then return end | |
2571 | Button1Down = false | |
2572 | canFire2 = false | |
2573 | burstCount = 0 | |
2574 | while canFire == false do wait() end | |
2575 | if dual == true and automatic == false then | |
2576 | if Player.Character[Name.. " (Left)"]:FindFirstChild("Handle") == nil then return end | |
2577 | if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle") == nil then return end | |
2578 | mouse.Icon = "http://www.roblox.com/asset/?id=59125642" | |
2579 | canFire = false | |
2580 | canFire2 = true | |
2581 | while canFire2 == true do | |
2582 | local humanoid = Player.Character:FindFirstChild("Humanoid") | |
2583 | if humanoid == nil then | |
2584 | canFire2 = false | |
2585 | break | |
2586 | end | |
2587 | if humanoid.Health <= 0 then | |
2588 | canFire2 = false | |
2589 | break | |
2590 | end | |
2591 | if burst == false then | |
2592 | canFire2 = false | |
2593 | elseif burst == true then | |
2594 | if burstCount >= burstCountMax then | |
2595 | canFire2 = false | |
2596 | burstCount = 0 | |
2597 | break | |
2598 | end | |
2599 | burstCount = burstCount + 1 | |
2600 | end | |
2601 | if magazine.Value <= 0 then | |
2602 | Player.Character[Name].Handle.Empty:Play() | |
2603 | else | |
2604 | coroutine.resume(coroutine.create(function() | |
2605 | playAnimation("leftFire") | |
2606 | end)) | |
2607 | magazine.Value = magazine.Value - 1 | |
2608 | updateGui() | |
2609 | fire(Player.Character[Name.. " (Left)"].Muzzle.Position, mouse.Hit.p, mouse.Target) | |
2610 | end | |
2611 | wait(readyTime) | |
2612 | end | |
2613 | if magazine.Value ~= 0 then | |
2614 | mouse.Icon = "http://www.roblox.com/asset/?id=59125633" | |
2615 | else end | |
2616 | canFire = true | |
2617 | end | |
2618 | end | |
2619 | ||
2620 | ||
2621 | function onKeyDown(key, mouse) | |
2622 | if selected == false then return end | |
2623 | key = key:lower() | |
2624 | if key == "q" and Button1Down == false and canFire == true then | |
2625 | if mouse.Target == nil then return end | |
2626 | if game:GetService("Players"):GetPlayerFromCharacter(mouse.Target.Parent) ~= nil then | |
2627 | if dual == true then onKeyDown("t", mouse) end | |
2628 | onDeselected(mouse) | |
2629 | removeParts("RightHolster") | |
2630 | script.Parent.Parent = game:GetService("Players"):GetPlayerFromCharacter(mouse.Target.Parent).Backpack | |
2631 | end | |
2632 | end | |
2633 | if key == "e" and Button1Down == false and canFire == true and canSilence == true then | |
2634 | canFire = false | |
2635 | if silenced then | |
2636 | playAnimation("silence") | |
2637 | silenced = false | |
2638 | if Player.Character:FindFirstChild(Name) == nil then return end | |
2639 | if Player.Character[Name]:FindFirstChild("Muzzle") == nil then return end | |
2640 | if Player.Character[Name]:FindFirstChild("Muzzle 2") == nil then return end | |
2641 | Player.Character[Name].Muzzle.Transparency = 1 | |
2642 | Player.Character[Name].Silencer1.Transparency = 1 | |
2643 | Player.Character[Name].Silencer2.Transparency = 1 | |
2644 | Player.Character[Name].Muzzle.Name = "Silencer" | |
2645 | Player.Character[Name]["Muzzle 2"].Name = "Muzzle" | |
2646 | if dual == true then | |
2647 | if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle") == nil then return end | |
2648 | if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle 2") == nil then return end | |
2649 | Player.Character[Name.. " (Left)"].Muzzle.Transparency = 1 | |
2650 | Player.Character[Name.. " (Left)"].Muzzle.Name = "Silencer" | |
2651 | Player.Character[Name.. " (Left)"]["Muzzle 2"].Name = "Muzzle" | |
2652 | end | |
2653 | else | |
2654 | playAnimation("silence") | |
2655 | silenced = true | |
2656 | if Player.Character:FindFirstChild(Name) == nil then return end | |
2657 | if Player.Character[Name]:FindFirstChild("Silencer") == nil then return end | |
2658 | if Player.Character[Name]:FindFirstChild("Muzzle") == nil then return end | |
2659 | Player.Character[Name].Silencer.Transparency = 0 | |
2660 | Player.Character[Name].Silencer1.Transparency = 0 | |
2661 | Player.Character[Name].Silencer2.Transparency = 0 | |
2662 | Player.Character[Name].Muzzle.Name = "Muzzle 2" | |
2663 | Player.Character[Name].Silencer.Name = "Muzzle" | |
2664 | if dual == true then | |
2665 | if Player.Character[Name.. " (Left)"]:FindFirstChild("Silencer") == nil then return end | |
2666 | if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle") == nil then return end | |
2667 | Player.Character[Name.. " (Left)"].Silencer.Transparency = 0 | |
2668 | Player.Character[Name.. " (Left)"].Muzzle.Name = "Muzzle 2" | |
2669 | Player.Character[Name.. " (Left)"].Silencer.Name = "Muzzle" | |
2670 | end | |
2671 | end | |
2672 | canFire = true | |
2673 | end | |
2674 | if key == "r" and Button1Down == false and canFire == true then | |
2675 | if ammo.Value > 0 and magazine.Value ~= magazineMax.Value + 1 then | |
2676 | canFire = false | |
2677 | burstCount = 0 | |
2678 | mouse.Icon = "http://www.roblox.com/asset/?id=59125642" | |
2679 | if magazine.Value > 0 then magazine.Value = 1 end | |
2680 | updateGui() | |
2681 | if dual == true then | |
2682 | playAnimation("reloadDual") | |
2683 | elseif dual == false then | |
2684 | playAnimation("reload") | |
2685 | end | |
2686 | if ammo.Value - magazineMax.Value < 0 then | |
2687 | magazine.Value = ammo.Value | |
2688 | ammo.Value = 0 | |
2689 | elseif ammo.Value - magazineMax.Value >= 0 then | |
2690 | ammo.Value = ammo.Value - magazineMax.Value | |
2691 | magazine.Value = magazine.Value + magazineMax.Value | |
2692 | end | |
2693 | updateGui() | |
2694 | mouse.Icon = "http://www.roblox.com/asset/?id=59125633" | |
2695 | canFire = true | |
2696 | end | |
2697 | end | |
2698 | if key == "t" and Button1Down == false and canFire == true and canDual == true then | |
2699 | canFire = false | |
2700 | if dual == false then | |
2701 | local weapon = nil | |
2702 | for _, p in pairs(Player.Backpack:GetChildren()) do | |
2703 | if p.Name == Name and p ~= script.Parent then weapon = p break end | |
2704 | end | |
2705 | if weapon ~= nil then | |
2706 | dual = true | |
2707 | weapon.Name = "Dual" | |
2708 | weapon.Parent = script | |
2709 | silenced = false | |
2710 | removeParts("RightHand") | |
2711 | makeParts("RightHand") | |
2712 | removeParts("RightHolster") | |
2713 | makeParts("LeftHolster") | |
2714 | playAnimation("leftEquip") | |
2715 | removeParts("LeftHolster") | |
2716 | makeParts("LeftHand") | |
2717 | magazineMax.Value = math.ceil(magazineMax.Value * 2) | |
2718 | ammoMax.Value = math.ceil(ammoMax.Value * 2) | |
2719 | magazine.Value = magazine.Value + weapon.Magazine.Value | |
2720 | ammo.Value = ammo.Value + weapon.Ammo.Value | |
2721 | updateGui() | |
2722 | end | |
2723 | elseif dual == true then | |
2724 | local weapon = script:FindFirstChild("Dual") | |
2725 | if weapon ~= nil then | |
2726 | dual = false | |
2727 | weapon.Name = Name | |
2728 | weapon.Parent = Player.Backpack | |
2729 | silenced = false | |
2730 | removeParts("RightHand") | |
2731 | makeParts("RightHand") | |
2732 | playAnimation("leftUnequip") | |
2733 | removeParts("LeftHand") | |
2734 | makeParts("RightHolster") | |
2735 | playAnimation("hold") | |
2736 | weapon.Magazine.Value = math.floor(magazine.Value / 2) | |
2737 | weapon.Ammo.Value = math.floor(ammo.Value / 2) | |
2738 | magazineMax.Value = math.ceil(magazineMax.Value / 2) | |
2739 | ammoMax.Value = math.ceil(ammoMax.Value / 2) | |
2740 | magazine.Value = math.ceil(magazine.Value / 2) | |
2741 | ammo.Value = math.ceil(ammo.Value / 2) | |
2742 | updateGui() | |
2743 | end | |
2744 | end | |
2745 | canFire = true | |
2746 | end | |
2747 | if key == "y" and canZoom == true then | |
2748 | if zoom == false then | |
2749 | zoom = true | |
2750 | local pos = mouse.Hit.p | |
2751 | local target = mouse.Target | |
2752 | local cam = game:GetService("Workspace").CurrentCamera | |
2753 | focus = Instance.new("Part", workspace) | |
2754 | focus.Anchored = true | |
2755 | focus.CanCollide = false | |
2756 | focus.Transparency = 1 | |
2757 | focus.TopSurface = 0 | |
2758 | focus.BottomSurface = 0 | |
2759 | focus.formFactor = "Plate" | |
2760 | focus.Size = Vector3.new(0, 0, 0) | |
2761 | focus.CFrame = CFrame.new(pos) * (CFrame.new(Player.Character.Torso.CFrame.p, pos) - CFrame.new(Player.Character.Torso.CFrame.p, pos).p) | |
2762 | cam.CameraSubject = focus | |
2763 | cam.CameraType = "Attach" | |
2764 | while zoom == true and selected == true do | |
2765 | local set = false | |
2766 | if target ~= nil then | |
2767 | if target.Parent ~= nil then | |
2768 | if target.Anchored == false then | |
2769 | 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) | |
2770 | set = true | |
2771 | end | |
2772 | end | |
2773 | end | |
2774 | if set == false then | |
2775 | focus.CFrame = CFrame.new(pos) * (CFrame.new(Player.Character.Torso.CFrame.p, pos) - CFrame.new(Player.Character.Torso.CFrame.p, pos).p) | |
2776 | end | |
2777 | wait() | |
2778 | end | |
2779 | if focus ~= nil then focus:Remove() focus = nil end | |
2780 | local cam = game:GetService("Workspace").CurrentCamera | |
2781 | cam.CameraSubject = Player.Character:FindFirstChild("Humanoid") | |
2782 | cam.CameraType = "Custom" | |
2783 | else | |
2784 | zoom = false | |
2785 | end | |
2786 | end | |
2787 | if key == "u" and Button1Down == false and canFire == true then | |
2788 | playAnimation("switch") | |
2789 | if automatic == false and burst == false then | |
2790 | if switchToBurst == true then | |
2791 | burst = true | |
2792 | local m = Instance.new("Message", Player) | |
2793 | m.Text = "Burst" | |
2794 | pcall(function() Player.Character[Name].Handle.Switch:Play() end) | |
2795 | delay(2.5, function() m:Remove() end) | |
2796 | elseif switchToAutomatic == true then | |
2797 | automatic = true | |
2798 | local m = Instance.new("Message", Player) | |
2799 | m.Text = "Automatic" | |
2800 | pcall(function() Player.Character[Name].Handle.Switch:Play() end) | |
2801 | delay(2.5, function() m:Remove() end) | |
2802 | end | |
2803 | elseif automatic == false and burst == true then | |
2804 | if switchToAutomatic == true then | |
2805 | automatic = true | |
2806 | burst = false | |
2807 | local m = Instance.new("Message", Player) | |
2808 | m.Text = "Automatic" | |
2809 | pcall(function() Player.Character[Name].Handle.Switch:Play() end) | |
2810 | delay(2.5, function() m:Remove() end) | |
2811 | elseif switchToSingle == true then | |
2812 | burst = false | |
2813 | local m = Instance.new("Message", Player) | |
2814 | m.Text = "Single" | |
2815 | pcall(function() Player.Character[Name].Handle.Switch:Play() end) | |
2816 | delay(2.5, function() m:Remove() end) | |
2817 | end | |
2818 | elseif automatic == true and burst == false then | |
2819 | if switchToSingle == true then | |
2820 | automatic = false | |
2821 | local m = Instance.new("Message", Player) | |
2822 | m.Text = "Single" | |
2823 | pcall(function() Player.Character[Name].Handle.Switch:Play() end) | |
2824 | delay(2.5, function() m:Remove() end) | |
2825 | elseif switchToBurst == true then | |
2826 | automatic = false | |
2827 | burst = true | |
2828 | local m = Instance.new("Message", Player) | |
2829 | m.Text = "Burst" | |
2830 | pcall(function() Player.Character[Name].Handle.Switch:Play() end) | |
2831 | delay(2.5, function() m:Remove() end) | |
2832 | end | |
2833 | end | |
2834 | end | |
2835 | if key == "f" and Button1Down == false and canFire == true and Attachment == true and dual == false then | |
2836 | playAnimation("attachment") | |
2837 | if Mode == 1 and Mode ~= 2 and Mode ~= 0 then | |
2838 | Player.Character[Name].Handle.Switch:Play() | |
2839 | Player.Character[Name].Laser.Transparency = 1 | |
2840 | Player.Character[Name].Light.Transparency = 0.5 | |
2841 | Mode = 2 | |
2842 | elseif Mode == 2 and Mode ~= 1 and Mode ~= 0 then | |
2843 | Player.Character[Name].Handle.Switch:Play() | |
2844 | Player.Character[Name].Laser.Transparency = 1 | |
2845 | Player.Character[Name].Light.Transparency = 1 | |
2846 | Mode = 0 | |
2847 | elseif Mode == 0 and Mode ~= 1 and Mode ~= 2 then | |
2848 | Player.Character[Name].Handle.Switch:Play() | |
2849 | Player.Character[Name].Laser.Transparency = 0.4 | |
2850 | Player.Character[Name].Light.Transparency = 1 | |
2851 | Mode = 1 | |
2852 | end | |
2853 | else end | |
2854 | if key == "c" and Button1Down == false and canFire == true then | |
2855 | if magazine.Value ~= 0 then | |
2856 | canFire = false | |
2857 | burstCount = 0 | |
2858 | mouse.Icon = "http://www.roblox.com/asset/?id=59125642" | |
2859 | if magazine.Value ~= 0 then magazine.Value = magazine.Value - 1 end | |
2860 | updateGui() | |
2861 | playAnimation("charge") | |
2862 | mouse.Icon = "http://www.roblox.com/asset/?id=59125633" | |
2863 | canFire = true | |
2864 | end | |
2865 | end | |
2866 | end | |
2867 | ||
2868 | ||
2869 | function onSelected(mouse) | |
2870 | if selected == true then return end | |
2871 | selected = true | |
2872 | canFire = false | |
2873 | mouse.Icon = "http://www.roblox.com/asset/?id=59125642" | |
2874 | while Player.Character:FindFirstChild("WeaponActivated") ~= nil do | |
2875 | if Player.Character.WeaponActivated.Value == nil then break end | |
2876 | if Player.Character.WeaponActivated.Value.Parent == nil then break end | |
2877 | wait() | |
2878 | end | |
2879 | updateGui() | |
2880 | local weapon = Instance.new("ObjectValue") | |
2881 | weapon.Name = "WeaponActivated" | |
2882 | weapon.Value = script.Parent | |
2883 | weapon.Parent = Player.Character | |
2884 | DisableLimb(1, Player.Character) | |
2885 | DisableLimb(2, Player.Character) | |
2886 | ForceAngle(1, 0, Player.Character) | |
2887 | ForceAngle(2, 0, Player.Character) | |
2888 | if dual == true then | |
2889 | coroutine.resume(coroutine.create(function() playAnimation("leftEquip") end)) | |
2890 | playAnimation("rightEquip") | |
2891 | removeParts("LeftHolster") | |
2892 | makeParts("LeftHand") | |
2893 | else | |
2894 | playAnimation("equip") | |
2895 | end | |
2896 | removeParts("RightHolster") | |
2897 | makeParts("RightHand") | |
2898 | mouse.Button1Down:connect(function() onButton1Down(mouse) end) | |
2899 | mouse.Button1Up:connect(function() onButton1Up(mouse) end) | |
2900 | mouse.KeyDown:connect(function(key) onKeyDown(key, mouse) end) | |
2901 | mouse.Icon = "http://www.roblox.com/asset/?id=59125633" | |
2902 | canFire = true | |
2903 | end | |
2904 | ||
2905 | ||
2906 | function onDeselected(mouse) | |
2907 | if selected == false then return end | |
2908 | Button1Down = false | |
2909 | while canFire == false do | |
2910 | wait() | |
2911 | end | |
2912 | selected = false | |
2913 | if dual == true then | |
2914 | if math.random(1, 2) == 1 then | |
2915 | coroutine.resume(coroutine.create(function() playAnimation("leftUnequip") end)) | |
2916 | wait(math.random(1, 10) / 10) | |
2917 | playAnimation("rightUnequip") | |
2918 | else | |
2919 | coroutine.resume(coroutine.create(function() playAnimation("rightUnequip") end)) | |
2920 | wait(math.random(1, 10) / 10) | |
2921 | playAnimation("leftUnequip") | |
2922 | end | |
2923 | removeParts("LeftHand") | |
2924 | makeParts("LeftHolster") | |
2925 | else | |
2926 | playAnimation("unequip") | |
2927 | end | |
2928 | removeParts("RightHand") | |
2929 | makeParts("RightHolster") | |
2930 | ForceAngle(1, 0, Player.Character) | |
2931 | ForceAngle(2, 0, Player.Character) | |
2932 | ResetLimbCFrame(1, Player.Character) | |
2933 | ResetLimbCFrame(2, Player.Character) | |
2934 | EnableLimb(1, Player.Character) | |
2935 | EnableLimb(2, Player.Character) | |
2936 | if Player.PlayerGui:FindFirstChild(Name) ~= nil then Player.PlayerGui[Name]:Remove() end | |
2937 | if Player.Character:FindFirstChild("WeaponActivated") ~= nil then | |
2938 | if Player.Character.WeaponActivated.Value == script.Parent then | |
2939 | Player.Character.WeaponActivated:Remove() | |
2940 | end | |
2941 | end | |
2942 | while Player.Character:FindFirstChild("WeaponActivated") ~= nil do | |
2943 | if Player.Character.WeaponActivated.Value == nil then break end | |
2944 | if Player.Character.WeaponActivated.Value.Parent == nil then break end | |
2945 | wait() | |
2946 | end | |
2947 | end | |
2948 | ||
2949 | ||
2950 | if script.Parent.className ~= "HopperBin" then | |
2951 | if Player == nil then print("Error: Player not found!") return end | |
2952 | Tool = Instance.new("HopperBin") | |
2953 | Tool.Name = Name | |
2954 | Tool.Parent = Player.Backpack | |
2955 | script.Name = "Main" | |
2956 | script.Parent = Tool | |
2957 | elseif script.Parent.className == "HopperBin" then | |
2958 | while script.Parent.Parent.className ~= "Backpack" do | |
2959 | wait() | |
2960 | end | |
2961 | if script.Parent:FindFirstChild("MagazineMax") == nil then | |
2962 | magazineMax = Instance.new("NumberValue") | |
2963 | magazineMax.Name = "MagazineMax" | |
2964 | if Magazine == "STANAG" then | |
2965 | magazineMax.Value = 30 | |
2966 | elseif Magazine == "Beta-C" then | |
2967 | magazineMax.Value = 100 | |
2968 | else end | |
2969 | magazineMax.Parent = script.Parent | |
2970 | else | |
2971 | magazineMax = script.Parent.MagazineMax | |
2972 | end | |
2973 | if script.Parent:FindFirstChild("Magazine") == nil then | |
2974 | magazine = Instance.new("NumberValue") | |
2975 | magazine.Name = "Magazine" | |
2976 | magazine.Value = 0 | |
2977 | magazine.Parent = script.Parent | |
2978 | else | |
2979 | magazine = script.Parent.Magazine | |
2980 | end | |
2981 | if script.Parent:FindFirstChild("AmmoMax") == nil then | |
2982 | ammoMax = Instance.new("NumberValue") | |
2983 | ammoMax.Name = "AmmoMax" | |
2984 | if Magazine == "STANAG" then | |
2985 | ammoMax.Value = 180 | |
2986 | elseif Magazine == "Beta-C" then | |
2987 | ammoMax.Value = 300 | |
2988 | else end | |
2989 | ammoMax.Parent = script.Parent | |
2990 | else | |
2991 | ammoMax = script.Parent.AmmoMax | |
2992 | end | |
2993 | if script.Parent:FindFirstChild("Ammo") == nil then | |
2994 | ammo = Instance.new("NumberValue") | |
2995 | ammo.Name = "Ammo" | |
2996 | ammo.Value = script.Parent.AmmoMax.Value | |
2997 | ammo.Parent = script.Parent | |
2998 | else | |
2999 | ammo = script.Parent.Ammo | |
3000 | end | |
3001 | Player = script.Parent.Parent.Parent | |
3002 | makeParts("RightHolster") | |
3003 | script.Parent.Selected:connect(onSelected) | |
3004 | script.Parent.Deselected:connect(onDeselected) | |
3005 | end | |
3006 | --lego | |
3007 | game.Workspace.SmokeDelsin.Humanoid.MaxHealth = math.huge -----Replace YOURNAMEHERE with your name, it gives you INF health, enjoy. C: | |
3008 | print(lego) |