Advertisement
Guest User

Untitled

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