SHOW:
|
|
- or go back to the newest paste.
1 | ||
2 | ||
3 | --[[ | |
4 | Tf2 Engineer Class | |
5 | -------------------- | |
6 | Script by: 123jl123 | |
7 | --------------------- | |
8 | Sentry by: Madiik | |
9 | -- ]] | |
10 | ||
11 | ||
12 | local plr = game:service'Players'.LocalPlayer | |
13 | local char = plr.Character | |
14 | local mouse = plr:GetMouse() | |
15 | local humanoid = char:findFirstChild("Humanoid") | |
16 | local torso = char:findFirstChild("Torso") | |
17 | local head = char.Head | |
18 | local ra = char:findFirstChild("Right Arm") | |
19 | local la = char:findFirstChild("Left Arm") | |
20 | local rl = char:findFirstChild("Right Leg") | |
21 | local ll = char:findFirstChild("Left Leg") | |
22 | local rs = torso:findFirstChild("Right Shoulder") | |
23 | local ls = torso:findFirstChild("Left Shoulder") | |
24 | local rh = torso:findFirstChild("Right Hip") | |
25 | local lh = torso:findFirstChild("Left Hip") | |
26 | local neck = torso:findFirstChild("Neck") | |
27 | local rj = char:findFirstChild("HumanoidRootPart"):findFirstChild("RootJoint") | |
28 | local rootpart = char:findFirstChild("HumanoidRootPart") | |
29 | local camera = workspace.CurrentCamera | |
30 | local anim = char:findFirstChild("Animate") | |
31 | DA = false | |
32 | NoSentry = true | |
33 | maincolor = game.Players.LocalPlayer.Character.Torso.BrickColor.Name | |
34 | secondcolor = "Really black" | |
35 | WSHM = {'10209908','10209905','10209905','10209908'} | |
36 | WSH = WSHM[math.random(1,#WSHM)] | |
37 | wait(1 / 60) | |
38 | Effects = { } | |
39 | local Player = game.Players.localPlayer | |
40 | local Character = Player.Character | |
41 | local Humanoid = Character.Humanoid | |
42 | local mouse = Player:GetMouse() | |
43 | local LeftArm = Character["Left Arm"] | |
44 | local RightArm = Character["Right Arm"] | |
45 | local LeftLeg = Character["Left Leg"] | |
46 | local RightLeg = Character["Right Leg"] | |
47 | local Head = Character.Head | |
48 | local Torso = Character.Torso | |
49 | local cam = game.Workspace.CurrentCamera | |
50 | local RootPart = Character.HumanoidRootPart | |
51 | local RootJoint = RootPart.RootJoint | |
52 | local equipped = false | |
53 | local attack = false | |
54 | local Anim = 'Idle' | |
55 | local idle = 0 | |
56 | local attacktype = 1 | |
57 | local Torsovelocity = (RootPart.Velocity * Vector3.new(1, 0, 1)).magnitude | |
58 | local velocity = RootPart.Velocity.y | |
59 | local sine = 0 | |
60 | local change = 1 | |
61 | local grabbed = false | |
62 | local cn = CFrame.new | |
63 | local mr = math.rad | |
64 | local angles = CFrame.Angles | |
65 | local ud = UDim2.new | |
66 | local c3 = Color3.new | |
67 | local slashDamage = 15 | |
68 | trans = 1 | |
69 | for i,v in pairs(char:GetChildren()) do if v:IsA("Accessory") then v:Remove() end end | |
70 | for i,v in pairs(char:GetChildren()) do if v:IsA("Hat") then v:Remove() end end | |
71 | Wep = 1 | |
72 | equippedgun2 = false | |
73 | ||
74 | ||
75 | ||
76 | ||
77 | ||
78 | ||
79 | ||
80 | ||
81 | ||
82 | ||
83 | --SB Plasma Shotgun 2013 | |
84 | ||
85 | --madiik's plasma shottie | |
86 | ||
87 | --variables | |
88 | ||
89 | ||
90 | ||
91 | --some more variables | |
92 | ||
93 | local spread = 1 | |
94 | -- end of some more variables | |
95 | ||
96 | local sound = Instance.new("Sound",head) | |
97 | sound.SoundId = "http://www.roblox.com/asset?id=10209842" | |
98 | sound.Volume = 2 | |
99 | sound.Pitch = 1 | |
100 | ||
101 | ||
102 | ||
103 | ||
104 | ||
105 | ||
106 | ||
107 | local sound2 = Instance.new("Sound",head) | |
108 | sound2.SoundId = "http://www.roblox.com/asset?id=10209881" | |
109 | sound2.Volume = 1 | |
110 | sound2.Pitch = 1 | |
111 | ||
112 | ||
113 | ||
114 | ||
115 | ||
116 | ||
117 | ||
118 | function attach(weld, part0, part1) | |
119 | weld.Part0 = part0 | |
120 | weld.Part1 = part1 | |
121 | end | |
122 | ||
123 | ||
124 | ||
125 | ||
126 | ||
127 | ||
128 | ||
129 | ||
130 | ||
131 | --create func | |
132 | function part(parent, size, color, formfactor, collide, transparency) | |
133 | if transparency == nil then transparency = 0 end | |
134 | if collide == nil then collide = false end | |
135 | if formfactor == nil then formfactor = Enum.FormFactor.Custom end | |
136 | local p=Instance.new("Part", parent) | |
137 | p.FormFactor=formfactor | |
138 | p.CanCollide=false | |
139 | p.Size=size | |
140 | p.Locked=true | |
141 | p.Transparency=transparency | |
142 | p.Position=torso.Position | |
143 | p.BrickColor=color | |
144 | p.FrontSurface="SmoothNoOutlines" | |
145 | p.BackSurface="SmoothNoOutlines" | |
146 | p.LeftSurface="SmoothNoOutlines" | |
147 | p.BottomSurface="SmoothNoOutlines" | |
148 | p.TopSurface="SmoothNoOutlines" | |
149 | p.RightSurface="SmoothNoOutlines" | |
150 | return p | |
151 | end | |
152 | function wedge(parent, size, color, formfactor, collide, transparency) | |
153 | ||
154 | if transparency == nil then transparency = 0 end | |
155 | if collide == nil then collide = false end | |
156 | if formfactor == nil then formfactor = Enum.FormFactor.Custom end | |
157 | ||
158 | local p=Instance.new("WedgePart", parent) | |
159 | p.FormFactor=formfactor | |
160 | p.CanCollide=false | |
161 | p.Size=size | |
162 | p.Locked=true | |
163 | p.Position = torso.Position | |
164 | p.BrickColor=color | |
165 | p.FrontSurface="SmoothNoOutlines" | |
166 | p.BackSurface="SmoothNoOutlines" | |
167 | p.LeftSurface="SmoothNoOutlines" | |
168 | p.BottomSurface="SmoothNoOutlines" | |
169 | p.TopSurface="SmoothNoOutlines" | |
170 | p.RightSurface="SmoothNoOutlines" | |
171 | return p | |
172 | end | |
173 | function weld(part0, part1, c0, parent, c1) | |
174 | if parent == nil then parent = gun end | |
175 | if c1 == nil then c1 = CFrame.new() end | |
176 | ||
177 | local wel=Instance.new("Weld", parent) | |
178 | wel.Part0 = part0 | |
179 | wel.Part1 = part1 | |
180 | wel.C0 = c0 | |
181 | wel.C1 = c1 | |
182 | return wel | |
183 | end | |
184 | function specialmesh(parent, meshType, scale, meshId) | |
185 | local mesh = Instance.new("SpecialMesh", parent) | |
186 | mesh.Scale = scale | |
187 | mesh.MeshType = meshType | |
188 | mesh.MeshId = meshId | |
189 | return mesh | |
190 | end | |
191 | ||
192 | ||
193 | --some ray functi0n | |
194 | ||
195 | function rayCast2(speed, gravity, from) | |
196 | coroutine.wrap(function() | |
197 | if char.Humanoid.Health == 0 then return end | |
198 | local rayP = Instance.new("Part") | |
199 | rayP.Name = "rayP" | |
200 | rayP.BrickColor = BrickColor.new("New Yeller") | |
201 | rayP.Material = 'Neon' | |
202 | rayP.Anchored = true | |
203 | rayP.CanCollide = false | |
204 | rayP.Locked = true | |
205 | rayP.TopSurface = Enum.SurfaceType.Smooth | |
206 | rayP.BottomSurface = Enum.SurfaceType.Smooth | |
207 | rayP.formFactor = Enum.FormFactor.Custom | |
208 | rayP.Size = Vector3.new(0.2, 0.2, 0.2) | |
209 | ||
210 | ||
211 | ||
212 | Instance.new("BlockMesh", rayP).Scale = Vector3.new(0.2, 0.2, 10) | |
213 | ||
214 | ||
215 | ||
216 | ||
217 | ||
218 | ||
219 | ||
220 | ||
221 | local bulletposition = from.Position + Vector3.new(0, 0.3, 0) | |
222 | ||
223 | local bulletvelocity = (Vector3.new(math.random(-spread*4,spread*4), math.random(-spread*4,spread*4), math.random(-spread*4,spread*4)))+( plr:GetMouse().Hit.p - bulletposition).unit*speed | |
224 | local bulletlastposition = bulletposition | |
225 | ||
226 | ||
227 | ||
228 | ||
229 | coroutine.resume(coroutine.create(function() | |
230 | while true do | |
231 | local dt = wait() | |
232 | bulletlastposition = bulletposition | |
233 | bulletvelocity = bulletvelocity + (Vector3.new(0, -14.81*gravity, 0)*dt) | |
234 | bulletposition = bulletposition + (bulletvelocity*dt) | |
235 | ||
236 | local ray = Ray.new(bulletlastposition, (bulletposition - bulletlastposition)) | |
237 | ||
238 | local hit, hitposition = workspace:FindPartOnRayWithIgnoreList( ray, { char, rayP, TrailPart} ) | |
239 | ||
240 | if (torso.Position - rayP.Position).magnitude > 540 then | |
241 | rayP:Destroy() | |
242 | break | |
243 | end | |
244 | ||
245 | ||
246 | if hit then | |
247 | local damage = math.random(10, 20) | |
248 | if hit.Parent:findFirstChild("Humanoid") ~= nil then | |
249 | hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - damage | |
250 | end | |
251 | if hit.Parent:IsA("Hat") and hit.Parent.Parent:findFirstChild("Humanoid") ~= nil then | |
252 | hit.Parent.Parent.Humanoid.Health = hit.Parent.Parent.Humanoid.Health - damage | |
253 | end | |
254 | bulletposition = hitposition | |
255 | rayP.CFrame = CFrame.new(bulletposition, bulletposition+bulletvelocity) | |
256 | rayP:Destroy() | |
257 | break | |
258 | end | |
259 | rayP.CFrame = CFrame.new(bulletposition, bulletposition+bulletvelocity) | |
260 | rayP.Parent = workspace | |
261 | end | |
262 | end)) | |
263 | end)() | |
264 | end | |
265 | ||
266 | ||
267 | ||
268 | ||
269 | ||
270 | ||
271 | ||
272 | --function attach(weld, part0, part1) | |
273 | --weld.Part0 = part0 | |
274 | --weld.Part1 = part1 | |
275 | --end | |
276 | ||
277 | ||
278 | ||
279 | ||
280 | ||
281 | ||
282 | ||
283 | ||
284 | ||
285 | ||
286 | ||
287 | ||
288 | ||
289 | ||
290 | ||
291 | ||
292 | ||
293 | ||
294 | ||
295 | ||
296 | ||
297 | ||
298 | ||
299 | ||
300 | ||
301 | ||
302 | ||
303 | TmRed = false | |
304 | TmBlue = false | |
305 | TeamColor = BrickColor.new("Really Black") | |
306 | ||
307 | local BC = char["Body Colors"] | |
308 | BC.HeadColor = BrickColor.new("Pastel brown") | |
309 | BC.LeftArmColor = BrickColor.new("Pastel brown") | |
310 | BC.LeftLegColor = BrickColor.new("Pastel brown") | |
311 | BC.RightArmColor = BrickColor.new("Pastel brown") | |
312 | BC.RightLegColor = BrickColor.new("Pastel brown") | |
313 | BC.TorsoColor = BrickColor.new("Pastel brown") | |
314 | ||
315 | ||
316 | New = function(Object, Parent, Name, Data) | |
317 | local Object = Instance.new(Object) | |
318 | for Index, Value in pairs(Data or {}) do | |
319 | Object[Index] = Value | |
320 | end | |
321 | Object.Parent = Parent | |
322 | Object.Name = Name | |
323 | return Object | |
324 | end | |
325 | local AddInstance = function(Object, ...) | |
326 | local Obj = Instance.new(Object) | |
327 | for i,v in next,(...) do | |
328 | Obj[i] = v | |
329 | end | |
330 | return Obj | |
331 | end | |
332 | ||
333 | ||
334 | ||
335 | ||
336 | ||
337 | Team=function() | |
338 | ||
339 | local r=math.random(1,2) | |
340 | if r==1 then | |
341 | print('RED') | |
342 | script.Name = "TeamRed" | |
343 | TmRed = true | |
344 | for i,v in pairs(char:GetChildren()) do if v:IsA("Shirt") then v:Remove() end end | |
345 | for i,v in pairs(char:GetChildren()) do if v:IsA("Pants") then v:Remove() end end | |
346 | wait()shirt = Instance.new("Shirt", char) | |
347 | shirt.Name = "Shirt" | |
348 | pants = Instance.new("Pants", char) | |
349 | pants.Name = "Pants" | |
350 | char.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=69232230" | |
351 | char.Pants.PantsTemplate = "http://www.roblox.com/asset/?id=69232580" | |
352 | TeamColor = BrickColor.new("Bright red") | |
353 | end | |
354 | ||
355 | if r==2 then | |
356 | print('BLUE') | |
357 | TmBlue = true | |
358 | script.Name = "TeamBlue" | |
359 | for i,v in pairs(char:GetChildren()) do if v:IsA("Shirt") then v:Remove() end end | |
360 | for i,v in pairs(char:GetChildren()) do if v:IsA("Pants") then v:Remove() end end | |
361 | wait()shirt = Instance.new("Shirt", char) | |
362 | shirt.Name = "Shirt" | |
363 | pants = Instance.new("Pants", char) | |
364 | pants.Name = "Pants" | |
365 | char.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=69232247" | |
366 | char.Pants.PantsTemplate = "http://www.roblox.com/asset/?id=69232594" | |
367 | TeamColor = BrickColor.new("Bright blue") | |
368 | end | |
369 | print(''..r) | |
370 | end | |
371 | ||
372 | Team() | |
373 | ||
374 | ||
375 | ||
376 | local MusThingHat = AddInstance("Part",{ | |
377 | Parent = head, | |
378 | CFrame = head.CFrame, | |
379 | formFactor = "Symmetric", | |
380 | Size = Vector3.new(1, 1, 1), | |
381 | CanCollide = false, | |
382 | TopSurface = "Smooth", | |
383 | BottomSurface = "Smooth", | |
384 | Locked = true, | |
385 | BrickColor=BrickColor.new("Br. yellowish orange"), | |
386 | Transparency = 1, | |
387 | }) | |
388 | local Weld = AddInstance("Weld",{ | |
389 | Parent = MusThingHat, | |
390 | Part0 = head, | |
391 | C0 = CFrame.new(0,0.5,0)*CFrame.Angles(0,0,0), | |
392 | Part1 = MusThingHat, | |
393 | }) | |
394 | local Mesh = AddInstance("SpecialMesh",{ | |
395 | Parent = MusThingHat, | |
396 | ||
397 | Scale = Vector3.new(.1,0,.1), | |
398 | ||
399 | }) | |
400 | ||
401 | local Reaper = AddInstance("Part",{ | |
402 | Parent = head, | |
403 | CFrame = head.CFrame, | |
404 | formFactor = "Symmetric", | |
405 | Size = Vector3.new(1, 1, 1), | |
406 | CanCollide = false, | |
407 | TopSurface = "Smooth", | |
408 | BottomSurface = "Smooth", | |
409 | Locked = true, | |
410 | BrickColor=BrickColor.new("Br. yellowish orange"), | |
411 | }) | |
412 | local Weld = AddInstance("Weld",{ | |
413 | Parent = Reaper, | |
414 | Part0 = head, | |
415 | C0 = CFrame.new(-.04,.7,-.1)*CFrame.Angles(0,0,.08), | |
416 | Part1 = Reaper, | |
417 | }) | |
418 | local Mesh = AddInstance("SpecialMesh",{ | |
419 | Parent = Reaper, | |
420 | MeshId = "rbxassetid://1073659", | |
421 | Scale = Vector3.new(1.06,1.05,1.06), | |
422 | VertexColor = Vector3.new(1,1,1), | |
423 | }) | |
424 | ||
425 | local Helmpart2 = AddInstance("Part",{ | |
426 | Parent = head, | |
427 | CFrame = head.CFrame, | |
428 | formFactor = "Symmetric", | |
429 | Size = Vector3.new(1, 1, 1), | |
430 | CanCollide = false, | |
431 | TopSurface = "Smooth", | |
432 | BottomSurface = "Smooth", | |
433 | Locked = true, | |
434 | BrickColor=BrickColor.new("White"), | |
435 | }) | |
436 | local Weld = AddInstance("Weld",{ | |
437 | Parent = Helmpart2, | |
438 | Part0 = head, | |
439 | C0 = CFrame.new(.01,.4,.05)*CFrame.Angles(.1,0,-.02), | |
440 | Part1 = Helmpart2, | |
441 | }) | |
442 | local Mesh = AddInstance("SpecialMesh",{ | |
443 | Parent = Helmpart2, | |
444 | Scale = Vector3.new(1.28,.48,1.28), | |
445 | VertexColor = Vector3.new(1,1,1), | |
446 | }) | |
447 | ||
448 | ||
449 | local Glassespart2 = AddInstance("Part",{ | |
450 | Parent = head, | |
451 | CFrame = head.CFrame, | |
452 | formFactor = "Symmetric", | |
453 | Size = Vector3.new(1, 1, 1), | |
454 | CanCollide = false, | |
455 | TopSurface = "Smooth", | |
456 | BottomSurface = "Smooth", | |
457 | Locked = true, | |
458 | BrickColor=BrickColor.new("Really black"), | |
459 | }) | |
460 | local Weld = AddInstance("Weld",{ | |
461 | Parent = Glassespart2, | |
462 | Part0 = head, | |
463 | C0 = CFrame.new(0,.35,0)*CFrame.Angles(0,0,0), | |
464 | Part1 = Glassespart2, | |
465 | }) | |
466 | local Mesh = AddInstance("SpecialMesh",{ | |
467 | Parent = Glassespart2, | |
468 | Scale = Vector3.new(1.27,.5,1.27), | |
469 | VertexColor = Vector3.new(1,1,1), | |
470 | }) | |
471 | ||
472 | ||
473 | ||
474 | ||
475 | ||
476 | ||
477 | ||
478 | ||
479 | local Reaper3 = AddInstance("Part",{ | |
480 | Parent = head, | |
481 | CFrame = head.CFrame, | |
482 | formFactor = "Symmetric", | |
483 | Size = Vector3.new(1, 1, 1), | |
484 | CanCollide = false, | |
485 | TopSurface = "Smooth", | |
486 | BottomSurface = "Smooth", | |
487 | Locked = true, | |
488 | BrickColor=BrickColor.new("Gold"), | |
489 | }) | |
490 | local Weld = AddInstance("Weld",{ | |
491 | Parent = Reaper3, | |
492 | Part0 = head, | |
493 | C0 = CFrame.new(0,.3,-0.02)*CFrame.Angles(-.1,0,0), | |
494 | Part1 = Reaper3, | |
495 | }) | |
496 | local Mesh = AddInstance("SpecialMesh",{ | |
497 | Parent = Reaper3, | |
498 | MeshId = "rbxassetid://19380122", | |
499 | TextureId = "rbxassetid://19380117", | |
500 | Scale = Vector3.new(.9,1,1), | |
501 | VertexColor = Vector3.new(1,1,1), | |
502 | }) | |
503 | ||
504 | ||
505 | ||
506 | ||
507 | ||
508 | ||
509 | ||
510 | local Reaper4 = AddInstance("Part",{ | |
511 | Parent = RightArm, | |
512 | CFrame = RightArm.CFrame, | |
513 | formFactor = "Symmetric", | |
514 | Size = Vector3.new(0.1, 0.5, 3), | |
515 | CanCollide = false, | |
516 | TopSurface = "Smooth", | |
517 | BottomSurface = "Smooth", | |
518 | Locked = true, | |
519 | Transparency = 0 | |
520 | }) | |
521 | local Weld = AddInstance("Weld",{ | |
522 | Parent = Reaper4, | |
523 | Part0 = RightArm, | |
524 | C0 = CFrame.new(-0.35,-1.8,-0.4)*CFrame.Angles(4.7,3.4,0), | |
525 | Part1 = Reaper4, | |
526 | }) | |
527 | local Mesh = AddInstance("SpecialMesh",{ | |
528 | Parent = Reaper4, | |
529 | MeshId = "rbxassetid://470533002", | |
530 | TextureId = "rbxassetid://470533004", | |
531 | Scale = Vector3.new(.03,.03,.03), | |
532 | VertexColor = Vector3.new(1,1,1), | |
533 | }) | |
534 | ||
535 | local GunFire = AddInstance("Part",{ | |
536 | Parent = RightArm, | |
537 | CFrame = RightArm.CFrame, | |
538 | formFactor = "Symmetric", | |
539 | Size = Vector3.new(0.1, 0.1, 0.1), | |
540 | CanCollide = false, | |
541 | TopSurface = "Smooth", | |
542 | BottomSurface = "Smooth", | |
543 | Locked = true, | |
544 | Transparency = 1 | |
545 | }) | |
546 | local Weld = AddInstance("Weld",{ | |
547 | Parent = GunFire, | |
548 | Part0 = RightArm, | |
549 | C0 = CFrame.new(-0.8,-3.5,-0.7)*CFrame.Angles(4.7,3.4,0), | |
550 | Part1 = GunFire, | |
551 | }) | |
552 | ||
553 | ||
554 | local GunParticle = Instance.new("ParticleEmitter", GunFire); | |
555 | GunParticle.VelocitySpread = 60; | |
556 | GunParticle.LightEmission = 200; | |
557 | ||
558 | local Colors2 = {Color3.new(1,.5,0), Color3.new(1,.7,0), Color3.new(1,.9,0);} | |
559 | GunParticle.Size = NumberSequence.new(.05,.07); | |
560 | ||
561 | GunParticle.Color = ColorSequence.new(Colors2[math.random(#Colors2)]); | |
562 | GunParticle.Texture = "rbxassetid://252350680"; | |
563 | GunParticle.RotSpeed = NumberRange.new(10,70); | |
564 | GunParticle.Rate = 600; | |
565 | GunParticle.Speed = NumberRange.new(15); | |
566 | GunParticle.Transparency = NumberSequence.new(0,1); | |
567 | GunParticle.Lifetime = NumberRange.new(.01,.2); | |
568 | GunParticle.EmissionDirection = 'Back' | |
569 | GunParticle.Enabled = false | |
570 | ||
571 | ||
572 | ||
573 | ||
574 | ||
575 | ||
576 | ||
577 | ||
578 | local Reaper5 = AddInstance("Part",{ | |
579 | Parent = RightArm, | |
580 | CFrame = RightArm.CFrame, | |
581 | formFactor = "Symmetric", | |
582 | Size = Vector3.new(0.1, 0.5, 3), | |
583 | CanCollide = false, | |
584 | TopSurface = "Smooth", | |
585 | BottomSurface = "Smooth", | |
586 | Locked = true, | |
587 | Transparency = 1 | |
588 | }) | |
589 | local Weld = AddInstance("Weld",{ | |
590 | Parent = Reaper5, | |
591 | Part0 = RightArm, | |
592 | C0 = CFrame.new(-.1,-0.75,-.7)*CFrame.Angles(1.5,0,3), | |
593 | Part1 = Reaper5, | |
594 | }) | |
595 | local Mesh = AddInstance("SpecialMesh",{ | |
596 | Parent = Reaper5, | |
597 | MeshId = "rbxassetid://431003868", | |
598 | TextureId = "rbxassetid://430627740", | |
599 | Scale = Vector3.new(1.93,1.99,1.99), | |
600 | VertexColor = Vector3.new(1,1,1), | |
601 | }) | |
602 | ||
603 | ||
604 | ||
605 | local Arms = AddInstance("Model",{ | |
606 | Parent = cam, | |
607 | Name = "Arms", | |
608 | ||
609 | ||
610 | }) | |
611 | ||
612 | local Arm1 = AddInstance("Part",{ | |
613 | Parent = Arms, | |
614 | Name = "RightArm", | |
615 | CFrame = RightArm.CFrame, | |
616 | formFactor = "Symmetric", | |
617 | Size = Vector3.new(.85,1.85,.85), | |
618 | CanCollide = false, | |
619 | Material = "SmoothPlastic", | |
620 | TopSurface = "Smooth", | |
621 | BottomSurface = "Smooth", | |
622 | Locked = true, | |
623 | BrickColor=BrickColor.new("Pastel brown"), | |
624 | Transparency = 0 | |
625 | }) | |
626 | local Weld = AddInstance("Weld",{ | |
627 | Parent = Arm1, | |
628 | Part0 = RightArm, | |
629 | C0 = CFrame.new(0,0,0)*CFrame.Angles(0,0,0), | |
630 | Part1 = Arm1, | |
631 | }) | |
632 | ||
633 | local Arm2 = AddInstance("Part",{ | |
634 | Parent = Arms, | |
635 | Name = "LeftArm", | |
636 | CFrame = LeftArm.CFrame, | |
637 | formFactor = "Symmetric", | |
638 | Size = Vector3.new(.85,1.85,.85), | |
639 | CanCollide = false, | |
640 | Material = "SmoothPlastic", | |
641 | TopSurface = "Smooth", | |
642 | BottomSurface = "Smooth", | |
643 | Locked = true, | |
644 | BrickColor=BrickColor.new("Pastel brown"), | |
645 | Transparency = 0 | |
646 | }) | |
647 | local Weld = AddInstance("Weld",{ | |
648 | Parent = Arm2, | |
649 | Part0 = LeftArm, | |
650 | C0 = CFrame.new(0,0,0)*CFrame.Angles(0,0,0), | |
651 | Part1 = Arm2, | |
652 | }) | |
653 | ||
654 | ||
655 | ||
656 | ||
657 | local Arm3 = AddInstance("Part",{ | |
658 | Parent = Arms, | |
659 | Name = "RightArm", | |
660 | CFrame = RightArm.CFrame, | |
661 | formFactor = "Symmetric", | |
662 | Size = Vector3.new(.9,.9,.9), | |
663 | CanCollide = false, | |
664 | Material = "SmoothPlastic", | |
665 | TopSurface = "Smooth", | |
666 | BottomSurface = "Smooth", | |
667 | Locked = true, | |
668 | BrickColor=TeamColor, | |
669 | Transparency = 0 | |
670 | }) | |
671 | local Weld = AddInstance("Weld",{ | |
672 | Parent = Arm3, | |
673 | Part0 = RightArm, | |
674 | C0 = CFrame.new(0,.5,0)*CFrame.Angles(0,0,0), | |
675 | Part1 = Arm3, | |
676 | }) | |
677 | ||
678 | local Arm4 = AddInstance("Part",{ | |
679 | Parent = Arms, | |
680 | Name = "LeftArm", | |
681 | CFrame = LeftArm.CFrame, | |
682 | formFactor = "Symmetric", | |
683 | Size = Vector3.new(.9,.9,.9), | |
684 | CanCollide = false, | |
685 | Material = "SmoothPlastic", | |
686 | TopSurface = "Smooth", | |
687 | BottomSurface = "Smooth", | |
688 | Locked = true, | |
689 | BrickColor=TeamColor, | |
690 | Transparency = 0 | |
691 | }) | |
692 | local Weld = AddInstance("Weld",{ | |
693 | Parent = Arm4, | |
694 | Part0 = LeftArm, | |
695 | C0 = CFrame.new(0,.5,0)*CFrame.Angles(0,0,0), | |
696 | Part1 = Arm4, | |
697 | }) | |
698 | local Arm5 = AddInstance("Part",{ | |
699 | Parent = Arms, | |
700 | Name = "RightArm", | |
701 | CFrame = RightArm.CFrame, | |
702 | formFactor = "Symmetric", | |
703 | Size = Vector3.new(.86,.8,.86), | |
704 | CanCollide = false, | |
705 | Material = "SmoothPlastic", | |
706 | TopSurface = "Smooth", | |
707 | BottomSurface = "Smooth", | |
708 | Locked = true, | |
709 | BrickColor=BrickColor.new("Br. yellowish orange"), | |
710 | Transparency = 0 | |
711 | }) | |
712 | local Weld = AddInstance("Weld",{ | |
713 | Parent = Arm5, | |
714 | Part0 = RightArm, | |
715 | C0 = CFrame.new(0,-.55,0)*CFrame.Angles(0,0,0), | |
716 | Part1 = Arm5, | |
717 | }) | |
718 | ||
719 | local Reaper6 = AddInstance("Part",{ | |
720 | Parent = Arms, | |
721 | CFrame = RightArm.CFrame, | |
722 | formFactor = "Symmetric", | |
723 | Size = Vector3.new(0.1, 0.1, .1), | |
724 | CanCollide = false, | |
725 | TopSurface = "Smooth", | |
726 | BottomSurface = "Smooth", | |
727 | Locked = true, | |
728 | Transparency = 1 | |
729 | }) | |
730 | local Weld = AddInstance("Weld",{ | |
731 | Parent = Reaper6, | |
732 | Part0 = RightArm, | |
733 | C0 = CFrame.new(-0.35,-1.8,-0.4)*CFrame.Angles(4.7,3.4,0), | |
734 | Part1 = Reaper6, | |
735 | }) | |
736 | local Mesh = AddInstance("SpecialMesh",{ | |
737 | Parent = Reaper6, | |
738 | MeshId = "rbxassetid://470533002", | |
739 | TextureId = "rbxassetid://470533004", | |
740 | Scale = Vector3.new(.029,.029,.029), | |
741 | VertexColor = Vector3.new(1,1,1), | |
742 | }) | |
743 | ||
744 | ||
745 | ||
746 | ||
747 | ||
748 | ||
749 | ||
750 | ||
751 | ||
752 | ||
753 | ||
754 | ||
755 | ||
756 | local Reaper7 = AddInstance("Part",{ | |
757 | Parent = Arms, | |
758 | CFrame = RightArm.CFrame, | |
759 | formFactor = "Symmetric", | |
760 | Size = Vector3.new(0.1, 0.5, 3), | |
761 | CanCollide = false, | |
762 | TopSurface = "Smooth", | |
763 | BottomSurface = "Smooth", | |
764 | Locked = true, | |
765 | Transparency = 1 | |
766 | }) | |
767 | local Weld = AddInstance("Weld",{ | |
768 | Parent = Reaper7, | |
769 | Part0 = RightArm, | |
770 | C0 = CFrame.new(-.1,-0.75,-.7)*CFrame.Angles(1.5,0,3), | |
771 | Part1 = Reaper7, | |
772 | }) | |
773 | local Mesh = AddInstance("SpecialMesh",{ | |
774 | Parent = Reaper7, | |
775 | MeshId = "rbxassetid://431003868", | |
776 | TextureId = "rbxassetid://430627740", | |
777 | Scale = Vector3.new(1.9,1.98,1.98), | |
778 | VertexColor = Vector3.new(1,1,1), | |
779 | }) | |
780 | ||
781 | ||
782 | head.face.Texture = "http://www.roblox.com/asset/?id=156600391" | |
783 | local NeckCF = cn(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0) | |
784 | Humanoid.Animator:Destroy() | |
785 | Character.Animate:Destroy() | |
786 | ||
787 | local RootCF = CFrame.fromEulerAnglesXYZ(-1.57, 0, 3.14) | |
788 | local RHCF = CFrame.fromEulerAnglesXYZ(0, 1.6, 0) | |
789 | local LHCF = CFrame.fromEulerAnglesXYZ(0, -1.6, 0) | |
790 | ||
791 | ||
792 | RSH, LSH = nil, nil | |
793 | ||
794 | RW = Instance.new("Weld") | |
795 | LW = Instance.new("Weld") | |
796 | ||
797 | RH = Torso["Right Hip"] | |
798 | LH = Torso["Left Hip"] | |
799 | ||
800 | RSH = Torso["Right Shoulder"] | |
801 | LSH = Torso["Left Shoulder"] | |
802 | ||
803 | RSH.Parent = nil | |
804 | LSH.Parent = nil | |
805 | ||
806 | RW.Name = "RW" | |
807 | RW.Part0 = Torso | |
808 | RW.C0 = cn(1.5, 0.5, 0) | |
809 | RW.C1 = cn(0, 0.5, 0) | |
810 | RW.Part1 = RightArm | |
811 | RW.Parent = Torso | |
812 | ||
813 | LW.Name = "LW" | |
814 | LW.Part0 = Torso | |
815 | LW.C0 = cn(-1.5, 0.5, 0) | |
816 | LW.C1 = cn(0, 0.5, 0) | |
817 | LW.Part1 = LeftArm | |
818 | LW.Parent = Torso | |
819 | ||
820 | function clerp(a, b, t) | |
821 | local qa = { | |
822 | QuaternionFromCFrame(a) | |
823 | } | |
824 | local qb = { | |
825 | QuaternionFromCFrame(b) | |
826 | } | |
827 | local ax, ay, az = a.x, a.y, a.z | |
828 | local bx, by, bz = b.x, b.y, b.z | |
829 | local _t = 1 - t | |
830 | return QuaternionToCFrame(_t * ax + t * bx, _t * ay + t * by, _t * az + t * bz, QuaternionSlerp(qa, qb, t)) | |
831 | end | |
832 | ||
833 | function QuaternionFromCFrame(cf) | |
834 | local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components() | |
835 | local trace = m00 + m11 + m22 | |
836 | if trace > 0 then | |
837 | local s = math.sqrt(1 + trace) | |
838 | local recip = 0.5 / s | |
839 | return (m21 - m12) * recip, (m02 - m20) * recip, (m10 - m01) * recip, s * 0.5 | |
840 | else | |
841 | local i = 0 | |
842 | if m11 > m00 then | |
843 | i = 1 | |
844 | end | |
845 | if m22 > (i == 0 and m00 or m11) then | |
846 | i = 2 | |
847 | end | |
848 | if i == 0 then | |
849 | local s = math.sqrt(m00 - m11 - m22 + 1) | |
850 | local recip = 0.5 / s | |
851 | return 0.5 * s, (m10 + m01) * recip, (m20 + m02) * recip, (m21 - m12) * recip | |
852 | elseif i == 1 then | |
853 | local s = math.sqrt(m11 - m22 - m00 + 1) | |
854 | local recip = 0.5 / s | |
855 | return (m01 + m10) * recip, 0.5 * s, (m21 + m12) * recip, (m02 - m20) * recip | |
856 | elseif i == 2 then | |
857 | local s = math.sqrt(m22 - m00 - m11 + 1) | |
858 | local recip = 0.5 / s | |
859 | return (m02 + m20) * recip, (m12 + m21) * recip, 0.5 * s, (m10 - m01) * recip | |
860 | end | |
861 | end | |
862 | end | |
863 | ||
864 | function QuaternionToCFrame(px, py, pz, x, y, z, w) | |
865 | local xs, ys, zs = x + x, y + y, z + z | |
866 | local wx, wy, wz = w * xs, w * ys, w * zs | |
867 | local xx = x * xs | |
868 | local xy = x * ys | |
869 | local xz = x * zs | |
870 | local yy = y * ys | |
871 | local yz = y * zs | |
872 | local zz = z * zs | |
873 | return CFrame.new(px, py, pz, 1 - (yy + zz), xy - wz, xz + wy, xy + wz, 1 - (xx + zz), yz - wx, xz - wy, yz + wx, 1 - (xx + yy)) | |
874 | end | |
875 | ||
876 | function QuaternionSlerp(a, b, t) | |
877 | local cosTheta = a[1] * b[1] + a[2] * b[2] + a[3] * b[3] + a[4] * b[4] | |
878 | local startInterp, finishInterp; | |
879 | if cosTheta >= 0.0001 then | |
880 | if (1 - cosTheta) > 0.0001 then | |
881 | local theta = math.acos(cosTheta) | |
882 | local invSinTheta = 1 / math.sin(theta) | |
883 | startInterp = math.sin((1 - t) * theta) * invSinTheta | |
884 | finishInterp = math.sin(t * theta) * invSinTheta | |
885 | else | |
886 | startInterp = 1 - t | |
887 | finishInterp = t | |
888 | end | |
889 | else | |
890 | if (1 + cosTheta) > 0.0001 then | |
891 | local theta = math.acos(-cosTheta) | |
892 | local invSinTheta = 1 / math.sin(theta) | |
893 | startInterp = math.sin((t - 1) * theta) * invSinTheta | |
894 | finishInterp = math.sin(t * theta) * invSinTheta | |
895 | else | |
896 | startInterp = t - 1 | |
897 | finishInterp = t | |
898 | end | |
899 | end | |
900 | return a[1] * startInterp + b[1] * finishInterp, a[2] * startInterp + b[2] * finishInterp, a[3] * startInterp + b[3] * finishInterp, a[4] * startInterp + b[4] * finishInterp | |
901 | end | |
902 | ||
903 | function swait(num) | |
904 | if num == 0 or num == nil then | |
905 | game:service'RunService'.RenderStepped:wait(0) | |
906 | else | |
907 | for i = 0, num do | |
908 | game:service'RunService'.RenderStepped:wait(0) | |
909 | end | |
910 | end | |
911 | end | |
912 | ||
913 | local RbxUtility = LoadLibrary("RbxUtility") | |
914 | local Create = RbxUtility.Create | |
915 | ||
916 | function RemoveOutlines(part) | |
917 | part.TopSurface, part.BottomSurface, part.LeftSurface, part.RightSurface, part.FrontSurface, part.BackSurface = 10, 10, 10, 10, 10, 10 | |
918 | end | |
919 | ||
920 | function CreatePart(FormFactor, Parent, Material, Reflectance, Transparency, BColor, Name, Size) | |
921 | local Part = Create("Part"){ | |
922 | formFactor = FormFactor, | |
923 | Parent = Parent, | |
924 | Reflectance = Reflectance, | |
925 | Transparency = Transparency, | |
926 | CanCollide = false, | |
927 | Locked = true, | |
928 | BrickColor = BrickColor.new(tostring(BColor)), | |
929 | Name = Name, | |
930 | Size = Size, | |
931 | Material = Material, | |
932 | } | |
933 | RemoveOutlines(Part) | |
934 | return Part | |
935 | end | |
936 | ||
937 | function CreateMesh(Mesh, Part, MeshType, MeshId, OffSet, Scale) | |
938 | local Msh = Create(Mesh){ | |
939 | Parent = Part, | |
940 | Offset = OffSet, | |
941 | Scale = Scale, | |
942 | } | |
943 | if Mesh == "SpecialMesh" then | |
944 | Msh.MeshType = MeshType | |
945 | Msh.MeshId = MeshId | |
946 | end | |
947 | return Msh | |
948 | end | |
949 | ||
950 | function CreateWeld(Parent, Part0, Part1, C0, C1) | |
951 | local Weld = Create("Weld"){ | |
952 | Parent = Parent, | |
953 | Part0 = Part0, | |
954 | Part1 = Part1, | |
955 | C0 = C0, | |
956 | C1 = C1, | |
957 | } | |
958 | return Weld | |
959 | end | |
960 | ||
961 | function rayCast(Position, Direction, Range, Ignore) | |
962 | return game:service("Workspace"):FindPartOnRay(Ray.new(Position, Direction.unit * (Range or 999.999)), Ignore) | |
963 | end | |
964 | ||
965 | function CreateSound(id, par, vol, pit) | |
966 | coroutine.resume(coroutine.create(function() | |
967 | local sou = Instance.new("Sound", par or workspace) | |
968 | sou.Volume = vol | |
969 | sou.Pitch = pit or 1 | |
970 | sou.SoundId = id | |
971 | wait() | |
972 | sou:play() | |
973 | game:GetService("Debris"):AddItem(sou, 6) | |
974 | end)) | |
975 | end | |
976 | ||
977 | local function getclosest(obj, distance) | |
978 | local last, lastx = distance + 1 | |
979 | for i, v in pairs(workspace:GetChildren()) do | |
980 | if v:IsA'Model' and v ~= Character and v:findFirstChild('Humanoid') and v:findFirstChild('Torso') and v:findFirstChild('Humanoid').Health > 0 then | |
981 | local t = v.Torso | |
982 | local dist = (t.Position - obj.Position).magnitude | |
983 | if dist <= distance then | |
984 | if dist < last then | |
985 | last = dist | |
986 | lastx = v | |
987 | end | |
988 | end | |
989 | end | |
990 | end | |
991 | return lastx | |
992 | end | |
993 | ||
994 | function Damage(hit, damage, cooldown, Color1, Color2, HSound, HPitch) | |
995 | for i, v in pairs(hit:GetChildren()) do | |
996 | if v:IsA("Humanoid") and hit.Name ~= Character.Name then | |
997 | local find = v:FindFirstChild("Hitz") | |
998 | if not find then | |
999 | if v.Parent:findFirstChild("Head") then | |
1000 | local BillG = Create("BillboardGui"){ | |
1001 | Parent = v.Parent.Head, | |
1002 | Size = UDim2.new(1, 0, 1, 0), | |
1003 | Adornee = v.Parent.Head, | |
1004 | StudsOffset = Vector3.new(math.random(-3, 3), math.random(3, 5), math.random(-3, 3)), | |
1005 | } | |
1006 | local TL = Create("TextLabel"){ | |
1007 | Parent = BillG, | |
1008 | Size = UDim2.new(3, 3, 3, 3), | |
1009 | BackgroundTransparency = 1, | |
1010 | Text = tostring(damage).."-", | |
1011 | TextColor3 = Color1.Color, | |
1012 | TextStrokeColor3 = Color2.Color, | |
1013 | TextStrokeTransparency = 0, | |
1014 | TextXAlignment = Enum.TextXAlignment.Center, | |
1015 | TextYAlignment = Enum.TextYAlignment.Center, | |
1016 | FontSize = Enum.FontSize.Size18, | |
1017 | Font = "ArialBold", | |
1018 | } | |
1019 | coroutine.resume(coroutine.create(function() | |
1020 | wait(1) | |
1021 | for i = 0, 1, .1 do | |
1022 | wait(.1) | |
1023 | BillG.StudsOffset = BillG.StudsOffset + Vector3.new(0, .1, 0) | |
1024 | end | |
1025 | BillG:Destroy() | |
1026 | end)) | |
1027 | end | |
1028 | v.Health = v.Health - damage | |
1029 | local bool = Create("BoolValue"){ | |
1030 | Parent = v, | |
1031 | Name = 'Hitz', | |
1032 | } | |
1033 | if HSound ~= nil and HPitch ~= nil then | |
1034 | CreateSound(HSound, hit, 1, HPitch) | |
1035 | end | |
1036 | game:GetService("Debris"):AddItem(bool, cooldown) | |
1037 | end | |
1038 | end | |
1039 | end | |
1040 | end | |
1041 | ||
1042 | ||
1043 | function BlockEffect(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay, Type) | |
1044 | local prt = CreatePart(3, workspace, "SmoothPlastic", 0, 0, brickcolor, "Effect", Vector3.new()) | |
1045 | prt.Anchored = true | |
1046 | prt.CFrame = cframe | |
1047 | local msh = CreateMesh("BlockMesh", prt, "", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1)) | |
1048 | game:GetService("Debris"):AddItem(prt, 10) | |
1049 | if Type == 1 or Type == nil then | |
1050 | table.insert(Effects, { | |
1051 | prt, | |
1052 | "Block1", | |
1053 | delay, | |
1054 | x3, | |
1055 | y3, | |
1056 | z3, | |
1057 | msh | |
1058 | }) | |
1059 | elseif Type == 2 then | |
1060 | table.insert(Effects, { | |
1061 | prt, | |
1062 | "Block2", | |
1063 | delay, | |
1064 | x3, | |
1065 | y3, | |
1066 | z3, | |
1067 | msh | |
1068 | }) | |
1069 | end | |
1070 | end | |
1071 | ||
1072 | function SphereEffect(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay) | |
1073 | local prt = CreatePart(3, workspace, "SmoothPlastic", 0, 0, brickcolor, "Effect", Vector3.new()) | |
1074 | prt.Anchored = true | |
1075 | prt.CFrame = cframe | |
1076 | local msh = CreateMesh("SpecialMesh", prt, "Sphere", "nil", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1)) | |
1077 | game:GetService("Debris"):AddItem(prt, 10) | |
1078 | table.insert(Effects, { | |
1079 | prt, | |
1080 | "Cylinder", | |
1081 | delay, | |
1082 | x3, | |
1083 | y3, | |
1084 | z3, | |
1085 | msh | |
1086 | }) | |
1087 | end | |
1088 | ||
1089 | function RingEffect(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay) | |
1090 | local prt = CreatePart(3, workspace, "SmoothPlastic", 0, 0, brickcolor, "Effect", Vector3.new(0.5, 0.5, 0.5)) | |
1091 | prt.Anchored = true | |
1092 | prt.CFrame = cframe * CFrame.new(x1, y1, z1) | |
1093 | local msh = CreateMesh("SpecialMesh", prt, "FileMesh", "3270017", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1)) | |
1094 | game:GetService("Debris"):AddItem(prt, 10) | |
1095 | table.insert(Effects, { | |
1096 | prt, | |
1097 | "Cylinder", | |
1098 | delay, | |
1099 | x3, | |
1100 | y3, | |
1101 | z3, | |
1102 | msh | |
1103 | }) | |
1104 | end | |
1105 | ||
1106 | function CylinderEffect(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay) | |
1107 | local prt = CreatePart(3, workspace, "SmoothPlastic", 0, 0, brickcolor, "Effect", Vector3.new()) | |
1108 | prt.Anchored = true | |
1109 | prt.CFrame = cframe | |
1110 | local msh = CreateMesh("CylinderMesh", prt, "", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1)) | |
1111 | game:GetService("Debris"):AddItem(prt, 10) | |
1112 | table.insert(Effects, { | |
1113 | prt, | |
1114 | "Cylinder", | |
1115 | delay, | |
1116 | x3, | |
1117 | y3, | |
1118 | z3, | |
1119 | msh | |
1120 | }) | |
1121 | end | |
1122 | ||
1123 | function WaveEffect(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay) | |
1124 | local prt = CreatePart(3, workspace, "SmoothPlastic", 0, 0, brickcolor, "Effect", Vector3.new()) | |
1125 | prt.Anchored = true | |
1126 | prt.CFrame = cframe | |
1127 | local msh = CreateMesh("SpecialMesh", prt, "FileMesh", "20329976", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1)) | |
1128 | game:GetService("Debris"):AddItem(prt, 10) | |
1129 | table.insert(Effects, { | |
1130 | prt, | |
1131 | "Cylinder", | |
1132 | delay, | |
1133 | x3, | |
1134 | y3, | |
1135 | z3, | |
1136 | msh | |
1137 | }) | |
1138 | end | |
1139 | ||
1140 | function SpecialEffect(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay) | |
1141 | local prt = CreatePart(3, workspace, "SmoothPlastic", 0, 0, brickcolor, "Effect", Vector3.new()) | |
1142 | prt.Anchored = true | |
1143 | prt.CFrame = cframe | |
1144 | local msh = CreateMesh("SpecialMesh", prt, "FileMesh", "24388358", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1)) | |
1145 | game:GetService("Debris"):AddItem(prt, 10) | |
1146 | table.insert(Effects, { | |
1147 | prt, | |
1148 | "Cylinder", | |
1149 | delay, | |
1150 | x3, | |
1151 | y3, | |
1152 | z3, | |
1153 | msh | |
1154 | }) | |
1155 | end | |
1156 | ||
1157 | function BreakEffect(brickcolor, cframe, x1, y1, z1) | |
1158 | local prt = CreatePart(3, workspace, "SmoothPlastic", 0, 0, brickcolor, "Effect", Vector3.new(0.5, 0.5, 0.5)) | |
1159 | prt.Anchored = true | |
1160 | prt.CFrame = cframe * CFrame.fromEulerAnglesXYZ(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50)) | |
1161 | local msh = CreateMesh("SpecialMesh", prt, "Sphere", "nil", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1)) | |
1162 | local num = math.random(10, 50) / 1000 | |
1163 | game:GetService("Debris"):AddItem(prt, 10) | |
1164 | table.insert(Effects, { | |
1165 | prt, | |
1166 | "Shatter", | |
1167 | num, | |
1168 | prt.CFrame, | |
1169 | math.random() - math.random(), | |
1170 | 0, | |
1171 | math.random(50, 100) / 100 | |
1172 | }) | |
1173 | end | |
1174 | ||
1175 | ||
1176 | ||
1177 | ||
1178 | for i = 0, 1, 0.05 do | |
1179 | swait() | |
1180 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .1) | |
1181 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(5), math.rad(0), math.rad(0)), .1) | |
1182 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, -.1) * angles(math.rad(5), math.rad(0), math.rad(5)), 0.1) | |
1183 | LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(20), math.rad(0), math.rad(-10)), 0.3) | |
1184 | if Torsovelocity > 2 then | |
1185 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(-50 * math.cos(sine / 4)), math.rad(0), math.rad(4 * math.cos(sine / 4))), .2) | |
1186 | RH.C0 = clerp(RH.C0, cn(1, -1 + .1 * math.cos(sine / 5), 0) * RHCF * angles(math.rad(-2), math.rad(0), math.rad(30 * math.cos(sine / 4))), .3) | |
1187 | LH.C0 = clerp(LH.C0, cn(-1, -1 + .1 * math.cos(sine / 5), 0) * LHCF * angles(math.rad(-2), math.rad(0), math.rad(30 * math.cos(sine / 4))), .3) | |
1188 | elseif Torsovelocity < 1 then | |
1189 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, -.1) * angles(math.rad(5), math.rad(0), math.rad(5)), 0.1) | |
1190 | RH.C0 = clerp(RH.C0, cn(1, -1, 0) * RHCF * angles(math.rad(-2), math.rad(5), math.rad(0)), .1) | |
1191 | LH.C0 = clerp(LH.C0, cn(-1, -1, 0) * LHCF * angles(math.rad(-2), math.rad(5), math.rad(0)), .1) | |
1192 | end | |
1193 | end | |
1194 | attack = false | |
1195 | ||
1196 | ||
1197 | ||
1198 | game:GetService'RunService'.Stepped:connect(function() | |
1199 | ||
1200 | ||
1201 | ||
1202 | if Wep == 1 then | |
1203 | equippedgun2 = false | |
1204 | Reaper4.Transparency = 1 | |
1205 | Reaper5.Transparency = 0 | |
1206 | Reaper6.Transparency = 1 | |
1207 | Reaper7.Transparency = 0 | |
1208 | end | |
1209 | if Wep == 2 then | |
1210 | equippedgun2 = true | |
1211 | Reaper4.Transparency = 0 | |
1212 | Reaper5.Transparency = 1 | |
1213 | Reaper6.Transparency = 0 | |
1214 | Reaper7.Transparency = 1 | |
1215 | end | |
1216 | if Wep == 3 then | |
1217 | equippedgun2 = false | |
1218 | Reaper4.Transparency = 1 | |
1219 | Reaper5.Transparency = 1 | |
1220 | Reaper6.Transparency = 1 | |
1221 | Reaper7.Transparency = 1 | |
1222 | end | |
1223 | ||
1224 | Torsovelocity = (RootPart.Velocity * Vector3.new(1, 0, 1)).magnitude | |
1225 | velocity = RootPart.Velocity.y | |
1226 | sine = sine + change | |
1227 | local hit, pos = rayCast(RootPart.Position, (CFrame.new(RootPart.Position, RootPart.Position - Vector3.new(0, 1, 0))).lookVector, 4, Character) | |
1228 | if equipped == true or equipped == false then | |
1229 | if RootPart.Velocity.y > 1 and hit == nil then | |
1230 | Anim = "Jump" | |
1231 | if attack == false and Wep == 1 then | |
1232 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(-5), math.rad(0), math.rad(0)), .1) | |
1233 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(10), math.rad(0), math.rad(0)), .1) | |
1234 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(-40), math.rad(0), math.rad(30)), .1) | |
1235 | LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-40), math.rad(0), math.rad(-30)), .1) | |
1236 | RH.C0 = clerp(RH.C0, cn(1, -.9, -.3) * RHCF * angles(math.rad(3), math.rad(0), math.rad(0)), .1) | |
1237 | LH.C0 = clerp(LH.C0, cn(-1, -.7, -.5) * LHCF * angles(math.rad(-3), math.rad(0), math.rad(0)), .1) | |
1238 | end | |
1239 | elseif RootPart.Velocity.y < -1 and hit == nil then | |
1240 | Anim = "Fall" | |
1241 | if attack == false and Wep == 1 then | |
1242 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(10), math.rad(0), math.rad(0)), .1) | |
1243 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(10), math.rad(0), math.rad(0)), .1) | |
1244 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(-20), math.rad(0), math.rad(50)), .1) | |
1245 | LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-20), math.rad(0), math.rad(-50)), .1) | |
1246 | RH.C0 = clerp(RH.C0, cn(1, -1, -.3) * RHCF * angles(math.rad(-5), math.rad(0), math.rad(0)), .1) | |
1247 | LH.C0 = clerp(LH.C0, cn(-1, -.8, -.3) * LHCF * angles(math.rad(-5), math.rad(0), math.rad(0)), .1) | |
1248 | end | |
1249 | elseif Torsovelocity < 1 and hit ~= nil then | |
1250 | Anim = "Idle" | |
1251 | if attack == false and Wep == 1 then | |
1252 | change = 1 | |
1253 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.1 + 0.1 * math.cos(sine / 25)) * angles(math.rad(0), math.rad(0), math.rad(5)), .1) | |
1254 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(5 - 2 * math.cos(sine / 25)), math.rad(0), math.rad(-5)), .1) | |
1255 | RW.C0 = clerp(RW.C0, CFrame.new(1.2, 0.5 - -.1 * math.cos(sine / 25), 0) * angles(math.rad(50), math.rad(35 - 25 * math.cos(sine / 25)), math.rad(5 + 3 * math.cos(sine / 25))), 0.1) | |
1256 | LW.C0 = clerp(LW.C0, CFrame.new(-1.2, 0.4, -.4) * angles(math.rad(80 + 7 * math.cos(sine / 25)), math.rad(-30), math.rad(35 - 1 * math.cos(sine / 25))), 0.1) | |
1257 | RH.C0 = clerp(RH.C0, cn(1, -.9 - 0.1 * math.cos(sine / 25), 0) * RHCF * angles(math.rad(-2 + 1 * math.cos(sine / 25)), math.rad(-5), math.rad(0 + 2 * math.cos(sine / 25))), .1) | |
1258 | LH.C0 = clerp(LH.C0, cn(-1, -.9 - 0.1 * math.cos(sine / 25), 0) * LHCF * angles(math.rad(-2 + 1 * math.cos(sine / 25)), math.rad(-5), math.rad(0 + 2 * math.cos(sine / 25))), .1) | |
1259 | end | |
1260 | elseif Torsovelocity > 2 and hit ~= nil then | |
1261 | Anim = "Walk" | |
1262 | if attack == false and Wep == 1 then | |
1263 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.05 + .1 * math.cos(sine / 3)) * angles(math.rad(5), math.rad(0) + RootPart.RotVelocity.Y / 30, math.rad(5 * math.cos(sine / 5))), .2) | |
1264 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(-3), math.rad(0), math.rad(-5 * math.cos(sine / 5)) + RootPart.RotVelocity.Y / 9), .2) | |
1265 | RW.C0 = clerp(RW.C0, CFrame.new(1.2 - -.05 * math.cos(sine / 4), 0.5 - -.05 * math.cos(sine / 4), 0) * angles(math.rad(50), math.rad(57 - .1 * math.cos(sine / 25)), math.rad(5 + 3 * math.cos(sine / 25))), 0.1) | |
1266 | LW.C0 = clerp(LW.C0, CFrame.new(-1.2 - -.05 * math.cos(sine / 4), 0.4 - -.05 * math.cos(sine / 4), -.4) * angles(math.rad(80 + 1 * math.cos(sine / 25)), math.rad(-30), math.rad(35 - 1 * math.cos(sine / 25))), 0.1) | |
1267 | RH.C0 = clerp(RH.C0, cn(1, -.9 + -.1 * math.cos(sine / 4),0 + -.1 * math.cos(sine / 4)) * RHCF * angles(math.rad(-2), math.rad(0), math.rad(50 * math.cos(sine / 4))), .3) | |
1268 | LH.C0 = clerp(LH.C0, cn(-1, -.9 + .1 * math.cos(sine / 4), 0 + .1 * math.cos(sine / 4)) * LHCF * angles(math.rad(-2), math.rad(0), math.rad(50 * math.cos(sine / 4))), .3) | |
1269 | end | |
1270 | end | |
1271 | end | |
1272 | -----------------------[Anim2]-------------------------------------------------------------------------------------------------------------------------- | |
1273 | ||
1274 | if equipped == true or equipped == false then | |
1275 | if RootPart.Velocity.y > 1 and hit == nil then | |
1276 | Anim = "Jump" | |
1277 | if attack == false and Wep == 2 then | |
1278 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(-5), math.rad(0), math.rad(0)), .1) | |
1279 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(10), math.rad(0), math.rad(0)), .1) | |
1280 | RW.C0 = clerp(RW.C0, CFrame.new(1.2, 0.2, 0) * angles(math.rad(60), math.rad(0 - .01 * math.cos(sine / 25)), math.rad(-40 + 0.1 * math.cos(sine / 25))), 0.1) | |
1281 | LW.C0 = clerp(LW.C0, CFrame.new(-1.2, 0.1, -.4) * angles(math.rad(55 + 1 * math.cos(sine / 25)), math.rad(15), math.rad(-10 - 1 * math.cos(sine / 25))), 0.1) | |
1282 | RH.C0 = clerp(RH.C0, cn(1, -.9, -.3) * RHCF * angles(math.rad(3), math.rad(0), math.rad(0)), .1) | |
1283 | LH.C0 = clerp(LH.C0, cn(-1, -.7, -.5) * LHCF * angles(math.rad(-3), math.rad(0), math.rad(0)), .1) | |
1284 | end | |
1285 | ||
1286 | elseif RootPart.Velocity.y < -1 and hit == nil then | |
1287 | Anim = "Fall" | |
1288 | if attack == false and Wep == 2 then | |
1289 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(10), math.rad(0), math.rad(0)), .1) | |
1290 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(10), math.rad(0), math.rad(0)), .1) | |
1291 | RW.C0 = clerp(RW.C0, CFrame.new(1.2, 0.8, 0) * angles(math.rad(60), math.rad(0 - .01 * math.cos(sine / 25)), math.rad(-40 + 0.1 * math.cos(sine / 25))), 0.05) | |
1292 | LW.C0 = clerp(LW.C0, CFrame.new(-1.2, 0.7, -.4) * angles(math.rad(55 + 1 * math.cos(sine / 25)), math.rad(15), math.rad(-10 - 1 * math.cos(sine / 25))), 0.05) | |
1293 | RH.C0 = clerp(RH.C0, cn(1, -1, -.3) * RHCF * angles(math.rad(-5), math.rad(0), math.rad(0)), .1) | |
1294 | LH.C0 = clerp(LH.C0, cn(-1, -.8, -.3) * LHCF * angles(math.rad(-5), math.rad(0), math.rad(0)), .1) | |
1295 | end | |
1296 | elseif Torsovelocity < 1 and hit ~= nil then | |
1297 | Anim = "Idle" | |
1298 | if attack == false and Wep == 2 then | |
1299 | change = 1 | |
1300 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.1 + 0.1 * math.cos(sine / 25)) * angles(math.rad(0), math.rad(0), math.rad(5)), .1) | |
1301 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(5 - 2 * math.cos(sine / 25)), math.rad(0), math.rad(-5)), .1) | |
1302 | RW.C0 = clerp(RW.C0, CFrame.new(1.2, 0.5, 0) * angles(math.rad(60), math.rad(0 - .01 * math.cos(sine / 25)), math.rad(-40 + 0.1 * math.cos(sine / 25))), 0.1) | |
1303 | LW.C0 = clerp(LW.C0, CFrame.new(-1.2, 0.4, -.4) * angles(math.rad(55 + 1 * math.cos(sine / 25)), math.rad(15), math.rad(-10 - 1 * math.cos(sine / 25))), 0.1) | |
1304 | RH.C0 = clerp(RH.C0, cn(1, -.9 - 0.1 * math.cos(sine / 25), 0) * RHCF * angles(math.rad(-2 + 1 * math.cos(sine / 25)), math.rad(-5), math.rad(0 + 2 * math.cos(sine / 25))), .1) | |
1305 | LH.C0 = clerp(LH.C0, cn(-1, -.9 - 0.1 * math.cos(sine / 25), 0) * LHCF * angles(math.rad(-2 + 1 * math.cos(sine / 25)), math.rad(-5), math.rad(0 + 2 * math.cos(sine / 25))), .1) | |
1306 | end | |
1307 | elseif Torsovelocity > 2 and hit ~= nil then | |
1308 | Anim = "Walk" | |
1309 | if attack == false and Wep == 2 then | |
1310 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.05 + .1 * math.cos(sine / 3)) * angles(math.rad(5), math.rad(0) + RootPart.RotVelocity.Y / 30, math.rad(-25 - 5 * math.cos(sine / 5))), .2) | |
1311 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(-3), math.rad(0), math.rad(25 + 5 * math.cos(sine / 5)) + RootPart.RotVelocity.Y / 9), .2) | |
1312 | RW.C0 = clerp(RW.C0, CFrame.new(1.2, 0.5, 0) * angles(math.rad(60), math.rad(0 - .01 * math.cos(sine / 25)), math.rad(-40 + 0.1 * math.cos(sine / 25))), 0.1) | |
1313 | LW.C0 = clerp(LW.C0, CFrame.new(-1.2, 0.4, -.4) * angles(math.rad(55 + 1 * math.cos(sine / 25)), math.rad(15), math.rad(-10 - 1 * math.cos(sine / 25))), 0.1) | |
1314 | RH.C0 = clerp(RH.C0, cn(.95, -.9 + -.1 * math.cos(sine / 4),-.35) * RHCF * angles(math.rad(-2), math.rad(25), math.rad(50 * math.cos(sine / 4))), .3) | |
1315 | LH.C0 = clerp(LH.C0, cn(-.95, -.9 + .1 * math.cos(sine / 4), .35) * LHCF * angles(math.rad(-2), math.rad(25), math.rad(50 * math.cos(sine / 4))), .3) | |
1316 | end | |
1317 | ||
1318 | end | |
1319 | end | |
1320 | ||
1321 | ||
1322 | ||
1323 | -----------------------[Noraml Anim]-------------------------------------------------------------------------------------------------------------------------- | |
1324 | ||
1325 | if equipped == true or equipped == false then | |
1326 | if RootPart.Velocity.y > 1 and hit == nil then | |
1327 | Anim = "Jump" | |
1328 | if attack == false and Wep == 3 then | |
1329 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(-5), math.rad(0), math.rad(0)), .1) | |
1330 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(10), math.rad(0), math.rad(0)), .1) | |
1331 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(-40), math.rad(0), math.rad(30)), .1) | |
1332 | LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-40), math.rad(0), math.rad(-30)), .1) | |
1333 | RH.C0 = clerp(RH.C0, cn(1, -.9, -.3) * RHCF * angles(math.rad(3), math.rad(0), math.rad(0)), .1) | |
1334 | LH.C0 = clerp(LH.C0, cn(-1, -.7, -.5) * LHCF * angles(math.rad(-3), math.rad(0), math.rad(0)), .1) | |
1335 | end | |
1336 | elseif RootPart.Velocity.y < -1 and hit == nil then | |
1337 | Anim = "Fall" | |
1338 | if attack == false and Wep == 3 then | |
1339 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(10), math.rad(0), math.rad(0)), .1) | |
1340 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(10), math.rad(0), math.rad(0)), .1) | |
1341 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(-20), math.rad(0), math.rad(50)), .1) | |
1342 | LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-20), math.rad(0), math.rad(-50)), .1) | |
1343 | RH.C0 = clerp(RH.C0, cn(1, -1, -.3) * RHCF * angles(math.rad(-5), math.rad(0), math.rad(0)), .1) | |
1344 | LH.C0 = clerp(LH.C0, cn(-1, -.8, -.3) * LHCF * angles(math.rad(-5), math.rad(0), math.rad(0)), .1) | |
1345 | end | |
1346 | elseif Torsovelocity < 1 and hit ~= nil then | |
1347 | Anim = "Idle" | |
1348 | if attack == false and Wep == 3 then | |
1349 | change = 1 | |
1350 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.1 + 0.1 * math.cos(sine / 25)) * angles(math.rad(0), math.rad(0), math.rad(5)), .1) | |
1351 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(5 - 2 * math.cos(sine / 25)), math.rad(0), math.rad(-5)), .1) | |
1352 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5 - 0 * math.cos(sine / 25), 0) * angles(math.rad(0), math.rad(0 - 0 * math.cos(sine / 25)), math.rad(5 + 3 * math.cos(sine / 25))), 0.1) | |
1353 | LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(0 + 0 * math.cos(sine / 25)), math.rad(-0), math.rad(-5 - 3 * math.cos(sine / 25))), 0.1) | |
1354 | RH.C0 = clerp(RH.C0, cn(1, -.9 - 0.1 * math.cos(sine / 25), 0) * RHCF * angles(math.rad(-2 + 1 * math.cos(sine / 25)), math.rad(-5), math.rad(0 + 2 * math.cos(sine / 25))), .1) | |
1355 | LH.C0 = clerp(LH.C0, cn(-1, -.9 - 0.1 * math.cos(sine / 25), 0) * LHCF * angles(math.rad(-2 + 1 * math.cos(sine / 25)), math.rad(-5), math.rad(0 + 2 * math.cos(sine / 25))), .1) | |
1356 | end | |
1357 | elseif Torsovelocity > 2 and hit ~= nil then | |
1358 | Anim = "Walk" | |
1359 | if attack == false and Wep == 3 then | |
1360 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.05 + .1 * math.cos(sine / 3)) * angles(math.rad(5), math.rad(0) + RootPart.RotVelocity.Y / 30, math.rad(5 * math.cos(sine / 5))), .2) | |
1361 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(-3), math.rad(0), math.rad(-5 * math.cos(sine / 5)) + RootPart.RotVelocity.Y / 9), .2) | |
1362 | RW.C0 = clerp(RW.C0, CFrame.new(1.5 - -0 * math.cos(sine / 4), 0.5 - -.05 * math.cos(sine / 4), 0) * angles(math.rad(10 + -50 * math.cos(sine / 4)), math.rad(0 - .1 * math.cos(sine / 25)), math.rad(5 + 3 * math.cos(sine / 25))), 0.3) | |
1363 | LW.C0 = clerp(LW.C0, CFrame.new(-1.5 - -0 * math.cos(sine / 4), 0.5 - -.05 * math.cos(sine / 4), 0) * angles(math.rad(10 + 50 * math.cos(sine / 4)), math.rad(-0), math.rad(-5 - 3 * math.cos(sine / 25))), 0.3) | |
1364 | RH.C0 = clerp(RH.C0, cn(1, -.9 + -.1 * math.cos(sine / 4),0 + -.1 * math.cos(sine / 4)) * RHCF * angles(math.rad(-2), math.rad(0), math.rad(50 * math.cos(sine / 4))), .3) | |
1365 | LH.C0 = clerp(LH.C0, cn(-1, -.9 + .1 * math.cos(sine / 4), 0 + .1 * math.cos(sine / 4)) * LHCF * angles(math.rad(-2), math.rad(0), math.rad(50 * math.cos(sine / 4))), .3) | |
1366 | end | |
1367 | end | |
1368 | end | |
1369 | ||
1370 | ||
1371 | ||
1372 | ||
1373 | ||
1374 | ||
1375 | ||
1376 | ||
1377 | ||
1378 | ||
1379 | ||
1380 | ||
1381 | ||
1382 | ||
1383 | ||
1384 | ||
1385 | ||
1386 | ||
1387 | if #Effects > 0 then | |
1388 | for e = 1, #Effects do | |
1389 | if Effects[e] ~= nil then | |
1390 | local Thing = Effects[e] | |
1391 | if Thing ~= nil then | |
1392 | local Part = Thing[1] | |
1393 | local Mode = Thing[2] | |
1394 | local Delay = Thing[3] | |
1395 | local IncX = Thing[4] | |
1396 | local IncY = Thing[5] | |
1397 | local IncZ = Thing[6] | |
1398 | if Thing[1].Transparency <= 1 then | |
1399 | if Thing[2] == "Block1" then | |
1400 | Thing[1].CFrame = Thing[1].CFrame * CFrame.fromEulerAnglesXYZ(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50)) | |
1401 | local Mesh = Thing[1].Mesh | |
1402 | Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6]) | |
1403 | Thing[1].Transparency = Thing[1].Transparency + Thing[3] | |
1404 | elseif Thing[2] == "Block2" then | |
1405 | Thing[1].CFrame = Thing[1].CFrame | |
1406 | local Mesh = Thing[7] | |
1407 | Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6]) | |
1408 | Thing[1].Transparency = Thing[1].Transparency + Thing[3] | |
1409 | elseif Thing[2] == "Cylinder" then | |
1410 | local Mesh = Thing[1].Mesh | |
1411 | Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6]) | |
1412 | Thing[1].Transparency = Thing[1].Transparency + Thing[3] | |
1413 | elseif Thing[2] == "Blood" then | |
1414 | local Mesh = Thing[7] | |
1415 | Thing[1].CFrame = Thing[1].CFrame * Vector3.new(0, .5, 0) | |
1416 | Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6]) | |
1417 | Thing[1].Transparency = Thing[1].Transparency + Thing[3] | |
1418 | elseif Thing[2] == "Elec" then | |
1419 | local Mesh = Thing[1].Mesh | |
1420 | Mesh.Scale = Mesh.Scale + Vector3.new(Thing[7], Thing[8], Thing[9]) | |
1421 | Thing[1].Transparency = Thing[1].Transparency + Thing[3] | |
1422 | elseif Thing[2] == "Disappear" then | |
1423 | Thing[1].Transparency = Thing[1].Transparency + Thing[3] | |
1424 | elseif Thing[2] == "Shatter" then | |
1425 | Thing[1].Transparency = Thing[1].Transparency + Thing[3] | |
1426 | Thing[4] = Thing[4] * CFrame.new(0, Thing[7], 0) | |
1427 | Thing[1].CFrame = Thing[4] * CFrame.fromEulerAnglesXYZ(Thing[6], 0, 0) | |
1428 | Thing[6] = Thing[6] + Thing[5] | |
1429 | end | |
1430 | else | |
1431 | Part.Parent = nil | |
1432 | table.remove(Effects, e) | |
1433 | end | |
1434 | end | |
1435 | end | |
1436 | end | |
1437 | end | |
1438 | end) | |
1439 | ||
1440 | ||
1441 | ||
1442 | ||
1443 | ||
1444 | ||
1445 | ||
1446 | ||
1447 | ||
1448 | ||
1449 | ||
1450 | ||
1451 | ||
1452 | local No = Instance.new("Sound", head); | |
1453 | No.SoundId = "rbxassetid://245064504" | |
1454 | No.Volume = 3 | |
1455 | local yes = Instance.new("Sound", head); | |
1456 | yes.SoundId = "rbxassetid://131384028" | |
1457 | yes.Volume = 3 | |
1458 | local HitM = Instance.new("Sound", Reaper5); | |
1459 | HitM.SoundId = "rbxassetid://"..WSH | |
1460 | HitM.Volume = 1.1 | |
1461 | local Swing = Instance.new("Sound", Reaper5); | |
1462 | Swing.SoundId = "rbxassetid://10209850" | |
1463 | Swing.Volume = 1.5 | |
1464 | Swing.Pitch = 1.1 | |
1465 | local SwingH = Instance.new("Sound", Reaper5); | |
1466 | SwingH.SoundId = "rbxassetid://10209590" | |
1467 | SwingH.Volume = 2.9 | |
1468 | SwingH.Pitch = .8 | |
1469 | local Taunt = Instance.new("Sound", head); | |
1470 | Taunt.SoundId = "rbxassetid://150611842" | |
1471 | Taunt.Volume = 2 | |
1472 | local RUS = Instance.new("Sound", char); | |
1473 | RUS.SoundId = "rbxassetid://322621962" | |
1474 | RUS.Volume = 2.5 | |
1475 | RUS.Pitch = 1 | |
1476 | RUS.Looped = true | |
1477 | ||
1478 | ||
1479 | ||
1480 | ||
1481 | ||
1482 | ||
1483 | ||
1484 | ||
1485 | ||
1486 | ||
1487 | function BuildSentry() | |
1488 | do --CFrame lerp (stravant, clerp by AntiBoomz0r) | |
1489 | local function QuaternionFromCFrame(cf) -- y u no axis angle interpolation? | |
1490 | local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components() | |
1491 | local trace = m00 + m11 + m22 | |
1492 | if trace > 0 then | |
1493 | local s = math.sqrt(1 + trace) | |
1494 | local recip = 0.5/s | |
1495 | return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5 | |
1496 | else | |
1497 | local i = 0 | |
1498 | if m11 > m00 then | |
1499 | i = 1 | |
1500 | end | |
1501 | if m22 > (i == 0 and m00 or m11) then | |
1502 | i = 2 | |
1503 | end | |
1504 | if i == 0 then | |
1505 | local s = math.sqrt(m00-m11-m22+1) | |
1506 | local recip = 0.5/s | |
1507 | return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip | |
1508 | elseif i == 1 then | |
1509 | local s = math.sqrt(m11-m22-m00+1) | |
1510 | local recip = 0.5/s | |
1511 | return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip | |
1512 | elseif i == 2 then | |
1513 | local s = math.sqrt(m22-m00-m11+1) | |
1514 | local recip = 0.5/s return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip | |
1515 | end | |
1516 | end | |
1517 | end | |
1518 | local function QuaternionToCFrame(px, py, pz, x, y, z, w) | |
1519 | local xs, ys, zs = x + x, y + y, z + z | |
1520 | local wx, wy, wz = w*xs, w*ys, w*zs | |
1521 | local xx = x*xs | |
1522 | local xy = x*ys | |
1523 | local xz = x*zs | |
1524 | local yy = y*ys | |
1525 | local yz = y*zs | |
1526 | local zz = z*zs | |
1527 | return CFrame.new(px, py, pz,1-(yy+zz), xy - wz, xz + wy,xy + wz, 1-(xx+zz), yz - wx, xz - wy, yz + wx, 1-(xx+yy)) | |
1528 | end | |
1529 | function QuaternionSlerp(a, b, t) | |
1530 | local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4] | |
1531 | local startInterp, finishInterp; | |
1532 | if cosTheta >= 0.0001 then | |
1533 | if (1 - cosTheta) > 0.0001 then | |
1534 | local theta = math.acos(cosTheta) | |
1535 | local invSinTheta = 1/math.sin(theta) | |
1536 | startInterp = math.sin((1-t)*theta)*invSinTheta | |
1537 | finishInterp = math.sin(t*theta)*invSinTheta | |
1538 | else | |
1539 | startInterp = 1-t | |
1540 | finishInterp = t | |
1541 | end | |
1542 | else | |
1543 | if (1+cosTheta) > 0.0001 then | |
1544 | local theta = math.acos(-cosTheta) | |
1545 | local invSinTheta = 1/math.sin(theta) | |
1546 | startInterp = math.sin((t-1)*theta)*invSinTheta | |
1547 | finishInterp = math.sin(t*theta)*invSinTheta | |
1548 | else | |
1549 | startInterp = t-1 | |
1550 | finishInterp = t | |
1551 | end | |
1552 | end | |
1553 | return a[1]*startInterp + b[1]*finishInterp, a[2]*startInterp + b[2]*finishInterp, a[3]*startInterp + b[3]*finishInterp, a[4]*startInterp + b[4]*finishInterp | |
1554 | end | |
1555 | function clerp(a,b,t) | |
1556 | local qa = {QuaternionFromCFrame(a)} | |
1557 | local qb = {QuaternionFromCFrame(b)} | |
1558 | local ax, ay, az = a.x, a.y, a.z | |
1559 | local bx, by, bz = b.x, b.y, b.z | |
1560 | local _t = 1-t | |
1561 | return QuaternionToCFrame(_t*ax + t*bx, _t*ay + t*by, _t*az + t*bz,QuaternionSlerp(qa, qb, t)) | |
1562 | end | |
1563 | end | |
1564 | ||
1565 | ||
1566 | ||
1567 | ||
1568 | local ABS = math.abs; | |
1569 | local SIN = math.sin; | |
1570 | local ASIN = math.asin; | |
1571 | local COS = math.cos; | |
1572 | ||
1573 | local new = Instance.new; | |
1574 | ||
1575 | function math_pos(float) | |
1576 | if float < 0 then float = 0 end | |
1577 | return float | |
1578 | end | |
1579 | function math_neg(float) | |
1580 | if float > 0 then float = 0 end | |
1581 | return float | |
1582 | end | |
1583 | function math_max(float, max) | |
1584 | if float > max then float = max end | |
1585 | return float | |
1586 | end | |
1587 | function math_min(float, min) | |
1588 | if float > min then float = min end | |
1589 | return float | |
1590 | end | |
1591 | ||
1592 | function SharpSin(double_p1) | |
1593 | return ASIN(SIN(double_p1)); | |
1594 | end | |
1595 | ||
1596 | local Storage = Instance.new("Model", script); | |
1597 | ||
1598 | function WeldP(part0, part1, C0, C1) | |
1599 | local W = new("Weld", Storage); | |
1600 | W.Part0 = part0; | |
1601 | W.Part1 = part1; | |
1602 | W.C0 = C0 or CFrame.new(); | |
1603 | W.C1 = C1 or CFrame.new(); | |
1604 | return W; | |
1605 | end | |
1606 | ||
1607 | function Bevel(part, sizeV3) | |
1608 | local BvlMesh = new("SpecialMesh", part) | |
1609 | BvlMesh.MeshId = "rbxasset://fonts/torso.mesh"; | |
1610 | if (sizeV3 ~= nil) then | |
1611 | BvlMesh.Scale = Vector3.new(sizeV3.x/2, sizeV3.y/2, sizeV3.z); | |
1612 | else | |
1613 | BvlMesh.Scale = Vector3.new(part.Size.x/2, part.Size.y/2, part.Size.z); | |
1614 | end | |
1615 | end | |
1616 | ||
1617 | ||
1618 | ||
1619 | local Scale = 0.5 -- 1 is size of a robloxian (mostly); | |
1620 | ||
1621 | Storage.Name = "ä"; | |
1622 | ||
1623 | local BasePart = new("Part"); | |
1624 | BasePart.FormFactor = "Custom"; | |
1625 | BasePart.TopSurface = 10; | |
1626 | BasePart.BottomSurface = 10; | |
1627 | BasePart.LeftSurface = 10; | |
1628 | BasePart.RightSurface = 10; | |
1629 | BasePart.FrontSurface = 10; | |
1630 | BasePart.BackSurface = 10; | |
1631 | ||
1632 | local CylPart = new("Part"); | |
1633 | CylPart.FormFactor = "Custom"; | |
1634 | CylPart.TopSurface = 10; | |
1635 | CylPart.BottomSurface = 10; | |
1636 | CylPart.LeftSurface = 10; | |
1637 | CylPart.RightSurface = 10; | |
1638 | CylPart.FrontSurface = 10; | |
1639 | CylPart.BackSurface = 10; | |
1640 | new("CylinderMesh", CylPart); | |
1641 | ||
1642 | local TopFrame = BasePart:clone() | |
1643 | TopFrame.Parent = Storage; | |
1644 | TopFrame.Size = Vector3.new(3.5*Scale, 1.5*Scale, 3.5*Scale); | |
1645 | TopFrame.BrickColor = TeamColor; | |
1646 | ||
1647 | new("CylinderMesh", TopFrame); | |
1648 | ||
1649 | local Screw = CylPart:clone(); | |
1650 | Screw.Parent = Storage; | |
1651 | Screw.Size = Vector3.new(.3*Scale, 1.6*Scale, .3*Scale); | |
1652 | Screw.BrickColor = BrickColor.new(199); | |
1653 | ||
1654 | local CGreyStyle = CylPart:clone() | |
1655 | CGreyStyle.Parent = Storage; | |
1656 | CGreyStyle.Size = Vector3.new(2.2*Scale, 1.52*Scale, 2.6*Scale); | |
1657 | CGreyStyle.BrickColor = BrickColor.new(199); | |
1658 | ||
1659 | local TurretCasing = BasePart:clone(); | |
1660 | TurretCasing.Size = Vector3.new(2.2*Scale, 1.4*Scale, 5.6*Scale); | |
1661 | TurretCasing.BrickColor = BrickColor.new(199); | |
1662 | TurretCasing.Parent = Storage; | |
1663 | ||
1664 | Bevel(TurretCasing); | |
1665 | ||
1666 | local TurretFront = BasePart:clone(); | |
1667 | TurretFront.Size = Vector3.new(1.7*Scale, 1*Scale, .2*Scale); | |
1668 | TurretFront.BrickColor = TeamColor; | |
1669 | TurretFront.Parent = Storage; | |
1670 | ||
1671 | local Barrel = CylPart:clone(); | |
1672 | Barrel.Parent = Storage; | |
1673 | Barrel.Size = Vector3.new(.7*Scale, .4*Scale, .7*Scale); | |
1674 | Barrel.BrickColor = BrickColor.Black(); | |
1675 | ||
1676 | ||
1677 | local Particle = Instance.new("ParticleEmitter", Barrel); | |
1678 | Particle.VelocitySpread = 30; | |
1679 | Particle.LightEmission = 200; | |
1680 | ||
1681 | local Colors = {Color3.new(1,.5,0), Color3.new(1,.7,0), Color3.new(1,.9,0);} | |
1682 | ||
1683 | Particle.Size = NumberSequence.new(.05,.07); | |
1684 | ||
1685 | Particle.Color = ColorSequence.new(Colors[math.random(#Colors)]); | |
1686 | Particle.Texture = "rbxassetid://252350680"; | |
1687 | Particle.RotSpeed = NumberRange.new(10,70); | |
1688 | Particle.Rate = 300; | |
1689 | Particle.Speed = NumberRange.new(15); | |
1690 | Particle.Transparency = NumberSequence.new(0,1); | |
1691 | Particle.Lifetime = NumberRange.new(.01,.2); | |
1692 | Particle.Enabled = false | |
1693 | ||
1694 | ||
1695 | ||
1696 | local RedDot = BasePart:clone(); | |
1697 | RedDot.Parent = Storage; | |
1698 | RedDot.Size = Vector3.new(.2*Scale, .2*Scale, .2*Scale); | |
1699 | RedDot.BrickColor = BrickColor.new("Really red"); | |
1700 | ||
1701 | local Sphere = Instance.new("SpecialMesh", RedDot); | |
1702 | Sphere.MeshType = "Sphere"; | |
1703 | Sphere.Scale = Vector3.new(1*Scale,1*Scale,1*Scale); | |
1704 | ||
1705 | ||
1706 | Bevel(TurretFront, Vector3.new(1.7*Scale, 1*Scale, .05*Scale)); | |
1707 | ||
1708 | local Joint = CylPart:clone(); | |
1709 | Joint.Parent = Storage; | |
1710 | Joint.Size = Vector3.new(.7*Scale, 2*Scale, .7*Scale); | |
1711 | Joint.BrickColor = BrickColor.Black(); | |
1712 | ||
1713 | local Hold = BasePart:clone(); | |
1714 | Hold.Parent = Storage; | |
1715 | Hold.BrickColor = BrickColor.Black(); | |
1716 | Hold.Size = Vector3.new(2.2*Scale, .2*Scale, .75*Scale); | |
1717 | ||
1718 | local Bolt = BasePart:clone(); | |
1719 | Bolt.Size = Vector3.new(.2*Scale, 1.5*Scale, .5*Scale); | |
1720 | Bolt.Parent = Storage; | |
1721 | Bolt.BrickColor = BrickColor.Black(); | |
1722 | ||
1723 | local Bolt2 = BasePart:clone(); | |
1724 | Bolt2.Size = Vector3.new(.2*Scale, 1.5*Scale, .5*Scale); | |
1725 | Bolt2.Parent = Storage; | |
1726 | Bolt2.BrickColor = BrickColor.Black(); | |
1727 | ||
1728 | ||
1729 | local TurretToFrame = WeldP(TopFrame, TurretCasing, CFrame.new(0, 0, 1.4*Scale)); | |
1730 | WeldP(TopFrame, CGreyStyle); | |
1731 | WeldP(TurretCasing, TurretFront, CFrame.new(0, 0, 2.8*Scale)); | |
1732 | WeldP(TopFrame, Screw); | |
1733 | local BarrelWeld = WeldP(Barrel, TurretFront, CFrame.new(.3*Scale, -.2*Scale, 0), CFrame.Angles(math.pi/2, 0, 0)); | |
1734 | ||
1735 | WeldP(RedDot, TurretFront, CFrame.new(-.55*Scale, 0, -.15*Scale), CFrame.Angles(math.pi/2, 0, 0)); | |
1736 | ||
1737 | local RotateAxisY = WeldP(Bolt, TurretCasing, CFrame.Angles(0,0,0), CFrame.new(1.1*Scale, -.75*Scale, 1*Scale)); | |
1738 | ||
1739 | WeldP(Bolt, Hold, CFrame.new(-1.1*Scale, -.5*Scale, 0)); | |
1740 | ||
1741 | WeldP(Bolt2, Hold, CFrame.new(1.1*Scale, -.5*Scale, 0)); | |
1742 | ||
1743 | local RotateAxisX = WeldP(Hold, Joint, CFrame.new(0, -1*Scale, 0)); | |
1744 | ||
1745 | ||
1746 | ||
1747 | local Leg1 = BasePart:clone(); | |
1748 | Leg1.Size = Vector3.new(.2*Scale, 3.5*Scale, .5*Scale); | |
1749 | Leg1.Parent = Storage; | |
1750 | Leg1.BrickColor = BrickColor.Black(); | |
1751 | ||
1752 | ||
1753 | WeldP(Leg1, Joint, CFrame.new(0, -1.75*Scale, 0), CFrame.new(0, -.75*Scale, 0) * CFrame.Angles(math.pi/3, 0, math.pi)); | |
1754 | ||
1755 | ||
1756 | local Leg2 = BasePart:clone(); | |
1757 | Leg2.Size = Vector3.new(.2*Scale, 3.5*Scale, .5*Scale); | |
1758 | Leg2.Parent = Storage; | |
1759 | Leg2.BrickColor = BrickColor.Black(); | |
1760 | ||
1761 | ||
1762 | WeldP(Leg2, Joint, CFrame.new(0, -1.75*Scale, 0), CFrame.new(0, -.45*Scale, 0) * CFrame.Angles(-math.pi/4, 0, math.pi + -math.pi/6)); | |
1763 | ||
1764 | ||
1765 | local Leg3 = BasePart:clone(); | |
1766 | Leg3.Size = Vector3.new(.2*Scale, 3.5*Scale, .5*Scale); | |
1767 | Leg3.Parent = Storage; | |
1768 | Leg3.BrickColor = BrickColor.Black(); | |
1769 | ||
1770 | ||
1771 | WeldP(Leg3, Joint, CFrame.new(0, -1.75*Scale, 0), CFrame.new(0, -.45*Scale, 0) * CFrame.Angles(-math.pi/4, 0, math.pi + math.pi/6)); | |
1772 | ||
1773 | for i,v in pairs(Storage:children()) do | |
1774 | if v.Name== "Part" then | |
1775 | trans = 1 | |
1776 | v.Transparency = 1 | |
1777 | end | |
1778 | end | |
1779 | ||
1780 | local InvisiBox = BasePart:clone(); | |
1781 | InvisiBox.Size = Storage:GetModelSize() + Vector3.new(2*Scale, 0, 0); | |
1782 | InvisiBox.Parent = Storage; | |
1783 | InvisiBox.Transparency = 1 | |
1784 | InvisiBox.Name = 'box' | |
1785 | WeldP(InvisiBox, Joint, CFrame.new(0, -.2*Scale, .97*Scale)); | |
1786 | ||
1787 | local InvisiBox2 = BasePart:clone(); | |
1788 | InvisiBox2.Size = Storage:GetModelSize() + Vector3.new(2*Scale, 0, 0); | |
1789 | InvisiBox2.Parent = Arms; | |
1790 | InvisiBox2.Transparency = .9 | |
1791 | InvisiBox2.Name = 'box' | |
1792 | InvisiBox2.CanCollide = false | |
1793 | InvisiBox2.BrickColor = TeamColor | |
1794 | InvisiBox2.Material = 'Neon' | |
1795 | WeldP(InvisiBox2, Joint, CFrame.new(0, -1.2*Scale, .97*Scale)); | |
1796 | ||
1797 | InvisiBox.CFrame = torso.CFrame * CFrame.new(0, 5.5*Scale, -2.9) * CFrame.Angles(0, math.pi, 0); | |
1798 | ||
1799 | local Action = "Idle"; | |
1800 | ||
1801 | local Target = nil; | |
1802 | ||
1803 | wait(1) | |
1804 | ||
1805 | InvisiBox.Anchored = true | |
1806 | ||
1807 | for i,v in pairs(Storage:children()) do | |
1808 | if v:IsA'Part' then | |
1809 | v.Locked = true | |
1810 | end | |
1811 | end | |
1812 | --// | |
1813 | --// SOUNDS | |
1814 | --// | |
1815 | for i,v in pairs(Storage:children()) do | |
1816 | if v.Name== "Part" then | |
1817 | trans = 1 | |
1818 | v.Transparency = 1 | |
1819 | end | |
1820 | end | |
1821 | for i,v in pairs(Storage:children()) do | |
1822 | if v.Name== "Part" then | |
1823 | trans = 1 | |
1824 | v.Transparency = 1 | |
1825 | for i = 1,11 do | |
1826 | ||
1827 | trans = trans - .1 | |
1828 | v.Transparency = trans | |
1829 | wait() | |
1830 | end | |
1831 | end | |
1832 | end | |
1833 | trans = 1 | |
1834 | ||
1835 | local OnFind = new("Sound", TopFrame); | |
1836 | OnFind.SoundId = "rbxassetid://10209260" | |
1837 | OnFind.Volume = 1 | |
1838 | ||
1839 | ||
1840 | local OnFire = new("Sound", TopFrame); | |
1841 | OnFire.SoundId = "rbxassetid://10209257" | |
1842 | OnFire.Volume = 1 | |
1843 | ||
1844 | local OnEmpty = new("Sound", TopFrame); | |
1845 | OnEmpty.SoundId = "rbxassetid://10209225" | |
1846 | OnEmpty.Volume = 1 | |
1847 | ||
1848 | local Scanning = new("Sound", TopFrame); | |
1849 | Scanning.SoundId = "rbxassetid://258704234" | |
1850 | Scanning.Volume = 1 | |
1851 | ||
1852 | local Explode = new("Sound", TopFrame); | |
1853 | Explode.SoundId = "rbxassetid://10209236" | |
1854 | Explode.Volume = .5 | |
1855 | ||
1856 | local Move = new("Sound", TopFrame); | |
1857 | Move.SoundId = "rbxassetid://258704467"; | |
1858 | Move.Volume = 1; | |
1859 | ||
1860 | ||
1861 | ||
1862 | ||
1863 | ||
1864 | function FindShortest(Table) | |
1865 | local Current = Table[1] | |
1866 | local Final | |
1867 | for _,v in pairs(Table) do | |
1868 | if v[2] ~= Current[2] then | |
1869 | if v[1] < Current[1] then | |
1870 | Current = v | |
1871 | end | |
1872 | end | |
1873 | end | |
1874 | Final = Current | |
1875 | return Final | |
1876 | end | |
1877 | ||
1878 | function GetNearbyPlayer() | |
1879 | ||
1880 | local List = {} | |
1881 | for i,v in pairs(workspace:children()) do | |
1882 | if (v ~= nil) then | |
1883 | if (v:IsA'Model') then | |
1884 | if (v:findFirstChild'Torso' ~= nil) then | |
1885 | local rx, ry, rz = Hold.CFrame:toEulerAnglesXYZ(); | |
1886 | if (v:findFirstChild'Torso'.Position - Hold.CFrame * CFrame.new(0, 0, 20) * CFrame.Angles(0, ry, 0).p).magnitude < 20 then | |
1887 | if (v ~= char) then | |
1888 | for x,z in next, v:children() do | |
1889 | if z:IsA'Humanoid' and z.Health > 0.01 then | |
1890 | table.insert(List, {(v:findFirstChild'Torso'.Position - Hold.CFrame * CFrame.new(0, 0, 20) * CFrame.Angles(0, ry, 0).p).magnitude, v}) | |
1891 | end | |
1892 | end | |
1893 | end | |
1894 | end | |
1895 | end | |
1896 | end | |
1897 | end | |
1898 | end | |
1899 | if (FindShortest(List) ~= nil) then | |
1900 | return FindShortest(List)[2]; | |
1901 | else | |
1902 | return nil; | |
1903 | end | |
1904 | end | |
1905 | ||
1906 | local Health = Instance.new("Humanoid", Storage); | |
1907 | Health.MaxHealth = 150; | |
1908 | Health.Health = 150; | |
1909 | ||
1910 | ||
1911 | ||
1912 | function RayC(Part, speed) | |
1913 | coroutine.wrap(function() | |
1914 | local Visual = BasePart:clone(); | |
1915 | Visual.FormFactor = "Custom"; | |
1916 | Visual.BrickColor = BrickColor.Yellow(); | |
1917 | Visual.Size = Vector3.new(.2, 3, .2); | |
1918 | Visual.CFrame = Part.CFrame * CFrame.new(0, -1, 0); | |
1919 | Visual.Anchored = true; | |
1920 | Visual.CanCollide = false; | |
1921 | Visual.Locked = true | |
1922 | ||
1923 | ||
1924 | coroutine.wrap(function() | |
1925 | ||
1926 | wait(.2) | |
1927 | ||
1928 | wait(.1); | |
1929 | wait(.3) | |
1930 | ||
1931 | end)() | |
1932 | ||
1933 | Instance.new("SpecialMesh", Visual).MeshType = "Sphere"; | |
1934 | Visual.Mesh.Scale = Vector3.new(.5, 1, .5); | |
1935 | ||
1936 | local bulletpos = Visual.Position | |
1937 | local bulletvelocity = (Part.CFrame.p - bulletpos).unit*speed | |
1938 | local lastbulletpos = Visual.Position | |
1939 | Visual.Parent = Storage; | |
1940 | while game:service'RunService'.Stepped:wait() do | |
1941 | ||
1942 | lastbulletpos = bulletpos | |
1943 | bulletpos = bulletpos + bulletvelocity | |
1944 | local RayCast = Ray.new(lastbulletpos, (bulletpos - lastbulletpos)) | |
1945 | local hit, hitpos = workspace:FindPartOnRay(RayCast, Storage, false, true) | |
1946 | if (Joint.Position - Visual.Position).magnitude > 1000 or Visual.Parent == nil then | |
1947 | Visual:Destroy(); | |
1948 | break | |
1949 | end | |
1950 | Visual.Anchored = true | |
1951 | Visual.CFrame = CFrame.new(bulletpos, bulletpos+bulletvelocity) * CFrame.Angles(math.pi/2, 0, 0); | |
1952 | if hit then | |
1953 | if hit.Parent:IsA'Hat' then | |
1954 | if hit.Parent.Parent:IsA'Model' then | |
1955 | for x,z in next, hit.Parent.Parent:children() do | |
1956 | if z:IsA'Humanoid' then | |
1957 | z:TakeDamage(math.random(8,12)); | |
1958 | end | |
1959 | end | |
1960 | end | |
1961 | else | |
1962 | if hit.Parent:IsA'Model' then | |
1963 | for x,z in next, hit.Parent:children() do | |
1964 | if z:IsA'Humanoid' then | |
1965 | z:TakeDamage(math.random(8,12)); | |
1966 | end | |
1967 | end | |
1968 | end | |
1969 | end | |
1970 | ||
1971 | Visual:Destroy(); | |
1972 | break | |
1973 | end | |
1974 | end | |
1975 | end)() | |
1976 | end | |
1977 | ||
1978 | lastTick = tick(); | |
1979 | local db = false; | |
1980 | game:service'RunService'.RenderStepped:connect(function() | |
1981 | if Action == "DEAD" then return end; | |
1982 | ||
1983 | ||
1984 | if not Wrangler then | |
1985 | --// | |
1986 | --// AUTOMATED MODE, MOTION SENSOR WILL DETECT MOVEMENT | |
1987 | --// | |
1988 | ||
1989 | ||
1990 | --// | |
1991 | --// IF PLAYER USED WRANGLER, THERE IS A SHIELD WICH MUST BE REMOVED | |
1992 | --// | |
1993 | ||
1994 | if (Storage:findFirstChild'Shield') then | |
1995 | Storage:findFirstChild'Shield':Destroy(); | |
1996 | end | |
1997 | ||
1998 | local LastTarget = Target; | |
1999 | ||
2000 | --// | |
2001 | --// CHECK FOR NEARBY ENEMIES | |
2002 | --// | |
2003 | local Player = GetNearbyPlayer(); | |
2004 | Target = Player; | |
2005 | ||
2006 | --// | |
2007 | --// BEEP ON TARGET FOUND | |
2008 | --// | |
2009 | if (Target ~= LastTarget and Target ~= nil) then | |
2010 | Move.Pitch = 0.9 + math.random()/9; | |
2011 | Move:play(); | |
2012 | OnFind:play(); | |
2013 | Action = "Standby"; | |
2014 | end | |
2015 | ||
2016 | --// | |
2017 | --// IDLE | |
2018 | --// | |
2019 | if Action == "Idle" then | |
2020 | RotateAxisX.C1 = clerp(RotateAxisX.C1, CFrame.Angles(0, SharpSin(tick()*2)*.2, 0), .1); | |
2021 | RotateAxisY.C0 = clerp(RotateAxisY.C0, CFrame.new(), .1); | |
2022 | end | |
2023 | ||
2024 | ||
2025 | --// | |
2026 | --// SENTRY DEAD | |
2027 | --// | |
2028 | ||
2029 | --// | |
2030 | --// IF PLAYER EXISTS, FIRE! | |
2031 | --// | |
2032 | ||
2033 | ||
2034 | ||
2035 | if Action == "Standby" then | |
2036 | pcall(function() | |
2037 | local tor = Target.Torso.CFrame.p -- Target CFrame | |
2038 | local direction = InvisiBox.CFrame.lookVector -- Direction handling, welds mess up, just a workaround. | |
2039 | local heading = math.atan2(direction.x, direction.z)-- | |
2040 | local RotY = math.deg(heading) | |
2041 | if RotY < 0 then | |
2042 | RotY = (360 - math.abs(RotY)); | |
2043 | end | |
2044 | RotateAxisX.C1 = --Begin here | |
2045 | clerp(RotateAxisX.C1, | |
2046 | CFrame.new( | |
2047 | ||
2048 | Vector3.new(), --The Pivot0 of pointing the weld. | |
2049 | Vector3.new(tor.x, 0, tor.z) - Vector3.new(RotateAxisX.Part1.CFrame.x, 0, RotateAxisX.Part1.CFrame.z)) --We point the sentry here | |
2050 | ||
2051 | * CFrame.Angles(0, math.rad(360) - math.rad(RotY), 0), | |
2052 | .1 | |
2053 | ); | |
2054 | ||
2055 | local Point = Hold.CFrame:toObjectSpace(CFrame.new(Hold.CFrame.p,tor))*CFrame.Angles(0,math.rad(180),0) | |
2056 | local RX, RY, RZ = Point:toEulerAnglesXYZ() | |
2057 | if math.deg(RX) > 45 then | |
2058 | RX = math.rad(45) | |
2059 | elseif math.deg(RX) < -55 then | |
2060 | RX = math.rad(-55) | |
2061 | end | |
2062 | RotateAxisY.C0 = clerp(RotateAxisY.C0,CFrame.Angles(RX,0,0),.1) | |
2063 | ||
2064 | end) | |
2065 | end | |
2066 | if Action == "Fire" then | |
2067 | pcall(function() | |
2068 | local tor = Target.Torso.CFrame.p; | |
2069 | local direction = InvisiBox.CFrame.lookVector | |
2070 | local heading = math.atan2(direction.x, direction.z) | |
2071 | local RotY = math.deg(heading) | |
2072 | if RotY < 0 then | |
2073 | RotY = (360 - math.abs(RotY)); | |
2074 | end | |
2075 | RotateAxisX.C1 = --Begin here | |
2076 | clerp(RotateAxisX.C1, | |
2077 | CFrame.new( | |
2078 | ||
2079 | Vector3.new(), --The Pivot0 of pointing the weld. | |
2080 | Vector3.new(tor.x, 0, tor.z) - Vector3.new(RotateAxisX.Part1.CFrame.x, 0, RotateAxisX.Part1.CFrame.z)) --We point the sentry here | |
2081 | ||
2082 | * CFrame.Angles(0, math.rad(360) - math.rad(RotY), 0), | |
2083 | .1 | |
2084 | ); | |
2085 | ||
2086 | BarrelWeld.C0 = clerp(BarrelWeld.C0, CFrame.new()) | |
2087 | local Point = Hold.CFrame:toObjectSpace(CFrame.new(Hold.CFrame.p,tor))*CFrame.Angles(0,math.rad(180),0) | |
2088 | local RX, RY, RZ = Point:toEulerAnglesXYZ() | |
2089 | if math.deg(RX) > 45 then | |
2090 | RX = math.rad(45) | |
2091 | elseif math.deg(RX) < -55 then | |
2092 | RX = math.rad(-55) | |
2093 | end | |
2094 | RotateAxisY.C0 = clerp(RotateAxisY.C0,CFrame.Angles(RX,0,0),.1) | |
2095 | end) | |
2096 | end | |
2097 | ||
2098 | if (Target ~= nil) then | |
2099 | if Action == "Fire" or db then return end | |
2100 | if Action == "Standby" then | |
2101 | db = true | |
2102 | wait(.2); | |
2103 | end | |
2104 | Action = "Fire"; | |
2105 | db = false | |
2106 | OnFire:play(); | |
2107 | ||
2108 | Particle.Color = ColorSequence.new(Colors[math.random(#Colors)]); | |
2109 | ||
2110 | local PointLight = Instance.new("PointLight", Barrel); | |
2111 | PointLight.Color = Color3.new(1,.8,0) | |
2112 | PointLight.Brightness = 6; | |
2113 | Particle.Enabled = true | |
2114 | game:service'Debris':AddItem(PointLight, .05); | |
2115 | ||
2116 | ||
2117 | ||
2118 | RayC(Barrel, 20) | |
2119 | ||
2120 | ||
2121 | ||
2122 | ||
2123 | wait(.1) | |
2124 | Particle.Enabled = false | |
2125 | if (Target ~= nil) then | |
2126 | Action = "Standby"; | |
2127 | else | |
2128 | Action = "Idle"; | |
2129 | end | |
2130 | end | |
2131 | ||
2132 | if tick() - lastTick > 2.5 and Target == nil then | |
2133 | lastTick = tick(); | |
2134 | Scanning:play(); | |
2135 | end | |
2136 | end | |
2137 | ||
2138 | if (Health.Health < 0.0001 or RotateAxisX.Parent == nil) then | |
2139 | Action = "DEAD"; | |
2140 | if db then return end | |
2141 | RotateAxisY:Destroy(); | |
2142 | TurretToFrame:Destroy(); | |
2143 | Joint:Destroy(); | |
2144 | InvisiBox2:Destroy(); | |
2145 | db = true | |
2146 | local expl = Instance.new("Explosion", Storage); | |
2147 | ||
2148 | expl.BlastRadius = .3; | |
2149 | expl.BlastPressure = 2050000; | |
2150 | expl.Position = TopFrame.Position; | |
2151 | Explode:Play() | |
2152 | NoSentry = true | |
2153 | game:service'Debris':AddItem(Storage, 3); | |
2154 | ||
2155 | end | |
2156 | ||
2157 | end) | |
2158 | end | |
2159 | ||
2160 | ||
2161 | ||
2162 | combo = 0 | |
2163 | function strike(hit) | |
2164 | if hit and hit.Parent and hit.Parent.Name ~= char.Name then | |
2165 | local targetHumanoid = hit.Parent:FindFirstChild("Humanoid") | |
2166 | if targetHumanoid and targetHumanoid ~= char:FindFirstChild("Humanoid") then | |
2167 | if combo == 1 then | |
2168 | targetHumanoid:TakeDamage(slashDamage) | |
2169 | SwingH:Play() | |
2170 | ||
2171 | end | |
2172 | ||
2173 | ||
2174 | ||
2175 | end | |
2176 | end | |
2177 | end | |
2178 | ||
2179 | ||
2180 | ||
2181 | Reaper5.Touched:connect(strike) | |
2182 | -------------------------------------------------------------------------------------------------------------------------- | |
2183 | function AnimSit() | |
2184 | for i = 0, 1, 0.05 do | |
2185 | ||
2186 | swait() | |
2187 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, -1, -.6) * angles(math.rad(0), math.rad(0), math.rad(0)), .1) | |
2188 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(0), math.rad(0), math.rad(0)), .1) | |
2189 | LW.C0 = clerp(LW.C0, CFrame.new(-1.3, 0.3, .1) * angles(math.rad(20), math.rad(0), math.rad(20)), 0.1) | |
2190 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, -.1) * angles(math.rad(0), math.rad(0), math.rad(5)), 0.1) | |
2191 | RH.C0 = clerp(RH.C0, cn(1, -.4, -.4) * RHCF * angles(math.rad(-2), math.rad(5), math.rad(0)), .1) | |
2192 | LH.C0 = clerp(LH.C0, cn(-1, -1, -.6) * LHCF * angles(math.rad(-2), math.rad(5), math.rad(60)), .1) | |
2193 | end | |
2194 | ||
2195 | end | |
2196 | ||
2197 | function AnimSitHit1() | |
2198 | for i = 0, 1, 0.05 do | |
2199 | ||
2200 | swait() | |
2201 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, -1, -.6) * angles(math.rad(10), math.rad(0), math.rad(0)), .1) | |
2202 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(5), math.rad(0), math.rad(0)), .1) | |
2203 | LW.C0 = clerp(LW.C0, CFrame.new(-1.3, 0.3, .1) * angles(math.rad(20), math.rad(0), math.rad(20)), 0.1) | |
2204 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, -.1) * angles(math.rad(170), math.rad(0), math.rad(-5)), 0.08) | |
2205 | RH.C0 = clerp(RH.C0, cn(1, -.4, -.4) * RHCF * angles(math.rad(-2), math.rad(5), math.rad(10)), .1) | |
2206 | LH.C0 = clerp(LH.C0, cn(-1, -1, -.6) * LHCF * angles(math.rad(-2), math.rad(5), math.rad(50)), .1) | |
2207 | end | |
2208 | ||
2209 | end | |
2210 | ||
2211 | ||
2212 | function AnimSitHit2() | |
2213 | for i = 0, 1, 0.05 do | |
2214 | ||
2215 | swait() | |
2216 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, -1, -.6) * angles(math.rad(0), math.rad(0), math.rad(0)), .1) | |
2217 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(15), math.rad(0), math.rad(0)), .1) | |
2218 | LW.C0 = clerp(LW.C0, CFrame.new(-1.3, 0.3, .1) * angles(math.rad(20), math.rad(0), math.rad(20)), 0.1) | |
2219 | RW.C0 = clerp(RW.C0, CFrame.new(1.55, 0.4, -.1) * angles(math.rad(40), math.rad(3 ), math.rad(-15)), 0.3) | |
2220 | RH.C0 = clerp(RH.C0, cn(1, -.4, -.4) * RHCF * angles(math.rad(-2), math.rad(5), math.rad(0)), .1) | |
2221 | LH.C0 = clerp(LH.C0, cn(-1, -1, -.6) * LHCF * angles(math.rad(-2), math.rad(5), math.rad(60)), .1) | |
2222 | end | |
2223 | ||
2224 | end | |
2225 | -------------------------------------------------------------------------------------------------------------------------- | |
2226 | ||
2227 | function No1() | |
2228 | for i = 0, 1, 0.05 do | |
2229 | ||
2230 | swait() | |
2231 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0,0,0) * angles(math.rad(0), math.rad(0), math.rad(0)), .1) | |
2232 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(30), math.rad(0), math.rad(40)), .1) | |
2233 | LW.C0 = clerp(LW.C0, CFrame.new(-1.3, 0.5, -.1) * angles(math.rad(0), math.rad(0), math.rad(0)), 0.1) | |
2234 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, -.1) * angles(math.rad(30), math.rad(0), math.rad(0)), 0.1) | |
2235 | RH.C0 = clerp(RH.C0, cn(1, -1, 0) * RHCF * angles(math.rad(-2), math.rad(5), math.rad(0)), .1) | |
2236 | LH.C0 = clerp(LH.C0, cn(-1, -1, 0) * LHCF * angles(math.rad(-2), math.rad(5), math.rad(0)), .1) | |
2237 | end | |
2238 | ||
2239 | end | |
2240 | ||
2241 | ||
2242 | ||
2243 | function No2() | |
2244 | for i = 0, 1, 0.05 do | |
2245 | ||
2246 | swait() | |
2247 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0,0,0) * angles(math.rad(0), math.rad(0), math.rad(0)), .1) | |
2248 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(0), math.rad(0), math.rad(-40)), .1) | |
2249 | LW.C0 = clerp(LW.C0, CFrame.new(-1.3, 0.5, -.1) * angles(math.rad(0), math.rad(0), math.rad(0)), 0.1) | |
2250 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, -.1) * angles(math.rad(30), math.rad(0), math.rad(0)), 0.1) | |
2251 | RH.C0 = clerp(RH.C0, cn(1, -1, 0) * RHCF * angles(math.rad(-2), math.rad(5), math.rad(0)), .1) | |
2252 | LH.C0 = clerp(LH.C0, cn(-1, -1, 0) * LHCF * angles(math.rad(-2), math.rad(5), math.rad(0)), .1) | |
2253 | end | |
2254 | ||
2255 | end | |
2256 | ||
2257 | ||
2258 | ||
2259 | -------------------------------------------------------------------------------------------------------------------------- | |
2260 | ||
2261 | function Yes1() | |
2262 | for i = 0, 1, 0.1 do | |
2263 | ||
2264 | swait() | |
2265 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0,0,0) * angles(math.rad(0), math.rad(0), math.rad(0)), .1) | |
2266 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(25), math.rad(0), math.rad(0)), .1) | |
2267 | LW.C0 = clerp(LW.C0, CFrame.new(-1.3, 0.5, -.1) * angles(math.rad(0), math.rad(0), math.rad(0)), 0.1) | |
2268 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, -.1) * angles(math.rad(30), math.rad(0), math.rad(0)), 0.1) | |
2269 | RH.C0 = clerp(RH.C0, cn(1, -1, 0) * RHCF * angles(math.rad(-2), math.rad(5), math.rad(0)), .1) | |
2270 | LH.C0 = clerp(LH.C0, cn(-1, -1, 0) * LHCF * angles(math.rad(-2), math.rad(5), math.rad(0)), .1) | |
2271 | end | |
2272 | ||
2273 | end | |
2274 | ||
2275 | ||
2276 | ||
2277 | function Yes2() | |
2278 | for i = 0, 1, 0.1 do | |
2279 | ||
2280 | swait() | |
2281 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0,0,0) * angles(math.rad(0), math.rad(0), math.rad(0)), .1) | |
2282 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(-5), math.rad(0), math.rad(0)), .1) | |
2283 | LW.C0 = clerp(LW.C0, CFrame.new(-1.3, 0.5, -.1) * angles(math.rad(0), math.rad(0), math.rad(0)), 0.1) | |
2284 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, -.1) * angles(math.rad(30), math.rad(0), math.rad(0)), 0.1) | |
2285 | RH.C0 = clerp(RH.C0, cn(1, -1, 0) * RHCF * angles(math.rad(-2), math.rad(5), math.rad(0)), .1) | |
2286 | LH.C0 = clerp(LH.C0, cn(-1, -1, 0) * LHCF * angles(math.rad(-2), math.rad(5), math.rad(0)), .1) | |
2287 | end | |
2288 | ||
2289 | end | |
2290 | ||
2291 | ||
2292 | ||
2293 | -------------------------------------------------------------------------------------------------------------------------- | |
2294 | function AttackAnim1() | |
2295 | for i = 0, 1, 0.05 do | |
2296 | swait() | |
2297 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(-5), math.rad(0), math.rad(0)), .1) | |
2298 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(5), math.rad(0), math.rad(0)), .1) | |
2299 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, -.1) * angles(math.rad(170), math.rad(0), math.rad(10)), 0.08) | |
2300 | LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(40), math.rad(0), math.rad(10)), 0.3) | |
2301 | if Torsovelocity > 2 then | |
2302 | RH.C0 = clerp(RH.C0, cn(1, -1 + .1 * math.cos(sine / 5), 0) * RHCF * angles(math.rad(-2), math.rad(0), math.rad(30 * math.cos(sine / 4))), .3) | |
2303 | LH.C0 = clerp(LH.C0, cn(-1, -1 + .1 * math.cos(sine / 5), 0) * LHCF * angles(math.rad(-2), math.rad(0), math.rad(30 * math.cos(sine / 4))), .3) | |
2304 | elseif Torsovelocity < 1 then | |
2305 | RH.C0 = clerp(RH.C0, cn(1, -1, 0) * RHCF * angles(math.rad(-2), math.rad(5), math.rad(-5)), .1) | |
2306 | LH.C0 = clerp(LH.C0, cn(-1, -1, 0) * LHCF * angles(math.rad(-2), math.rad(5), math.rad(5)), .1) | |
2307 | end | |
2308 | end | |
2309 | end | |
2310 | ||
2311 | ||
2312 | function AttackAnim2() | |
2313 | for i = 0, 1, 0.05 do | |
2314 | swait() | |
2315 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(5), math.rad(0), math.rad(0)), .2) | |
2316 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(5), math.rad(0), math.rad(0)), .1) | |
2317 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, -.1) * angles(math.rad(5), math.rad(10), math.rad(-10)), 0.25) | |
2318 | LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(20), math.rad(0), math.rad(10)), 0.3) | |
2319 | if Torsovelocity > 2 then | |
2320 | RH.C0 = clerp(RH.C0, cn(1, -.9 + -.1 * math.cos(sine / 4),0 + -.1 * math.cos(sine / 4)) * RHCF * angles(math.rad(-2), math.rad(0), math.rad(50 * math.cos(sine / 4))), .3) | |
2321 | LH.C0 = clerp(LH.C0, cn(-1, -.9 + .1 * math.cos(sine / 4), 0 + .1 * math.cos(sine / 4)) * LHCF * angles(math.rad(-2), math.rad(0), math.rad(50 * math.cos(sine / 4))), .3) | |
2322 | ||
2323 | elseif Torsovelocity < 1 then | |
2324 | RH.C0 = clerp(RH.C0, cn(1, -1, 0) * RHCF * angles(math.rad(-2), math.rad(5), math.rad(5)), .1) | |
2325 | LH.C0 = clerp(LH.C0, cn(-1, -1, 0) * LHCF * angles(math.rad(-2), math.rad(5), math.rad(-5)), .1) | |
2326 | end | |
2327 | end | |
2328 | end | |
2329 | -------------------------------------------------------------------------------------------------------------------------- | |
2330 | ||
2331 | ||
2332 | ||
2333 | function ShotAttackAnim1() | |
2334 | for i = 0, 1, 0.07 do | |
2335 | swait() | |
2336 | ||
2337 | if Torsovelocity > 2 then | |
2338 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.05 + .1 * math.cos(sine / 3)) * angles(math.rad(5), math.rad(0) + RootPart.RotVelocity.Y / 30, math.rad(-50 - 5 * math.cos(sine / 5))), .2) | |
2339 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(-3), math.rad(0), math.rad(50 + 5 * math.cos(sine / 5)) + RootPart.RotVelocity.Y / 9), .2) | |
2340 | RW.C0 = clerp(RW.C0, CFrame.new(1.2, 0.5, 0) * angles(math.rad(90), math.rad(0 - .01 * math.cos(sine / 25)), math.rad(-40 + 0.1 * math.cos(sine / 25))), 0.2) | |
2341 | LW.C0 = clerp(LW.C0, CFrame.new(-1.2, 0.4, -.4) * angles(math.rad(85 + 1 * math.cos(sine / 25)), math.rad(15), math.rad(-10 - 1 * math.cos(sine / 25))), 0.2) | |
2342 | RH.C0 = clerp(RH.C0, cn(.9, -.9 + -.1 * math.cos(sine / 4),-.6) * RHCF * angles(math.rad(-2), math.rad(50), math.rad(50 * math.cos(sine / 4))), .3) | |
2343 | LH.C0 = clerp(LH.C0, cn(-.9, -.9 + .1 * math.cos(sine / 4), .5) * LHCF * angles(math.rad(-2), math.rad(50), math.rad(50 * math.cos(sine / 4))), .3) | |
2344 | ||
2345 | ||
2346 | ||
2347 | elseif Torsovelocity < 1 then | |
2348 | ||
2349 | ||
2350 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(-50)), .2) | |
2351 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(0), math.rad(0), math.rad(50)), .2) | |
2352 | RW.C0 = clerp(RW.C0, CFrame.new(1.2, 0.5, 0) * angles(math.rad(90), math.rad(0 - .01 * math.cos(sine / 25)), math.rad(-40 + 0.1 * math.cos(sine / 25))), 0.2) | |
2353 | LW.C0 = clerp(LW.C0, CFrame.new(-1.2, 0.4, -.4) * angles(math.rad(85 + 1 * math.cos(sine / 25)), math.rad(15), math.rad(-10 - 1 * math.cos(sine / 25))), 0.2) | |
2354 | RH.C0 = clerp(RH.C0, cn(.9, -.9 - 0.1 * math.cos(sine / 25), -.6) * RHCF * angles(math.rad(-2 + 1 * math.cos(sine / 25)), math.rad(50), math.rad(10 + 2 * math.cos(sine / 25))), .2) | |
2355 | LH.C0 = clerp(LH.C0, cn(-.9, -.9 - 0.1 * math.cos(sine / 25), .5) * LHCF * angles(math.rad(-2 + 1 * math.cos(sine / 25)), math.rad(50), math.rad(10 + 2 * math.cos(sine / 25))), .2) | |
2356 | ||
2357 | ||
2358 | end | |
2359 | end | |
2360 | end | |
2361 | ||
2362 | ||
2363 | ||
2364 | ||
2365 | ||
2366 | function ShotAttackAnim2() | |
2367 | for i = 0, 1, 0.05 do | |
2368 | swait() | |
2369 | ||
2370 | if Torsovelocity > 2 then | |
2371 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.05 + .1 * math.cos(sine / 3)) * angles(math.rad(5), math.rad(0) + RootPart.RotVelocity.Y / 30, math.rad(-50 - 5 * math.cos(sine / 5))), .2) | |
2372 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(-3), math.rad(0), math.rad(50 + 5 * math.cos(sine / 5)) + RootPart.RotVelocity.Y / 9), .2) | |
2373 | RW.C0 = clerp(RW.C0, CFrame.new(1.2, 0.5, 0) * angles(math.rad(100), math.rad(0 - .01 * math.cos(sine / 25)), math.rad(-40 + 0.1 * math.cos(sine / 25))), 0.1) | |
2374 | LW.C0 = clerp(LW.C0, CFrame.new(-1.2, 0.4, -.4) * angles(math.rad(75 + 1 * math.cos(sine / 25)), math.rad(15), math.rad(-10 - 1 * math.cos(sine / 25))), 0.1) | |
2375 | RH.C0 = clerp(RH.C0, cn(.9, -.9 + -.1 * math.cos(sine / 4),-.6) * RHCF * angles(math.rad(-2), math.rad(50), math.rad(50 * math.cos(sine / 4))), .3) | |
2376 | LH.C0 = clerp(LH.C0, cn(-.9, -.9 + .1 * math.cos(sine / 4), .5) * LHCF * angles(math.rad(-2), math.rad(50), math.rad(50 * math.cos(sine / 4))), .3) | |
2377 | ||
2378 | ||
2379 | ||
2380 | elseif Torsovelocity < 1 then | |
2381 | ||
2382 | ||
2383 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(-50)), .2) | |
2384 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(0), math.rad(0), math.rad(50)), .2) | |
2385 | RW.C0 = clerp(RW.C0, CFrame.new(1.2, 0.5, 0) * angles(math.rad(100), math.rad(0 - .01 * math.cos(sine / 25)), math.rad(-40 + 0.1 * math.cos(sine / 25))), 0.1) | |
2386 | LW.C0 = clerp(LW.C0, CFrame.new(-1.2, 0.4, -.4) * angles(math.rad(75 + 1 * math.cos(sine / 25)), math.rad(15), math.rad(-10 - 1 * math.cos(sine / 25))), 0.1) | |
2387 | RH.C0 = clerp(RH.C0, cn(.9, -.9 - 0.1 * math.cos(sine / 25), -.6) * RHCF * angles(math.rad(-2 + 1 * math.cos(sine / 25)), math.rad(50), math.rad(10 + 2 * math.cos(sine / 25))), .2) | |
2388 | LH.C0 = clerp(LH.C0, cn(-.9, -.9 - 0.1 * math.cos(sine / 25), .5) * LHCF * angles(math.rad(-2 + 1 * math.cos(sine / 25)), math.rad(50), math.rad(10 + 2 * math.cos(sine / 25))), .2) | |
2389 | ||
2390 | ||
2391 | end | |
2392 | end | |
2393 | end | |
2394 | ||
2395 | ||
2396 | ||
2397 | function ShotAttackAnim3() | |
2398 | for i = 0, 1, 0.05 do | |
2399 | swait() | |
2400 | ||
2401 | if Torsovelocity > 2 then | |
2402 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.05 + .1 * math.cos(sine / 3)) * angles(math.rad(5), math.rad(0) + RootPart.RotVelocity.Y / 30, math.rad(-50 - 5 * math.cos(sine / 5))), .2) | |
2403 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(-3), math.rad(0), math.rad(50 + 5 * math.cos(sine / 5)) + RootPart.RotVelocity.Y / 9), .2) | |
2404 | RW.C0 = clerp(RW.C0, CFrame.new(1.2, 0.56, -.2) * angles(math.rad(45), math.rad(-20 - .01 * math.cos(sine / 25)), math.rad(-70 + 0.1 * math.cos(sine / 25))), 0.2) | |
2405 | LW.C0 = clerp(LW.C0, CFrame.new(-1.2, 0.6, -.6) * angles(math.rad(115 + 1 * math.cos(sine / 25)), math.rad(15), math.rad(-30 - 1 * math.cos(sine / 25))), 0.2) | |
2406 | RH.C0 = clerp(RH.C0, cn(.9, -.9 + -.1 * math.cos(sine / 4),-.6) * RHCF * angles(math.rad(-2), math.rad(50), math.rad(50 * math.cos(sine / 4))), .3) | |
2407 | LH.C0 = clerp(LH.C0, cn(-.9, -.9 + .1 * math.cos(sine / 4), .5) * LHCF * angles(math.rad(-2), math.rad(50), math.rad(50 * math.cos(sine / 4))), .3) | |
2408 | ||
2409 | ||
2410 | ||
2411 | elseif Torsovelocity < 1 then | |
2412 | ||
2413 | ||
2414 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(-50)), .2) | |
2415 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(0), math.rad(0), math.rad(50)), .2) | |
2416 | RW.C0 = clerp(RW.C0, CFrame.new(1.2, 0.56, -.2) * angles(math.rad(45), math.rad(-20 - .01 * math.cos(sine / 25)), math.rad(-70 + 0.1 * math.cos(sine / 25))), 0.2) | |
2417 | LW.C0 = clerp(LW.C0, CFrame.new(-1.2, 0.6, -.6) * angles(math.rad(115 + 1 * math.cos(sine / 25)), math.rad(15), math.rad(-30 - 1 * math.cos(sine / 25))), 0.2) | |
2418 | RH.C0 = clerp(RH.C0, cn(.9, -.9 - 0.1 * math.cos(sine / 25), -.6) * RHCF * angles(math.rad(-2 + 1 * math.cos(sine / 25)), math.rad(50), math.rad(10 + 2 * math.cos(sine / 25))), .2) | |
2419 | LH.C0 = clerp(LH.C0, cn(-.9, -.9 - 0.1 * math.cos(sine / 25), .5) * LHCF * angles(math.rad(-2 + 1 * math.cos(sine / 25)), math.rad(50), math.rad(10 + 2 * math.cos(sine / 25))), .2) | |
2420 | ||
2421 | ||
2422 | end | |
2423 | end | |
2424 | end | |
2425 | ||
2426 | function ShotAttackAnim4() | |
2427 | for i = 0, 1, 0.05 do | |
2428 | swait() | |
2429 | ||
2430 | if Torsovelocity > 2 then | |
2431 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.05 + .1 * math.cos(sine / 3)) * angles(math.rad(5), math.rad(0) + RootPart.RotVelocity.Y / 30, math.rad(-50 - 5 * math.cos(sine / 5))), .2) | |
2432 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(-3), math.rad(0), math.rad(50 + 5 * math.cos(sine / 5)) + RootPart.RotVelocity.Y / 9), .2) | |
2433 | RW.C0 = clerp(RW.C0, CFrame.new(1.2, 0.56, 0) * angles(math.rad(45), math.rad(-20 - .01 * math.cos(sine / 25)), math.rad(-70 + 0.1 * math.cos(sine / 25))), 0.2) | |
2434 | LW.C0 = clerp(LW.C0, CFrame.new(-1.2, 0.6, -.8) * angles(math.rad(115 + 1 * math.cos(sine / 25)), math.rad(15), math.rad(-50 - 1 * math.cos(sine / 25))), 0.2) | |
2435 | RH.C0 = clerp(RH.C0, cn(.9, -.9 + -.1 * math.cos(sine / 4),-.6) * RHCF * angles(math.rad(-2), math.rad(50), math.rad(50 * math.cos(sine / 4))), .3) | |
2436 | LH.C0 = clerp(LH.C0, cn(-.9, -.9 + .1 * math.cos(sine / 4), .5) * LHCF * angles(math.rad(-2), math.rad(50), math.rad(50 * math.cos(sine / 4))), .3) | |
2437 | ||
2438 | ||
2439 | ||
2440 | elseif Torsovelocity < 1 then | |
2441 | ||
2442 | ||
2443 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(-50)), .2) | |
2444 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(0), math.rad(0), math.rad(50)), .2) | |
2445 | RW.C0 = clerp(RW.C0, CFrame.new(1.2, 0.56, 0) * angles(math.rad(45), math.rad(-20 - .01 * math.cos(sine / 25)), math.rad(-70 + 0.1 * math.cos(sine / 25))), 0.2) | |
2446 | LW.C0 = clerp(LW.C0, CFrame.new(-1.2, 0.6, -.8) * angles(math.rad(115 + 1 * math.cos(sine / 25)), math.rad(15), math.rad(-50 - 1 * math.cos(sine / 25))), 0.2) | |
2447 | RH.C0 = clerp(RH.C0, cn(.9, -.9 - 0.1 * math.cos(sine / 25), -.6) * RHCF * angles(math.rad(-2 + 1 * math.cos(sine / 25)), math.rad(50), math.rad(10 + 2 * math.cos(sine / 25))), .2) | |
2448 | LH.C0 = clerp(LH.C0, cn(-.9, -.9 - 0.1 * math.cos(sine / 25), .5) * LHCF * angles(math.rad(-2 + 1 * math.cos(sine / 25)), math.rad(50), math.rad(10 + 2 * math.cos(sine / 25))), .2) | |
2449 | ||
2450 | ||
2451 | end | |
2452 | end | |
2453 | end | |
2454 | -------------------------------------------------------------------------------------------------------------------------- | |
2455 | ||
2456 | function DanAni1() | |
2457 | for i = 0, .8, 0.05 + MusThingHat.Mesh.Scale.Y*0.025 do | |
2458 | ||
2459 | swait() | |
2460 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0,0,-.4) * angles(math.rad(5), math.rad(-8), math.rad(0)), MusThingHat.Mesh.Scale.Y*0.2) | |
2461 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(MusThingHat.Mesh.Scale.Y*30) +math.rad(-10),0,math.rad(0)),MusThingHat.Mesh.Scale.Y*0.2) | |
2462 | LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, -.25) * angles(math.rad(170), math.rad(0), math.rad(20)), MusThingHat.Mesh.Scale.Y*0.2) | |
2463 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, -.0) * angles(math.rad(90), math.rad(0), math.rad(-45)), MusThingHat.Mesh.Scale.Y*0.2) | |
2464 | RH.C0 = clerp(RH.C0, cn(1, -.2, -.4) * RHCF * angles(math.rad(-4), math.rad(-15), math.rad(-5)), MusThingHat.Mesh.Scale.Y*0.3) | |
2465 | LH.C0 = clerp(LH.C0, cn(-1, -1, -.0) * LHCF * angles(math.rad(4), math.rad(5), math.rad(5)), MusThingHat.Mesh.Scale.Y*0.2) | |
2466 | end | |
2467 | ||
2468 | end | |
2469 | ||
2470 | ||
2471 | ||
2472 | function DanAni2() | |
2473 | for i = 0, .8, 0.05 + MusThingHat.Mesh.Scale.Y*0.025 do | |
2474 | ||
2475 | swait() | |
2476 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0,0,-.5) * angles(math.rad(8), math.rad(8), math.rad(0)), MusThingHat.Mesh.Scale.Y*0.2) | |
2477 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(MusThingHat.Mesh.Scale.Y*30) +math.rad(-10),0,math.rad(0)),MusThingHat.Mesh.Scale.Y*0.2) | |
2478 | LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.6, -.25) * angles(math.rad(180), math.rad(0), math.rad(25)), MusThingHat.Mesh.Scale.Y*0.2) | |
2479 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, -.0) * angles(math.rad(0), math.rad(0), math.rad(45)), MusThingHat.Mesh.Scale.Y*0.2) | |
2480 | RH.C0 = clerp(RH.C0, cn(1, -1, -.0) * RHCF * angles(math.rad(4), math.rad(-5), math.rad(-8)), MusThingHat.Mesh.Scale.Y*0.2) | |
2481 | LH.C0 = clerp(LH.C0, cn(-1, -.2, -.4) * LHCF * angles(math.rad(-4), math.rad(15), math.rad(8)), MusThingHat.Mesh.Scale.Y*0.3) | |
2482 | end | |
2483 | ||
2484 | ||
2485 | end | |
2486 | ||
2487 | ||
2488 | ||
2489 | -------------------------------------------------------------------------------------------------------------------------- | |
2490 | ||
2491 | BuildNow = false | |
2492 | ||
2493 | Shotuse = false | |
2494 | ||
2495 | wait2 = false | |
2496 | ||
2497 | mouse.KeyDown:connect(function(key) | |
2498 | ||
2499 | if key == "g" and attack == false then | |
2500 | yes:Play() | |
2501 | head.face.Texture = "http://www.roblox.com/asset/?id=393521316" | |
2502 | humanoid.WalkSpeed = 0 | |
2503 | attack = true | |
2504 | Yes1() | |
2505 | Yes2() | |
2506 | Yes1() | |
2507 | Yes2() | |
2508 | attack = false | |
2509 | humanoid.WalkSpeed = 16 | |
2510 | head.face.Texture = "http://www.roblox.com/asset/?id=156600391" | |
2511 | end | |
2512 | end) | |
2513 | ||
2514 | ||
2515 | mouse.KeyDown:connect(function(key) | |
2516 | if key == "e" and attack == false then | |
2517 | if Wep == 1 then | |
2518 | Wep = 2 | |
2519 | else | |
2520 | Wep = 1 | |
2521 | end | |
2522 | ||
2523 | ||
2524 | end | |
2525 | end) | |
2526 | ||
2527 | mouse.KeyDown:connect(function(key) | |
2528 | if key == "p" and attack == false then | |
2529 | ||
2530 | Wep = 3 | |
2531 | ||
2532 | ||
2533 | ||
2534 | end | |
2535 | end) | |
2536 | ||
2537 | ||
2538 | ||
2539 | ||
2540 | ||
2541 | ||
2542 | ||
2543 | ||
2544 | ||
2545 | ||
2546 | ||
2547 | ||
2548 | equippedgun = true | |
2549 | ||
2550 | ||
2551 | ||
2552 | ||
2553 | coroutine.wrap(function() | |
2554 | while equippedgun do | |
2555 | ||
2556 | if spread < 0 then spread = 0 end | |
2557 | if humanoid.Health == 0 then break end | |
2558 | ||
2559 | ||
2560 | game:service'RunService'.Stepped:wait() | |
2561 | end | |
2562 | end)() | |
2563 | ||
2564 | mouse.Button1Down:connect(function() | |
2565 | if debounce then return end | |
2566 | if equippedgun2 == true and attack == false then | |
2567 | Shotuse = true | |
2568 | debounce = true | |
2569 | ||
2570 | wait(.2) | |
2571 | ||
2572 | sound:play() | |
2573 | ||
2574 | ||
2575 | ||
2576 | coroutine.wrap(function() | |
2577 | wait(0.3) | |
2578 | for angle = 0, 4 do | |
2579 | ||
2580 | wait() | |
2581 | end | |
2582 | ||
2583 | wait(0.2) | |
2584 | sound2:play() | |
2585 | ||
2586 | ||
2587 | wait(0.1) | |
2588 | for move = 0, 3 do | |
2589 | if move > 2 then return end | |
2590 | ||
2591 | ||
2592 | wait(0.06) | |
2593 | end | |
2594 | end)() | |
2595 | spread = spread + 1 | |
2596 | coroutine.wrap(function() | |
2597 | for bullitz = 0, 7 do | |
2598 | if bullitz > 6 then return end | |
2599 | rayCast2(300, 1, Reaper4) | |
2600 | GunParticle.Enabled = true | |
2601 | local PointLight = Instance.new("PointLight", Reaper4); | |
2602 | PointLight.Color = Color3.new(.2,.2,0) | |
2603 | PointLight.Brightness = 2; | |
2604 | game:service'Debris':AddItem(PointLight, .05); | |
2605 | end | |
2606 | end)() | |
2607 | coroutine.wrap(function() | |
2608 | for _ = 0, 50 do | |
2609 | pcall(function() | |
2610 | spread = spread - 0.03 | |
2611 | end) | |
2612 | wait() | |
2613 | end | |
2614 | end)() | |
2615 | wait(1) | |
2616 | debounce = false | |
2617 | end | |
2618 | ||
2619 | end) | |
2620 | ||
2621 | ||
2622 | ||
2623 | ||
2624 | ||
2625 | ||
2626 | ||
2627 | ||
2628 | ||
2629 | mouse.Button1Down:connect(function(key) | |
2630 | ||
2631 | if attack == false and Wep == 1 then | |
2632 | attack = true | |
2633 | ||
2634 | AttackAnim1() | |
2635 | combo = 1 | |
2636 | Swing:Play() | |
2637 | AttackAnim2() | |
2638 | attack = false | |
2639 | combo = 0 | |
2640 | end | |
2641 | end) | |
2642 | ||
2643 | ||
2644 | ||
2645 | mouse.KeyDown:connect(function(key) | |
2646 | ||
2647 | if key == "f" and attack == false then | |
2648 | No:Play() | |
2649 | humanoid.WalkSpeed = 0 | |
2650 | attack = true | |
2651 | No1() | |
2652 | No2() | |
2653 | attack = false | |
2654 | humanoid.WalkSpeed = 16 | |
2655 | end | |
2656 | end) | |
2657 | ||
2658 | ||
2659 | ||
2660 | ||
2661 | mouse.KeyDown:connect(function(key) | |
2662 | if attack == false or DA == true then | |
2663 | if key == "r" and Wep == 3 then | |
2664 | ||
2665 | if DA == false then | |
2666 | DA = true | |
2667 | RUS:Play() | |
2668 | attack=true | |
2669 | humanoid.WalkSpeed = 0 | |
2670 | head.face.Texture = "http://www.roblox.com/asset/?id=393521316" | |
2671 | else | |
2672 | DA = false | |
2673 | RUS:Stop() | |
2674 | attack=false | |
2675 | humanoid.WalkSpeed = 16 | |
2676 | head.face.Texture = "http://www.roblox.com/asset/?id=156600391" | |
2677 | end | |
2678 | end | |
2679 | end | |
2680 | end) | |
2681 | ||
2682 | ||
2683 | ||
2684 | mouse.KeyDown:connect(function(key) | |
2685 | ||
2686 | if key == "t" and attack == false then | |
2687 | Taunt:Play() | |
2688 | humanoid.WalkSpeed = 0 | |
2689 | attack = true | |
2690 | No1() | |
2691 | Yes2() | |
2692 | attack = false | |
2693 | humanoid.WalkSpeed = 16 | |
2694 | end | |
2695 | end) | |
2696 | ||
2697 | mouse.KeyDown:connect(function(key) | |
2698 | if key == "z" then | |
2699 | ||
2700 | ||
2701 | ||
2702 | if NoSentry == false and attack == false and wait2 == false then | |
2703 | wait2 = true | |
2704 | for i,v in pairs(script:children()) do | |
2705 | if (v:IsA'Model') then | |
2706 | ||
2707 | ||
2708 | for i,v in pairs(v:children()) do | |
2709 | if (v:IsA'Humanoid') then | |
2710 | v.Health = 0 | |
2711 | end | |
2712 | end | |
2713 | ||
2714 | ||
2715 | end | |
2716 | ||
2717 | NoSentry = true | |
2718 | ||
2719 | end | |
2720 | ||
2721 | ||
2722 | ||
2723 | end | |
2724 | ||
2725 | ||
2726 | ||
2727 | if NoSentry == true and attack == false and wait2 == false and Wep == 1 then | |
2728 | attack = true | |
2729 | wait2 = true | |
2730 | humanoid.WalkSpeed = 0 | |
2731 | AnimSit() | |
2732 | AnimSitHit1() | |
2733 | WSH = WSHM[math.random(1,#WSHM)] | |
2734 | HitM.SoundId = "rbxassetid://"..WSH | |
2735 | HitM:Play() | |
2736 | BuildNow = true | |
2737 | AnimSitHit2() | |
2738 | AnimSitHit1() | |
2739 | WSH = WSHM[math.random(1,#WSHM)] | |
2740 | HitM.SoundId = "rbxassetid://"..WSH | |
2741 | HitM:Play() | |
2742 | AnimSitHit2() | |
2743 | AnimSitHit1() | |
2744 | WSH = WSHM[math.random(1,#WSHM)] | |
2745 | HitM.SoundId = "rbxassetid://"..WSH | |
2746 | HitM:Play() | |
2747 | AnimSitHit2() | |
2748 | AnimSitHit1() | |
2749 | WSH = WSHM[math.random(1,#WSHM)] | |
2750 | HitM.SoundId = "rbxassetid://"..WSH | |
2751 | HitM:Play() | |
2752 | AnimSitHit2() | |
2753 | AnimSitHit1() | |
2754 | WSH = WSHM[math.random(1,#WSHM)] | |
2755 | HitM.SoundId = "rbxassetid://"..WSH | |
2756 | HitM:Play() | |
2757 | AnimSitHit2() | |
2758 | AnimSitHit1() | |
2759 | WSH = WSHM[math.random(1,#WSHM)] | |
2760 | HitM.SoundId = "rbxassetid://"..WSH | |
2761 | HitM:Play() | |
2762 | AnimSitHit2() | |
2763 | AnimSitHit1() | |
2764 | WSH = WSHM[math.random(1,#WSHM)] | |
2765 | HitM.SoundId = "rbxassetid://"..WSH | |
2766 | HitM:Play() | |
2767 | AnimSitHit2() | |
2768 | AnimSitHit1() | |
2769 | WSH = WSHM[math.random(1,#WSHM)] | |
2770 | HitM.SoundId = "rbxassetid://"..WSH | |
2771 | HitM:Play() | |
2772 | AnimSitHit2() | |
2773 | AnimSitHit1() | |
2774 | WSH = WSHM[math.random(1,#WSHM)] | |
2775 | HitM.SoundId = "rbxassetid://"..WSH | |
2776 | HitM:Play() | |
2777 | AnimSitHit2() | |
2778 | AnimSitHit1() | |
2779 | WSH = WSHM[math.random(1,#WSHM)] | |
2780 | HitM.SoundId = "rbxassetid://"..WSH | |
2781 | HitM:Play() | |
2782 | AnimSitHit2() | |
2783 | AnimSit() | |
2784 | ||
2785 | humanoid.WalkSpeed = 16 | |
2786 | attack = false | |
2787 | NoSentry = false | |
2788 | ||
2789 | end | |
2790 | wait() | |
2791 | ||
2792 | wait2 = false | |
2793 | end end) | |
2794 | ||
2795 | ||
2796 | ||
2797 | humanoid.Died:connect(function() | |
2798 | Arms:Destroy() | |
2799 | end) | |
2800 | ||
2801 | print([[ | |
2802 | ||
2803 | ||
2804 | ---------------------------------------- | |
2805 | Tf2 Engineer Class | |
2806 | ---------------------------------------- | |
2807 | Script by: 123jl123 | |
2808 | Sentry by: Madiik | |
2809 | TheBoozled gave me a Mesh and Sounds from tf2 | |
2810 | ---------------------------------------- | |
2811 | Dont leak and dont do it..... | |
2812 | ---------------------------------------- | |
2813 | ]]) | |
2814 | ||
2815 | game:GetService("RunService"):BindToRenderStep("ew", 0, function() | |
2816 | MusThingHat.Mesh.Scale = Vector3.new(MusThingHat.Mesh.Scale.X, RUS.PlaybackLoudness / 160, MusThingHat.Mesh.Scale.Z) | |
2817 | end) | |
2818 | ||
2819 | local mesh1anan = Instance.new("SpecialMesh") | |
2820 | mesh1anan.MeshType = Enum.MeshType.FileMesh | |
2821 | mesh1anan.Scale = Vector3.new(3,3,3) | |
2822 | mesh1anan.MeshId = "http://www.roblox.com/asset/?id=521754610" | |
2823 | mesh1anan.TextureId = "http://www.roblox.com/asset/?id=521754612" | |
2824 | ||
2825 | Glow1 = Color3.new(1,1,1) | |
2826 | Glow2 = Color3.new(0,0,0) | |
2827 | ||
2828 | GlowParticle = Instance.new("ParticleEmitter") | |
2829 | GlowParticle.LightEmission = 1 | |
2830 | ||
2831 | GlowParticle.Size = NumberSequence.new(0,2) | |
2832 | GlowParticle.Texture = "http://www.roblox.com/asset/?id=52620985" | |
2833 | GlowParticle.Transparency = NumberSequence.new(0,1) | |
2834 | GlowParticle.LockedToPart = false | |
2835 | GlowParticle.Lifetime = NumberRange.new(0.5) | |
2836 | GlowParticle.Rate= 25 | |
2837 | GlowParticle.Speed =NumberRange.new(0) | |
2838 | ||
2839 | ||
2840 | function RainDucks() | |
2841 | local locationanan = char.Torso.CFrame | |
2842 | local tacoa = Instance.new("Part") | |
2843 | tacoa.Size = Vector3.new(.5,.5,.5) | |
2844 | tacoa.CanCollide = false | |
2845 | tacoa.RotVelocity = Vector3.new(math.random(0,6),math.random(0,6),math.random(0,6)) | |
2846 | local meshanananan = mesh1anan:clone() | |
2847 | meshanananan.Parent = tacoa | |
2848 | meshanananan.Scale = Vector3.new(1,1,1) | |
2849 | tacoa.CFrame = locationanan * CFrame.new(math.random(-8,8),math.random(10,40),math.random(-8,8)) | |
2850 | tacoa.Parent = workspace | |
2851 | ||
2852 | ||
2853 | game:GetService("Debris"):AddItem(tacoa,4) | |
2854 | local GP = GlowParticle:clone() | |
2855 | GP.Parent = tacoa | |
2856 | Glow1 = Color3.new(math.random(), math.random(), math.random()) | |
2857 | GP.Color = ColorSequence.new(Glow1,Glow2) | |
2858 | ||
2859 | end | |
2860 | ||
2861 | ||
2862 | ||
2863 | --]] | |
2864 | ||
2865 | ||
2866 | ||
2867 | while true do wait() | |
2868 | if BuildNow == true then | |
2869 | BuildNow = false | |
2870 | ||
2871 | BuildSentry() | |
2872 | end | |
2873 | if Shotuse == true then | |
2874 | Shotuse = false | |
2875 | attack = true | |
2876 | ShotAttackAnim1() | |
2877 | GunParticle.Enabled = false | |
2878 | ShotAttackAnim2() | |
2879 | ShotAttackAnim3() | |
2880 | ShotAttackAnim4() | |
2881 | ShotAttackAnim3() | |
2882 | attack = false | |
2883 | end | |
2884 | ||
2885 | ||
2886 | ||
2887 | ||
2888 | if DA == true then | |
2889 | DanAni1() | |
2890 | RainDucks() | |
2891 | local PointLight = Instance.new("PointLight", Torso); | |
2892 | PointLight.Color = Color3.new(math.random(), math.random(), math.random()) | |
2893 | PointLight.Brightness = 50; | |
2894 | PointLight.Range = MusThingHat.Mesh.Scale.Y*10; | |
2895 | game:service'Debris':AddItem(PointLight, .3); | |
2896 | ||
2897 | DanAni2() | |
2898 | RainDucks() | |
2899 | local PointLight = Instance.new("PointLight", Torso); | |
2900 | PointLight.Color = Color3.new(math.random(), math.random(), math.random()) | |
2901 | PointLight.Brightness = 50; | |
2902 | PointLight.Range = MusThingHat.Mesh.Scale.Y*10; | |
2903 | game:service'Debris':AddItem(PointLight, .3); | |
2904 | ||
2905 | ||
2906 | ||
2907 | end | |
2908 | ||
2909 | ||
2910 | ||
2911 | ||
2912 | ||
2913 | ||
2914 | end |