SHOW:
|
|
- or go back to the newest paste.
1 | --MADE BY OneLegend (NOT THE SCRIPT) Thanks to CyberFromLU for letting me Publish! LOCAL SCRIPT: JUST RUN! | |
2 | ||
3 | - | local/--[[_(_bob371's_Shotgun_)_]] |
3 | + | |
4 | -------------------------------------------------------------------------------------------------------------------------------------------- | |
5 | ---------------------------------------------------------------------------------------------------------------------------- | |
6 | ||
7 | Player = game.Players.LocalPlayer | |
8 | Character = Player.Character | |
9 | script.Parent = Character | |
10 | ||
11 | --[[ * Fire Handle * ]]-- | |
12 | ||
13 | pcall(function() Character.Gun:Remove() end) | |
14 | ||
15 | Gun = Instance.new("Model") | |
16 | Gun.Name = "Shotgun" | |
17 | - | Gun.Name = "Gun" |
17 | + | |
18 | ||
19 | --[[ * Arm Weld * ]]-- | |
20 | ||
21 | ArmWeld = Instance.new("Weld") | |
22 | ArmWeld.Parent = Character["Torso"] | |
23 | ArmWeld.Part0 = ArmWeld.Parent | |
24 | ArmWeld.Part1 = Character["Right Arm"] | |
25 | ArmWeld.C0 = CFrame.new(1.5,0.5,-0.5) * CFrame.fromEulerAnglesXYZ(math.pi/2,0,0) | |
26 | ||
27 | --[[ * Arm Weld * ]]-- | |
28 | ||
29 | ArmWeldR = Instance.new("Weld") | |
30 | ArmWeldR.Parent = Character["Torso"] | |
31 | ArmWeldR.Part0 = ArmWeldR.Parent | |
32 | ArmWeldR.Part1 = Character["Left Arm"] | |
33 | ArmWeldR.C0 = CFrame.new(-1.5,0,0) * CFrame.fromEulerAnglesXYZ(0,0,0) | |
34 | ||
35 | --[[ * Neck Weld * ]]-- | |
36 | ||
37 | Neck = Instance.new("Weld") | |
38 | Neck.Parent = Character["Torso"] | |
39 | Neck.Part0 = Neck.Parent | |
40 | Neck.Part1 = Character["Head"] | |
41 | Neck.C0 = CFrame.new(0,1.5,0) * CFrame.fromEulerAnglesXYZ(0,0,0) | |
42 | ||
43 | --[[ * Handle * ]]-- | |
44 | ||
45 | Handle = Instance.new("Part") | |
46 | Handle.formFactor = "Custom" | |
47 | Handle.Locked = true | |
48 | Handle.CanCollide = false | |
49 | Handle.BrickColor = BrickColor.new("Medium stone grey") | |
50 | Handle.Anchored = false | |
51 | Handle.Size = Vector3.new(0.25,0.7,0.25) | |
52 | Handle.TopSurface = 0 | |
53 | Handle.BottomSurface = 0 | |
54 | Handle.Parent = Gun | |
55 | MeshA = Instance.new("BlockMesh",Handle) | |
56 | WeldA = Instance.new("Weld") | |
57 | - | MeshA.Bevel = 0.03 |
57 | + | |
58 | WeldA.Part0 = Character["Right Arm"] | |
59 | WeldA.Part1 = Handle | |
60 | WeldA.C0 = CFrame.new(0,-1.1,-0.2) * CFrame.Angles(-math.pi/2-0.1,0,0) | |
61 | ||
62 | --[[ * Cartrage * ]]-- | |
63 | ||
64 | Cartrage = Instance.new("Part") | |
65 | Cartrage.formFactor = "Custom" | |
66 | Cartrage.Locked = true | |
67 | Cartrage.CanCollide = false | |
68 | Cartrage.BrickColor = BrickColor.new("Really black") | |
69 | Cartrage.Anchored = false | |
70 | Cartrage.Size = Vector3.new(0.2,0.5,0.2) | |
71 | Cartrage.TopSurface = 0 | |
72 | Cartrage.BottomSurface = 0 | |
73 | Cartrage.Parent = Gun | |
74 | MeshB = Instance.new("BlockMesh",Cartrage) | |
75 | WeldB = Instance.new("Weld") | |
76 | WeldB.Parent = Cartrage | |
77 | - | MeshB.Bevel = 0.03 |
77 | + | |
78 | WeldB.Part1 = Cartrage | |
79 | WeldB.C0 = CFrame.new(0,0,0) * CFrame.Angles(0,0,0) | |
80 | ||
81 | --[[ * Trigger * ]]-- | |
82 | ||
83 | Trigger = Instance.new("Part") | |
84 | Trigger.formFactor = "Custom" | |
85 | Trigger.Locked = true | |
86 | Trigger.CanCollide = false | |
87 | Trigger.BrickColor = BrickColor.new("Really black") | |
88 | Trigger.Anchored = false | |
89 | Trigger.Size = Vector3.new(0.2,0.4,0.4) | |
90 | Trigger.TopSurface = 0 | |
91 | Trigger.BottomSurface = 0 | |
92 | Trigger.Parent = Gun | |
93 | MeshB = Instance.new("BlockMesh",Trigger) | |
94 | WeldB = Instance.new("Weld") | |
95 | WeldB.Parent = Trigger | |
96 | WeldB.Part0 = Handle | |
97 | - | MeshB.Bevel = 0.03 |
97 | + | |
98 | WeldB.C0 = CFrame.new(0,0.21,-0.09) * CFrame.Angles(0,0,0) | |
99 | ||
100 | --[[ * BWall * ]]-- | |
101 | ||
102 | BWall = Instance.new("Part") | |
103 | BWall.formFactor = "Custom" | |
104 | BWall.Locked = true | |
105 | BWall.CanCollide = false | |
106 | BWall.BrickColor = BrickColor.new("Medium stone grey") | |
107 | BWall.Anchored = false | |
108 | BWall.Size = Vector3.new(0.25,0.6,0.25) | |
109 | BWall.TopSurface = 0 | |
110 | BWall.BottomSurface = 0 | |
111 | BWall.Parent = Gun | |
112 | MeshB = Instance.new("BlockMesh",BWall) | |
113 | WeldB = Instance.new("Weld") | |
114 | WeldB.Parent = BWall | |
115 | WeldB.Part0 = Handle | |
116 | WeldB.Part1 = BWall | |
117 | - | MeshB.Bevel = 0.03 |
117 | + | |
118 | ||
119 | --[[ * CWall * ]]-- | |
120 | ||
121 | CWall = Instance.new("Part") | |
122 | CWall.formFactor = "Custom" | |
123 | CWall.Locked = true | |
124 | CWall.CanCollide = false | |
125 | CWall.BrickColor = BrickColor.new("Really black") | |
126 | CWall.Anchored = false | |
127 | CWall.Size = Vector3.new(0.3,0.6,0.2) | |
128 | CWall.TopSurface = 0 | |
129 | CWall.BottomSurface = 0 | |
130 | CWall.Parent = Gun | |
131 | MeshB = Instance.new("BlockMesh",CWall) | |
132 | WeldB = Instance.new("Weld") | |
133 | WeldB.Parent = CWall | |
134 | WeldB.Part0 = Handle | |
135 | WeldB.Part1 = CWall | |
136 | WeldB.C0 = CFrame.new(0,0.4,-0.3) * CFrame.Angles(math.pi/2+0.1,0,0) | |
137 | - | MeshB.Bevel = 0.03 |
137 | + | |
138 | --[[ * ButA * ]]-- | |
139 | ||
140 | ButA = Instance.new("Part") | |
141 | ButA.formFactor = "Custom" | |
142 | ButA.Locked = true | |
143 | ButA.CanCollide = false | |
144 | ButA.BrickColor = BrickColor.new("Really black") | |
145 | ButA.Anchored = false | |
146 | ButA.Size = Vector3.new(0.3,0.6,0.3) | |
147 | ButA.TopSurface = 0 | |
148 | ButA.BottomSurface = 0 | |
149 | ButA.Parent = Gun | |
150 | MeshB = Instance.new("CylinderMesh",ButA) | |
151 | WeldB = Instance.new("Weld") | |
152 | WeldB.Parent = ButA | |
153 | WeldB.Part0 = Handle | |
154 | WeldB.Part1 = ButA | |
155 | WeldB.C0 = CFrame.new(0.1,0.4,-0.3) * CFrame.Angles(math.pi/2+0.1,0,0) | |
156 | ||
157 | - | MeshB.Bevel = 0.03 |
157 | + | |
158 | ||
159 | ButB = Instance.new("Part") | |
160 | ButB.formFactor = "Custom" | |
161 | ButB.Locked = true | |
162 | ButB.CanCollide = false | |
163 | ButB.BrickColor = BrickColor.new("Really black") | |
164 | ButB.Anchored = false | |
165 | ButB.Size = Vector3.new(0.3,0.6,0.3) | |
166 | ButB.TopSurface = 0 | |
167 | ButB.BottomSurface = 0 | |
168 | ButB.Parent = Gun | |
169 | MeshB = Instance.new("CylinderMesh",ButB) | |
170 | WeldB = Instance.new("Weld") | |
171 | WeldB.Parent = ButB | |
172 | WeldB.Part0 = Handle | |
173 | WeldB.Part1 = ButB | |
174 | WeldB.C0 = CFrame.new(-0.1,0.4,-0.3) * CFrame.Angles(math.pi/2+0.1,0,0) | |
175 | ||
176 | --[[ * Hinge * ]]-- | |
177 | - | MeshB.Bevel = 0.03 |
177 | + | |
178 | Hinge = Instance.new("Part") | |
179 | Hinge.formFactor = "Custom" | |
180 | Hinge.Locked = true | |
181 | Hinge.CanCollide = false | |
182 | Hinge.BrickColor = BrickColor.new("Medium stone grey") | |
183 | Hinge.Anchored = false | |
184 | Hinge.Size = Vector3.new(0.2,0.25,0.2) | |
185 | Hinge.TopSurface = 0 | |
186 | Hinge.BottomSurface = 0 | |
187 | Hinge.Parent = Gun | |
188 | MeshB = Instance.new("CylinderMesh",Hinge) | |
189 | WeldQ = Instance.new("Weld") | |
190 | WeldQ.Parent = Hinge | |
191 | WeldQ.Part0 = Handle | |
192 | WeldQ.Part1 = Hinge | |
193 | WeldQ.C0 = CFrame.new(0,0.3,-0.6) * CFrame.Angles(math.pi/2+0.1,0,math.pi/2) | |
194 | ||
195 | --[[ * HingeP * ]]-- | |
196 | ||
197 | - | MeshB.Bevel = 0.03 |
197 | + | |
198 | HingeP.formFactor = "Custom" | |
199 | HingeP.Locked = true | |
200 | HingeP.CanCollide = false | |
201 | HingeP.BrickColor = BrickColor.new("Medium stone grey") | |
202 | HingeP.Anchored = false | |
203 | HingeP.Size = Vector3.new(0.2,0.5,0.2) | |
204 | HingeP.TopSurface = 0 | |
205 | HingeP.BottomSurface = 0 | |
206 | HingeP.Parent = Gun | |
207 | MeshB = Instance.new("CylinderMesh",HingeP) | |
208 | WeldB = Instance.new("Weld") | |
209 | WeldB.Parent = HingeP | |
210 | WeldB.Part0 = Hinge | |
211 | WeldB.Part1 = HingeP | |
212 | WeldB.C0 = CFrame.new(-0.25,0,0) * CFrame.Angles(0,0,math.pi/2) | |
213 | ||
214 | --[[ * BarrelA * ]]-- | |
215 | ||
216 | BarrelA = Instance.new("Part") | |
217 | - | MeshB.Bevel = 0.1 |
217 | + | |
218 | BarrelA.Locked = true | |
219 | BarrelA.CanCollide = false | |
220 | BarrelA.BrickColor = BrickColor.new("Really black") | |
221 | BarrelA.Anchored = false | |
222 | BarrelA.Size = Vector3.new(0.3,1.5,0.3) | |
223 | BarrelA.TopSurface = 0 | |
224 | BarrelA.BottomSurface = 0 | |
225 | BarrelA.Parent = Gun | |
226 | MeshB = Instance.new("CylinderMesh",BarrelA) | |
227 | WeldB = Instance.new("Weld") | |
228 | WeldB.Parent = BarrelA | |
229 | WeldB.Part0 = Hinge | |
230 | WeldB.Part1 = BarrelA | |
231 | WeldB.C0 = CFrame.new(-0.75,0.1,-0.125) * CFrame.Angles(0,0,math.pi/2) | |
232 | ||
233 | --[[ * BarrelB * ]]-- | |
234 | ||
235 | BarrelB = Instance.new("Part") | |
236 | BarrelB.formFactor = "Custom" | |
237 | - | MeshB.Bevel = 0.03 |
237 | + | |
238 | BarrelB.CanCollide = false | |
239 | BarrelB.BrickColor = BrickColor.new("Really black") | |
240 | BarrelB.Anchored = false | |
241 | BarrelB.Size = Vector3.new(0.3,1.5,0.3) | |
242 | BarrelB.TopSurface = 0 | |
243 | BarrelB.BottomSurface = 0 | |
244 | BarrelB.Parent = Gun | |
245 | MeshB = Instance.new("CylinderMesh",BarrelB) | |
246 | WeldB = Instance.new("Weld") | |
247 | WeldB.Parent = BarrelB | |
248 | WeldB.Part0 = Hinge | |
249 | WeldB.Part1 = BarrelB | |
250 | WeldB.C0 = CFrame.new(-0.75,-0.1,-0.125) * CFrame.Angles(0,0,math.pi/2) | |
251 | ||
252 | --[[ * Variables * ]]-- | |
253 | ||
254 | Head = false | |
255 | Ammo = 6 | |
256 | Arms = false | |
257 | - | MeshB.Bevel = 0.03 |
257 | + | |
258 | ||
259 | function TName() | |
260 | Hopper.Name = "Shotgun Ammo: "..Ammo | |
261 | end | |
262 | ||
263 | --[[ * Animation * ]]-- | |
264 | ||
265 | function ArmsOn() | |
266 | for i = 1,10 do wait() | |
267 | - | Ammo = 2 |
267 | + | |
268 | ArmWeldR.C0 = ArmWeldR.C0 + Vector3.new(0.1,0.05,-0.05) | |
269 | ArmWeld.C0 = ArmWeld.C0 * CFrame.Angles(0,0,-math.pi/10/2/2/2) | |
270 | ArmWeld.C0 = ArmWeld.C0 + Vector3.new(-0.05,0,0.09) | |
271 | end | |
272 | - | Hopper.Name = "Gun: "..Ammo |
272 | + | |
273 | ||
274 | function ArmsOff() | |
275 | for i = 1,10 do wait() | |
276 | ArmWeldR.C0 = ArmWeldR.C0 - Vector3.new(0.1,0.05,-0.05) | |
277 | ArmWeldR.C0 = ArmWeldR.C0 * CFrame.Angles(-math.pi/10/2,math.pi/11/2/2,-math.pi/10/2/2) | |
278 | ArmWeld.C0 = ArmWeld.C0 - Vector3.new(-0.05,0,0.09) | |
279 | ArmWeld.C0 = ArmWeld.C0 * CFrame.Angles(0,0,math.pi/10/2/2/2) | |
280 | end | |
281 | for i = 1,3 do wait() | |
282 | ArmWeldR.C0 = ArmWeldR.C0 * CFrame.Angles(0,0,0.05) | |
283 | end | |
284 | ArmWeldR.C0 = CFrame.new(-1.5,0,0) * CFrame.fromEulerAnglesXYZ(0,0,0) | |
285 | end | |
286 | ||
287 | function SuicideYes() | |
288 | for i = 1,10 do wait() | |
289 | ArmWeld.C0 = ArmWeld.C0 * CFrame.Angles(0,0,math.pi/10/2/2) | |
290 | WeldA.C0 = WeldA.C0 * CFrame.Angles(0,math.pi/11,0) | |
291 | end | |
292 | end | |
293 | ||
294 | function SuicideNo() | |
295 | for i = 1,10 do wait() | |
296 | ArmWeld.C0 = ArmWeld.C0 * CFrame.Angles(0,0,-math.pi/10/2/2) | |
297 | WeldA.C0 = WeldA.C0 * CFrame.Angles(0,-math.pi/11,0) | |
298 | end | |
299 | end | |
300 | ||
301 | function Reload() | |
302 | if Ammo == 0 then | |
303 | if Head == true then SuicideNo() end | |
304 | NewSoundI("http://www.roblox.com/Asset/?id=2761842",10,1,Handle,1.2) | |
305 | if Arms == false then | |
306 | for i = 1,10 do wait() | |
307 | ArmWeldR.C0 = ArmWeldR.C0 * CFrame.Angles(math.pi/10/2,-math.pi/11/2/2,math.pi/10/2/2) | |
308 | ArmWeldR.C0 = ArmWeldR.C0 + Vector3.new(0.1,0.05,-0.05) | |
309 | ArmWeld.C0 = ArmWeld.C0 * CFrame.Angles(0,0,-math.pi/10/2/2/2) | |
310 | ArmWeld.C0 = ArmWeld.C0 + Vector3.new(-0.05,0,0.09) | |
311 | end | |
312 | end | |
313 | for i = 1,10 do wait() | |
314 | WeldQ.C0 = WeldQ.C0 * CFrame.Angles(0,math.pi/10/2/2,0) | |
315 | ArmWeldR.C0 = ArmWeldR.C0 * CFrame.Angles(-math.pi/10/2/2/2,0,0) | |
316 | end | |
317 | for i = 1,10 do wait() | |
318 | ArmWeldR.C0 = ArmWeldR.C0 * CFrame.Angles(math.pi/10/2/2/2,0,0) | |
319 | end | |
320 | for i = 1,9 do wait() | |
321 | ArmWeldR.C0 = ArmWeldR.C0 - Vector3.new(0.1,0.05,-0.05) | |
322 | ArmWeldR.C0 = ArmWeldR.C0 * CFrame.Angles(-math.pi/10/2,math.pi/11/2/2,-math.pi/10/2/2) | |
323 | end | |
324 | for i = 1,3 do wait() | |
325 | ArmWeldR.C0 = ArmWeldR.C0 - Vector3.new(-0.1,0.05,-0.05) | |
326 | ArmWeldR.C0 = ArmWeldR.C0 * CFrame.Angles(-math.pi/10/2,math.pi/11/2/2,math.pi/10/2/2) | |
327 | end | |
328 | for i = 1,3 do wait() | |
329 | ArmWeldR.C0 = ArmWeldR.C0 + Vector3.new(-0.1,0.05,-0.05) | |
330 | ArmWeldR.C0 = ArmWeldR.C0 * CFrame.Angles(math.pi/10/2,-math.pi/11/2/2,-math.pi/10/2/2) | |
331 | end | |
332 | for i = 1,9 do wait() | |
333 | ArmWeldR.C0 = ArmWeldR.C0 + Vector3.new(0.1,0.05,-0.05) | |
334 | ArmWeldR.C0 = ArmWeldR.C0 * CFrame.Angles(math.pi/10/2,-math.pi/11/2/2,math.pi/10/2/2) | |
335 | end | |
336 | for i = 1,5 do wait() | |
337 | ArmWeldR.C0 = ArmWeldR.C0 * CFrame.Angles(math.pi/4/2/2/2,0,0) | |
338 | end | |
339 | Ammo = 3 | |
340 | TName() | |
341 | NewSound("http://www.roblox.com/Asset/?id=13510352",2,10,Handle) | |
342 | for i = 1,5 do wait() | |
343 | ArmWeldR.C0 = ArmWeldR.C0 * CFrame.Angles(-math.pi/4/2/2/2,0,0) | |
344 | end | |
345 | NewSound("http://www.roblox.com/Asset/?id=13510352",2,10,Handle) | |
346 | for i = 1,9 do wait() | |
347 | ArmWeldR.C0 = ArmWeldR.C0 - Vector3.new(0.1,0.05,-0.05) | |
348 | ArmWeldR.C0 = ArmWeldR.C0 * CFrame.Angles(-math.pi/10/2,math.pi/11/2/2,-math.pi/10/2/2) | |
349 | end | |
350 | for i = 1,3 do wait() | |
351 | - | Ammo = 1 |
351 | + | |
352 | ArmWeldR.C0 = ArmWeldR.C0 * CFrame.Angles(-math.pi/10/2,math.pi/11/2/2,math.pi/10/2/2) | |
353 | end | |
354 | for i = 1,3 do wait() | |
355 | ArmWeldR.C0 = ArmWeldR.C0 + Vector3.new(-0.1,0.05,-0.05) | |
356 | ArmWeldR.C0 = ArmWeldR.C0 * CFrame.Angles(math.pi/10/2,-math.pi/11/2/2,-math.pi/10/2/2) | |
357 | end | |
358 | for i = 1,9 do wait() | |
359 | ArmWeldR.C0 = ArmWeldR.C0 + Vector3.new(0.1,0.05,-0.05) | |
360 | ArmWeldR.C0 = ArmWeldR.C0 * CFrame.Angles(math.pi/10/2,-math.pi/11/2/2,math.pi/10/2/2) | |
361 | end | |
362 | for i = 1,5 do wait() | |
363 | ArmWeldR.C0 = ArmWeldR.C0 * CFrame.Angles(math.pi/4/2/2/2,0,0) | |
364 | end | |
365 | Ammo = 6 | |
366 | TName() | |
367 | NewSound("http://www.roblox.com/Asset/?id=13510352",2,10,Handle) | |
368 | for i = 1,5 do wait() | |
369 | ArmWeldR.C0 = ArmWeldR.C0 * CFrame.Angles(-math.pi/4/2/2/2,0,0) | |
370 | end | |
371 | NewSound("http://www.roblox.com/Asset/?id=13510352",2,10,Handle) | |
372 | for i = 1,10 do wait() | |
373 | ArmWeldR.C0 = ArmWeldR.C0 * CFrame.Angles(-math.pi/10/2,math.pi/11/2/2,-math.pi/10/2/2) | |
374 | ArmWeldR.C0 = ArmWeldR.C0 - Vector3.new(0.1,0.05,-0.05) | |
375 | end | |
376 | for i = 1,10 do wait() | |
377 | - | Ammo = 2 |
377 | + | |
378 | ArmWeld.C0 = ArmWeld.C0 * CFrame.Angles(0,0,math.pi/10/2/2/2) | |
379 | ArmWeld.C0 = ArmWeld.C0 - Vector3.new(-0.05,0,0.09) | |
380 | end | |
381 | ArmWeldR.C0 = CFrame.new(-1.5,0,0) * CFrame.fromEulerAnglesXYZ(0,0,0) | |
382 | NewSound("http://www.roblox.com/Asset/?id=10209881",10,0.9,Handle) | |
383 | for i = 1,5 do wait() | |
384 | WeldQ.C0 = WeldQ.C0 * CFrame.Angles(0,-math.pi/5/2/2,0) | |
385 | ArmWeld.C0 = ArmWeld.C0 * CFrame.new(0,0,-0.1) * CFrame.Angles(math.pi/5/2/2,0,0) | |
386 | end | |
387 | for i = 1,10 do wait() | |
388 | ArmWeld.C0 = ArmWeld.C0 * CFrame.Angles(-math.pi/10/2/2,0,0) * CFrame.new(0,0,0.05) | |
389 | end | |
390 | ArmWeld.C0 = CFrame.new(1.5,0.5,-0.5) * CFrame.fromEulerAnglesXYZ(math.pi/2,0,0) | |
391 | Ammo = 6 | |
392 | TName() | |
393 | if Head == true then SuicideYes() end | |
394 | if Arms == true then ArmsOn() end | |
395 | elseif Ammo ~= 0 then | |
396 | if Arms == false then ArmsOn() end | |
397 | wait(0.1) | |
398 | NewSound("http://www.roblox.com/Asset/?id=10209881",10,1,Handle) | |
399 | for i = 1,10 do wait() | |
400 | ArmWeldR.C0 = ArmWeldR.C0 - Vector3.new(0,0,0.1) | |
401 | end | |
402 | --Ammo = Ammo - 1 | |
403 | - | Ammo = 2 |
403 | + | |
404 | for i = 1,10 do wait() | |
405 | ArmWeldR.C0 = ArmWeldR.C0 + Vector3.new(0,0,0.1) | |
406 | end | |
407 | if Arms == false then ArmsOff() end | |
408 | end | |
409 | end | |
410 | ||
411 | function Shoot() | |
412 | NewSound("http://www.roblox.com/Asset/?id=2691586",10,1,Handle) | |
413 | if Arms == false then | |
414 | for i = 1,5 do wait() | |
415 | ArmWeld.C0 = ArmWeld.C0 * CFrame.new(0,0,-0.1) * CFrame.Angles(math.pi/5/2/2,0,0) | |
416 | WeldA.C0 = WeldA.C0 * CFrame.Angles(0.2,0,0) | |
417 | end | |
418 | for i = 1,10 do wait() | |
419 | ArmWeld.C0 = ArmWeld.C0 * CFrame.Angles(-math.pi/10/2/2,0,0) * CFrame.new(0,0,0.05) | |
420 | WeldA.C0 = WeldA.C0 * CFrame.Angles(-0.1,0,0) | |
421 | end | |
422 | if Arms == false then ArmsOn() end | |
423 | wait(0.05) | |
424 | NewSound("http://www.roblox.com/Asset/?id=10209881",10,1,Handle) | |
425 | for i = 1,5 do wait() | |
426 | ArmWeldR.C0 = ArmWeldR.C0 - Vector3.new(0,0,0.2) | |
427 | end | |
428 | Ammo = Ammo - 1 TName() | |
429 | wait(0.1) | |
430 | for i = 1,5 do wait() | |
431 | ArmWeldR.C0 = ArmWeldR.C0 + Vector3.new(0,0,0.2) | |
432 | end | |
433 | if Arms == false then ArmsOff() end | |
434 | elseif Arms == true then | |
435 | for i = 1,5 do wait() | |
436 | ArmWeldR.C0 = ArmWeldR.C0 * CFrame.Angles(math.pi/4/2/2/2,0,0) | |
437 | ArmWeldR.C0 = ArmWeldR.C0 + Vector3.new(0,0.2,0) | |
438 | ArmWeld.C0 = ArmWeld.C0 * CFrame.new(0,0,-0.1) * CFrame.Angles(math.pi/5/2/2,0,0) | |
439 | WeldA.C0 = WeldA.C0 * CFrame.Angles(0.2,0,0) | |
440 | end | |
441 | for i = 1,10 do wait() | |
442 | ArmWeldR.C0 = ArmWeldR.C0 * CFrame.Angles(-math.pi/8/2/2/2,0,0) | |
443 | ArmWeldR.C0 = ArmWeldR.C0 - Vector3.new(0,0.1,0) | |
444 | ArmWeld.C0 = ArmWeld.C0 * CFrame.Angles(-math.pi/10/2/2,0,0) * CFrame.new(0,0,0.05) | |
445 | WeldA.C0 = WeldA.C0 * CFrame.Angles(-0.1,0,0) | |
446 | end | |
447 | NewSound("http://www.roblox.com/Asset/?id=10209881",10,1,Handle) | |
448 | for i = 1,5 do wait() | |
449 | ArmWeldR.C0 = ArmWeldR.C0 - Vector3.new(0,0,0.2) | |
450 | end | |
451 | Ammo = Ammo - 1 TName() | |
452 | wait(0.1) | |
453 | for i = 1,5 do wait() | |
454 | ArmWeldR.C0 = ArmWeldR.C0 + Vector3.new(0,0,0.2) | |
455 | end | |
456 | end | |
457 | end | |
458 | ||
459 | --[[ * Sound * ]]-- | |
460 | ||
461 | function NewSound(ID,V,P,N) | |
462 | coroutine.resume(coroutine.create(function() | |
463 | local SoundD = Instance.new("Sound") | |
464 | SoundD.SoundId = ID | |
465 | SoundD.Volume = V | |
466 | SoundD.Pitch = P | |
467 | SoundD.Parent = N | |
468 | SoundD:Play() | |
469 | while SoundD.IsPlaying do wait() end | |
470 | SoundD:Remove() | |
471 | end)) | |
472 | end | |
473 | ||
474 | function NewSoundI(ID,V,P,N,I) | |
475 | coroutine.resume(coroutine.create(function() | |
476 | local SoundD = Instance.new("Sound") | |
477 | SoundD.SoundId = ID | |
478 | SoundD.Volume = V | |
479 | SoundD.Pitch = P | |
480 | SoundD.Parent = N | |
481 | SoundD:Play() | |
482 | wait(I) | |
483 | SoundD:Stop() | |
484 | wait() | |
485 | SoundD:Remove() | |
486 | end)) | |
487 | end | |
488 | ||
489 | --[[ * Tool * ]]-- | |
490 | ||
491 | if script.Parent.Name == Player.Name then | |
492 | Hopper = Instance.new("HopperBin") | |
493 | Hopper.Name = "Shotgun" | |
494 | Hopper.Parent = Player.Backpack | |
495 | end | |
496 | ||
497 | Blah = true | |
498 | ABC = BarrelA.CFrame | |
499 | ||
500 | function Clicked(Mouse) | |
501 | if Blah == true then | |
502 | Blah = false | |
503 | if Ammo == 0 then | |
504 | Reload() | |
505 | - | Hopper.Name = "Gun" |
505 | + | |
506 | if Head == true then Character.Head:BreakJoints() return end | |
507 | coroutine.resume(coroutine.create(function() | |
508 | Mouse.Target:BreakJoints() | |
509 | end)) | |
510 | Shoot() | |
511 | end | |
512 | Blah = true | |
513 | return | |
514 | end | |
515 | end | |
516 | ||
517 | function onKeyDown(key) | |
518 | if Blah == true then | |
519 | Blah = false | |
520 | ||
521 | if key == "p" then | |
522 | NewSound("",10,0.5,Handle) | |
523 | end | |
524 | ||
525 | if key == "0" or key == "/" then | |
526 | if not Head then | |
527 | if Arms == false then | |
528 | ArmsOn() | |
529 | Arms = true | |
530 | elseif Arms == true then | |
531 | ArmsOff() | |
532 | Arms = false | |
533 | end | |
534 | end | |
535 | end | |
536 | ||
537 | if key == "" then | |
538 | if not Head then | |
539 | if Arms then ArmsOff() Arms = false end | |
540 | SuicideYes() | |
541 | Head = true | |
542 | elseif Head then | |
543 | SuicideNo() | |
544 | if Arms then ArmsOn() end | |
545 | Head = false | |
546 | end | |
547 | end | |
548 | ||
549 | if key == "r" then | |
550 | Reload() | |
551 | end | |
552 | ||
553 | Blah = true | |
554 | return | |
555 | end | |
556 | end | |
557 | ||
558 | function Selected(Mouse) | |
559 | Mouse.Icon = "rbxasset://textures\\GunCursor.png" | |
560 | Mouse.KeyDown:connect(onKeyDown) | |
561 | Mouse.Button1Down:connect(function()Clicked(Mouse)end) | |
562 | TName() | |
563 | if Blah then | |
564 | Blah = false | |
565 | if not Arms then | |
566 | ArmsOn() | |
567 | Arms = true | |
568 | end | |
569 | Blah = true | |
570 | end | |
571 | end | |
572 | ||
573 | function Deselected(Mouse) | |
574 | if Blah then | |
575 | Blah = false | |
576 | if Arms then | |
577 | ArmsOff() | |
578 | Arms = false | |
579 | end | |
580 | Blah = true | |
581 | end | |
582 | end | |
583 | ||
584 | function Dead() | |
585 | for i,v in pairs(Character:GetChildren()) do | |
586 | pcall(function() v.Anchored = true end) | |
587 | if v.Name == "Head" then v.Anchored = false v.Velocity = Vector3.new(10,0,10) end | |
588 | for i,a in pairs(v:GetChildren()) do pcall(function() a.Anchored = true end) end | |
589 | end | |
590 | end | |
591 | ||
592 | Character.Humanoid.Died:connect(Dead) | |
593 | Hopper.Selected:connect(Selected) | |
594 | Hopper.Deselected:connect(Deselected) |