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