AxeuerAlt

Joofil

Jun 30th, 2019
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 36.82 KB | None | 0 0
  1. IT = Instance.new
  2. CF = CFrame.new
  3. VT = Vector3.new
  4. RAD = math.rad
  5. C3 = Color3.new
  6. UD2 = UDim2.new
  7. BRICKC = BrickColor.new
  8. ANGLES = CFrame.Angles
  9. EULER = CFrame.fromEulerAnglesXYZ
  10. COS = math.cos
  11. ACOS = math.acos
  12. SIN = math.sin
  13. ASIN = math.asin
  14. ABS = math.abs
  15. MRANDOM = math.random
  16. FLOOR = math.floor
  17.  
  18. local GYRO = nil
  19. local CHARACTER = script.Parent
  20. local HUMANOID = CHARACTER:FindFirstChildOfClass("Humanoid")
  21. local TORSO = CHARACTER.Torso
  22. local ROOT = CHARACTER.HumanoidRootPart
  23. local RIGHTARM = CHARACTER["Right Arm"]
  24. local LEFTARM = CHARACTER["Left Arm"]
  25. local RIGHTLEG = CHARACTER["Right Leg"]
  26. local LEFTLEG = CHARACTER["Left Leg"]
  27. RootJoint = ROOT["Root"]
  28. Neck = TORSO["Head"]
  29. RightShoulder = TORSO["RArm"]
  30. LeftShoulder = TORSO["LArm"]
  31. RightHip = TORSO["RLeg"]
  32. LeftHip = TORSO["LLeg"]
  33. local BODY = {}
  34. local CHAIR = CHARACTER.Wheelchair
  35. for index, CHILD in pairs(CHARACTER:GetDescendants()) do
  36. if (CHILD:IsA("BasePart") or CHILD:IsA("Decal") or CHILD:IsA("Beam")) and CHILD ~= ROOT and CHILD ~= CHAIR then
  37. table.insert(BODY,CHILD)
  38. end
  39. end
  40. local ATTACKING = false
  41. if script:FindFirstChild("Color") then
  42. script.Color.Parent = game.Lighting
  43. end
  44. local HIT = false
  45. local MUSIC = script.Music
  46. local DEAD = false
  47. MUSIC:Play()
  48. local CLUBSMESH = 2761335666
  49. local DIAMONDMESH = 1254392112
  50. local SPADEMESH = 2760895053
  51. local HEARTMESH = 105992239 --VT(3.5,3.5,3.5)
  52. local SCYTHEMESH = 455516381
  53. local SINE = 0
  54. local HITPLAYERSOUNDS = {--[["199149137", "199149186", "199149221", "199149235", "199149269", "199149297"--]]"263032172", "263032182", "263032200", "263032221", "263032252", "263033191"}
  55.  
  56. Debris = game:GetService("Debris")
  57.  
  58. local Effects = IT("Folder",CHARACTER)
  59.  
  60. --//=================================\\
  61. --|| SAZERENOS' ARTIFICIAL HEARTBEAT
  62. --\\=================================//
  63.  
  64. ArtificialHB = Instance.new("BindableEvent", script)
  65. ArtificialHB.Name = "ArtificialHB"
  66.  
  67. script:WaitForChild("ArtificialHB")
  68.  
  69. frame = 1/60
  70. tf = 0
  71. allowframeloss = false
  72. tossremainder = false
  73. lastframe = tick()
  74. script.ArtificialHB:Fire()
  75.  
  76. game:GetService("RunService").Heartbeat:connect(function(s, p)
  77. tf = tf + s
  78. if tf >= frame then
  79. if allowframeloss then
  80. script.ArtificialHB:Fire()
  81. lastframe = tick()
  82. else
  83. for i = 1, math.floor(tf / frame) do
  84. script.ArtificialHB:Fire()
  85. end
  86. lastframe = tick()
  87. end
  88. if tossremainder then
  89. tf = 0
  90. else
  91. tf = tf - frame * math.floor(tf / frame)
  92. end
  93. end
  94. end)
  95.  
  96. function PositiveAngle(NUMBER)
  97. if NUMBER >= 0 then
  98. NUMBER = 0
  99. end
  100. return NUMBER
  101. end
  102.  
  103. function NegativeAngle(NUMBER)
  104. if NUMBER <= 0 then
  105. NUMBER = 0
  106. end
  107. return NUMBER
  108. end
  109.  
  110. function Swait(NUMBER)
  111. if NUMBER == 0 or NUMBER == nil then
  112. ArtificialHB.Event:wait()
  113. else
  114. for i = 1, NUMBER do
  115. ArtificialHB.Event:wait()
  116. end
  117. end
  118. end
  119.  
  120. --//=================================\\
  121. --|| FUNCTIONS
  122. --\\=================================//
  123.  
  124. function CreateMesh(MESH, PARENT, MESHTYPE, MESHID, TEXTUREID, SCALE, OFFSET)
  125. local NEWMESH = IT(MESH)
  126. if MESH == "SpecialMesh" then
  127. NEWMESH.MeshType = MESHTYPE
  128. if MESHID ~= "nil" and MESHID ~= "" then
  129. NEWMESH.MeshId = "http://www.roblox.com/asset/?id="..MESHID
  130. end
  131. if TEXTUREID ~= "nil" and TEXTUREID ~= "" then
  132. NEWMESH.TextureId = "http://www.roblox.com/asset/?id="..TEXTUREID
  133. end
  134. end
  135. NEWMESH.Offset = OFFSET or VT(0, 0, 0)
  136. NEWMESH.Scale = SCALE
  137. NEWMESH.Parent = PARENT
  138. return NEWMESH
  139. end
  140.  
  141. function CreatePart(FORMFACTOR, PARENT, MATERIAL, REFLECTANCE, TRANSPARENCY, BRICKCOLOR, NAME, SIZE, ANCHOR)
  142. local NEWPART = IT("Part")
  143. NEWPART.formFactor = FORMFACTOR
  144. NEWPART.Reflectance = REFLECTANCE
  145. NEWPART.Transparency = TRANSPARENCY
  146. NEWPART.CanCollide = false
  147. NEWPART.Locked = true
  148. NEWPART.Anchored = true
  149. if ANCHOR == false then
  150. NEWPART.Anchored = false
  151. end
  152. NEWPART.BrickColor = BRICKC(tostring(BRICKCOLOR))
  153. NEWPART.Name = NAME
  154. NEWPART.Size = SIZE
  155. NEWPART.Position = TORSO.Position
  156. NEWPART.Material = MATERIAL
  157. NEWPART:BreakJoints()
  158. NEWPART.Parent = PARENT
  159. return NEWPART
  160. end
  161.  
  162. local function weldBetween(a, b)
  163. local weldd = IT("ManualWeld")
  164. weldd.Part0 = a
  165. weldd.Part1 = b
  166. weldd.C0 = CF()
  167. weldd.C1 = b.CFrame:inverse() * a.CFrame
  168. weldd.Parent = a
  169. return weldd
  170. end
  171.  
  172. local S = IT("Sound")
  173. function CreateSound(ID, PARENT, VOLUME, PITCH, DOESLOOP)
  174. local NEWSOUND = nil
  175. coroutine.resume(coroutine.create(function()
  176. NEWSOUND = S:Clone()
  177. NEWSOUND.Parent = PARENT
  178. NEWSOUND.Volume = VOLUME
  179. NEWSOUND.Pitch = PITCH
  180. NEWSOUND.SoundId = "http://www.roblox.com/asset/?id="..ID
  181. NEWSOUND:play()
  182. if DOESLOOP == true then
  183. NEWSOUND.Looped = true
  184. else
  185. repeat wait(1) until NEWSOUND.Playing == false
  186. NEWSOUND:remove()
  187. end
  188. end))
  189. return NEWSOUND
  190. end
  191.  
  192. function Raycast(POSITION, DIRECTION, RANGE, IGNOREDECENDANTS)
  193. return workspace:FindPartOnRay(Ray.new(POSITION, DIRECTION.unit * RANGE), IGNOREDECENDANTS)
  194. end
  195.  
  196. function ApplyDamage(Humanoid,Damage)
  197. Damage = Damage * 1
  198. if Humanoid.Health ~= 0 then
  199. Humanoid.Health = Humanoid.Health - Damage
  200. end
  201. end
  202.  
  203. function ApplyAoE(POSITION,RANGE,MINDMG,MAXDMG,FLING,INSTAKILL)
  204. for index, CHILD in pairs(workspace:GetDescendants()) do
  205. if CHILD.ClassName == "Model" and CHILD ~= CHARACTER then
  206. local HUM = CHILD:FindFirstChildOfClass("Humanoid")
  207. if HUM then
  208. local TORSO = CHILD:FindFirstChild("Torso") or CHILD:FindFirstChild("UpperTorso")
  209. if TORSO then
  210. if (TORSO.Position - POSITION).Magnitude <= RANGE then
  211. if INSTAKILL == true then
  212. CHILD:BreakJoints()
  213. else
  214. local DMG = MRANDOM(MINDMG,MAXDMG)
  215. ApplyDamage(HUM,DMG)
  216. end
  217. if FLING > 0 then
  218. for _, c in pairs(CHILD:GetChildren()) do
  219. if c:IsA("BasePart") then
  220. local bv = Instance.new("BodyVelocity")
  221. bv.maxForce = Vector3.new(1e9, 1e9, 1e9)
  222. bv.velocity = CF(POSITION,TORSO.Position).lookVector*FLING
  223. bv.Parent = c
  224. Debris:AddItem(bv,0.05)
  225. end
  226. end
  227. end
  228. end
  229. end
  230. end
  231. end
  232. end
  233. end
  234.  
  235. --WACKYEFFECT({EffectType = "", Size = VT(1,1,1), Size2 = VT(0,0,0), Transparency = 0, Transparency2 = 1, CFrame = CF(), MoveToPos = nil, RotationX = 0, RotationY = 0, RotationZ = 0, Material = "Neon", Color = C3(1,1,1), SoundID = nil, SoundPitch = nil, SoundVolume = nil})
  236. function WACKYEFFECT(Table)
  237. local TYPE = (Table.EffectType or "Sphere")
  238. local SIZE = (Table.Size or VT(1,1,1))
  239. local ENDSIZE = (Table.Size2 or VT(0,0,0))
  240. local TRANSPARENCY = (Table.Transparency or 0)
  241. local ENDTRANSPARENCY = (Table.Transparency2 or 1)
  242. local CFRAME = (Table.CFrame or TORSO.CFrame)
  243. local MOVEDIRECTION = (Table.MoveToPos or nil)
  244. local ROTATION1 = (Table.RotationX or 0)
  245. local ROTATION2 = (Table.RotationY or 0)
  246. local ROTATION3 = (Table.RotationZ or 0)
  247. local MATERIAL = (Table.Material or "Neon")
  248. local COLOR = (Table.Color or C3(1,1,1))
  249. local TIME = (Table.Time or 45)
  250. local SOUNDID = (Table.SoundID or nil)
  251. local SOUNDPITCH = (Table.SoundPitch or nil)
  252. local SOUNDVOLUME = (Table.SoundVolume or nil)
  253. coroutine.resume(coroutine.create(function()
  254. local PLAYSSOUND = false
  255. local SOUND = nil
  256. local EFFECT = CreatePart(3, Effects, MATERIAL, 0, TRANSPARENCY, BRICKC("Pearl"), "Effect", VT(1,1,1), true)
  257. if SOUNDID ~= nil and SOUNDPITCH ~= nil and SOUNDVOLUME ~= nil then
  258. PLAYSSOUND = true
  259. SOUND = CreateSound(SOUNDID, EFFECT, SOUNDVOLUME, SOUNDPITCH, false)
  260. end
  261. EFFECT.Color = COLOR
  262. local MSH = nil
  263. if TYPE == "Sphere" then
  264. MSH = CreateMesh("SpecialMesh", EFFECT, "Sphere", "", "", SIZE, VT(0,0,0))
  265. elseif TYPE == "Block" or TYPE == "Box" then
  266. MSH = IT("BlockMesh",EFFECT)
  267. MSH.Scale = VT(SIZE.X,SIZE.X,SIZE.X)
  268. elseif TYPE == "Wave" then
  269. MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "20329976", "", SIZE, VT(0,0,-SIZE.X/8))
  270. elseif TYPE == "Ring" then
  271. MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "559831844", "", VT(SIZE.X,SIZE.X,0.1), VT(0,0,0))
  272. elseif TYPE == "Slash" then
  273. MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "662586858", "", VT(SIZE.X/10,0,SIZE.X/10), VT(0,0,0))
  274. elseif TYPE == "Round Slash" then
  275. MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "662585058", "", VT(SIZE.X/10,0,SIZE.X/10), VT(0,0,0))
  276. elseif TYPE == "Swirl" then
  277. MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "1051557", "", SIZE, VT(0,0,0))
  278. elseif TYPE == "Skull" then
  279. MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "4770583", "", SIZE, VT(0,0,0))
  280. elseif TYPE == "Crystal" then
  281. MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "9756362", "", SIZE, VT(0,0,0))
  282. end
  283. if MSH ~= nil then
  284. local MOVESPEED = nil
  285. if MOVEDIRECTION ~= nil then
  286. MOVESPEED = (CFRAME.p - MOVEDIRECTION).Magnitude/TIME
  287. end
  288. local GROWTH = SIZE - ENDSIZE
  289. local TRANS = TRANSPARENCY - ENDTRANSPARENCY
  290. if TYPE == "Block" then
  291. EFFECT.CFrame = CFRAME*ANGLES(RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)))
  292. else
  293. EFFECT.CFrame = CFRAME
  294. end
  295. for LOOP = 1, TIME+1 do
  296. Swait()
  297. MSH.Scale = MSH.Scale - GROWTH/TIME
  298. if TYPE == "Wave" then
  299. MSH.Offset = VT(0,0,-MSH.Scale.X/8)
  300. end
  301. EFFECT.Transparency = EFFECT.Transparency - TRANS/TIME
  302. if TYPE == "Block" then
  303. EFFECT.CFrame = CFRAME*ANGLES(RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)))
  304. else
  305. EFFECT.CFrame = EFFECT.CFrame*ANGLES(RAD(ROTATION1),RAD(ROTATION2),RAD(ROTATION3))
  306. end
  307. if MOVEDIRECTION ~= nil then
  308. local ORI = EFFECT.Orientation
  309. EFFECT.CFrame = CF(EFFECT.Position,MOVEDIRECTION)*CF(0,0,-MOVESPEED)
  310. EFFECT.Orientation = ORI
  311. end
  312. end
  313. if PLAYSSOUND == false then
  314. EFFECT:remove()
  315. else
  316. repeat Swait() until SOUND.Playing == false
  317. EFFECT:remove()
  318. end
  319. else
  320. if PLAYSSOUND == false then
  321. EFFECT:remove()
  322. else
  323. repeat Swait() until SOUND.Playing == false
  324. EFFECT:remove()
  325. end
  326. end
  327. end))
  328. end
  329.  
  330. function Transparent(CY)
  331. for E = 1, #BODY do
  332. if BODY[E].ClassName ~= "Beam" then
  333. BODY[E].Transparency = CY
  334. else
  335. BODY[E].Transparency = NumberSequence.new(CY)
  336. end
  337. end
  338. end
  339.  
  340. --//=================================\\
  341. --|| CLERPING
  342. --\\=================================//
  343.  
  344. function QuaternionFromCFrame(cf)
  345. local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
  346. local trace = m00 + m11 + m22
  347. if trace > 0 then
  348. local s = math.sqrt(1 + trace)
  349. local recip = 0.5 / s
  350. return (m21 - m12) * recip, (m02 - m20) * recip, (m10 - m01) * recip, s * 0.5
  351. else
  352. local i = 0
  353. if m11 > m00 then
  354. i = 1
  355. end
  356. if m22 > (i == 0 and m00 or m11) then
  357. i = 2
  358. end
  359. if i == 0 then
  360. local s = math.sqrt(m00 - m11 - m22 + 1)
  361. local recip = 0.5 / s
  362. return 0.5 * s, (m10 + m01) * recip, (m20 + m02) * recip, (m21 - m12) * recip
  363. elseif i == 1 then
  364. local s = math.sqrt(m11 - m22 - m00 + 1)
  365. local recip = 0.5 / s
  366. return (m01 + m10) * recip, 0.5 * s, (m21 + m12) * recip, (m02 - m20) * recip
  367. elseif i == 2 then
  368. local s = math.sqrt(m22 - m00 - m11 + 1)
  369. local recip = 0.5 / s return (m02 + m20) * recip, (m12 + m21) * recip, 0.5 * s, (m10 - m01) * recip
  370. end
  371. end
  372. end
  373.  
  374. function QuaternionToCFrame(px, py, pz, x, y, z, w)
  375. local xs, ys, zs = x + x, y + y, z + z
  376. local wx, wy, wz = w * xs, w * ys, w * zs
  377. local xx = x * xs
  378. local xy = x * ys
  379. local xz = x * zs
  380. local yy = y * ys
  381. local yz = y * zs
  382. local zz = z * zs
  383. 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))
  384. end
  385.  
  386. function QuaternionSlerp(a, b, t)
  387. local cosTheta = a[1] * b[1] + a[2] * b[2] + a[3] * b[3] + a[4] * b[4]
  388. local startInterp, finishInterp;
  389. if cosTheta >= 0.0001 then
  390. if (1 - cosTheta) > 0.0001 then
  391. local theta = ACOS(cosTheta)
  392. local invSinTheta = 1 / SIN(theta)
  393. startInterp = SIN((1 - t) * theta) * invSinTheta
  394. finishInterp = SIN(t * theta) * invSinTheta
  395. else
  396. startInterp = 1 - t
  397. finishInterp = t
  398. end
  399. else
  400. if (1 + cosTheta) > 0.0001 then
  401. local theta = ACOS(-cosTheta)
  402. local invSinTheta = 1 / SIN(theta)
  403. startInterp = SIN((t - 1) * theta) * invSinTheta
  404. finishInterp = SIN(t * theta) * invSinTheta
  405. else
  406. startInterp = t - 1
  407. finishInterp = t
  408. end
  409. end
  410. 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
  411. end
  412.  
  413. function Clerp(a, b, t)
  414. local qa = {QuaternionFromCFrame(a)}
  415. local qb = {QuaternionFromCFrame(b)}
  416. local ax, ay, az = a.x, a.y, a.z
  417. local bx, by, bz = b.x, b.y, b.z
  418. local _t = 1 - t
  419. return QuaternionToCFrame(_t * ax + t * bx, _t * ay + t * by, _t * az + t * bz, QuaternionSlerp(qa, qb, t))
  420. end
  421.  
  422. function ClerpBody(TABLE,PRIORITY)
  423. if PRIORITY == "Attack" or ATTACKING == false then
  424. RootJoint.C1 = Clerp(RootJoint.C1, TABLE[1], 0.35)
  425. if HIT == false then
  426. Neck.C1 = Clerp(Neck.C1, TABLE[2], 0.35)
  427. end
  428. RightShoulder.C1 = Clerp(RightShoulder.C1, TABLE[3], 0.35)
  429. LeftShoulder.C1 = Clerp(LeftShoulder.C1, TABLE[4], 0.35)
  430. RightHip.C1 = Clerp(RightHip.C1, TABLE[5], 0.35)
  431. LeftHip.C1 = Clerp(LeftHip.C1, TABLE[6], 0.35)
  432. end
  433. end
  434.  
  435. --//=================================\\
  436. --|| ATRIFICIAL INTELLIGENCE
  437. --\\=================================//
  438.  
  439. local GoTo = function(TO)
  440. CHARACTER:SetPrimaryPartCFrame(Clerp(ROOT.CFrame,CF(ROOT.Position,TO),0.5)*CF(0,0,-HUMANOID.WalkSpeed/32))
  441. CHARACTER:SetPrimaryPartCFrame(CF(ROOT.Position)*ANGLES(0,RAD(ROOT.Orientation.Y),0))
  442. end
  443.  
  444. function TestForTarget(PRT,target)
  445. local to = true
  446. if PRT then
  447. if PRT:FindFirstAncestorOfClass("Model") == target.Parent then
  448. to = false
  449. end
  450. end
  451. return to
  452. end
  453.  
  454. function ChaosOrAnything()
  455. local PLAY = {ROOT.MeDoAnything,ROOT.ChaosChaos}
  456. PLAY[MRANDOM(1,2)]:Play()
  457. end
  458.  
  459. function OhOhOh(TARGET)
  460. local FOE = TARGET.Torso
  461. if FOE then
  462. ATTACKING = true
  463. ChaosOrAnything()
  464. local E = 0
  465. repeat
  466. Swait()
  467. E = E + 1
  468. ClerpBody({
  469. CF(0,-E/25,0)*ANGLES(RAD(0),RAD(0),RAD(0)),
  470. CF(0,-0.5,0)*ANGLES(RAD(15),RAD(0),RAD(0))*CF(0,-1,0),
  471. CF(0,0.5,0)*ANGLES(RAD(-120),RAD(0),RAD(35))*CF(-1.5,-0.5,0),
  472. CF(0,0.5,0)*ANGLES(RAD(-120),RAD(0),RAD(-35))*CF(1.5,-0.5,0),
  473. CF(-0,0.5,0)*ANGLES(RAD(15),RAD(0),RAD(0))*CF(-0.5,1,0.5),
  474. CF(0,0.5,0)*ANGLES(RAD(15),RAD(0),RAD(0))*CF(0.5,0.9,0.5),
  475. },"Attack")
  476. until ROOT.ChaosChaos.Playing == false and ROOT.MeDoAnything.Playing == false
  477. for i = 1, MRANDOM(3,5) do
  478. local TO = FOE.Position
  479. local MOVETO = CF(FOE.Position+VT(0,1,0))*ANGLES(0,RAD(MRANDOM(0,359)),0)*CF(0,0,15)
  480. CHARACTER:SetPrimaryPartCFrame(MOVETO)
  481. Transparent(0)
  482. ROOT.OH:Play()
  483. for i = 1, 5 do
  484. ClerpBody({
  485. CF(0,0,0)*ANGLES(RAD(0),RAD(0),RAD(0)),
  486. CF(0,-0.5,0)*ANGLES(RAD(5),RAD(0),RAD(0))*CF(0,-1,0),
  487. CF(0,0.5,0)*ANGLES(RAD(-75),RAD(0),RAD(-35))*CF(-1.5,-0.5,0),
  488. CF(0,0.5,0)*ANGLES(RAD(-75),RAD(0),RAD(35))*CF(1.5,-0.5,0),
  489. CF(-0,0.5,0)*ANGLES(RAD(15),RAD(0),RAD(0))*CF(-0.5,1,0.5),
  490. CF(0,0.5,0)*ANGLES(RAD(15),RAD(0),RAD(0))*CF(0.5,0.9,0.5),
  491. },"Attack")
  492. end
  493. for i = 1, 3 do
  494. local ANGLE = (50-(25*i))/1.25
  495. coroutine.resume(coroutine.create(function()
  496. local TOFIREFROM = ROOT.CFrame*ANGLES(0,RAD(ANGLE),0)
  497. local CLUB = CreatePart(3, workspace, "Granite", 0, 0, TORSO.BrickColor, "Spade", VT(1.5,0.5,1.5), false)
  498. CreateMesh("SpecialMesh", CLUB, "FileMesh", CLUBSMESH, "", VT(0.75,0.75,0.75), VT(0,0,0))
  499. CLUB.CFrame = TOFIREFROM
  500. local GO = IT("BodyVelocity",CLUB)
  501. GO.Velocity = CLUB.CFrame.lookVector*65
  502. Debris:AddItem(CLUB,1)
  503. CLUB.Touched:Connect(function(HIT)
  504. if HIT.Parent:FindFirstChildOfClass("Humanoid") and HIT.Parent ~= CHARACTER then
  505. CLUB:Remove()
  506. CreateSound(410625063, HIT.Parent:FindFirstChildOfClass("Humanoid").Torso, 2, 1, false)
  507. HIT.Parent:FindFirstChildOfClass("Humanoid").Health = HIT.Parent:FindFirstChildOfClass("Humanoid").Health - 10
  508. end
  509. end)
  510. end))
  511. end
  512. for i = 1, 35 do
  513. Swait()
  514. ClerpBody({
  515. CF(0,-i/350,0)*ANGLES(RAD(0),RAD(0),RAD(0)),
  516. CF(0,-0.5,0)*ANGLES(RAD(15),RAD(0),RAD(0))*CF(0,-1,0),
  517. CF(0,0.5,0)*ANGLES(RAD(-120),RAD(0),RAD(35))*CF(-1.5,-0.5,0),
  518. CF(0,0.5,0)*ANGLES(RAD(-120),RAD(0),RAD(-35))*CF(1.5,-0.5,0),
  519. CF(-0,0.5,0)*ANGLES(RAD(15),RAD(0),RAD(0))*CF(-0.5,1,0.5),
  520. CF(0,0.5,0)*ANGLES(RAD(15),RAD(0),RAD(0))*CF(0.5,0.9,0.5),
  521. },"Attack")
  522. Transparent(i/35)
  523. end
  524. if TARGET.Health <= 0 or DEAD == true then
  525. break
  526. end
  527. end
  528. ATTACKING = false
  529. for i = 1, 25 do
  530. Swait()
  531. Transparent((25-i)/25)
  532. end
  533. Transparent(0)
  534. end
  535. end
  536. function Diamonds(TARGET)
  537. local FOE = TARGET.Torso
  538. if FOE then
  539. ChaosOrAnything()
  540. ATTACKING = true
  541. coroutine.resume(coroutine.create(function()
  542. repeat
  543. Swait()
  544. CHARACTER:SetPrimaryPartCFrame(Clerp(ROOT.CFrame,CF(VT(ROOT.Position.X,FOE.Position.Y,ROOT.Position.Z),FOE.Position),0.2))
  545. ClerpBody({
  546. CF(0,0.1*SIN(SINE/12),0)*ANGLES(RAD(0),RAD(0),RAD(0)),
  547. CF(0,-0.5,0)*ANGLES(RAD(15+2*COS(SINE/12)),RAD(0),RAD(0))*CF(0,-1,0),
  548. CF(0,0.5,0)*ANGLES(RAD(-120+15*COS(SINE/12)),RAD(0),RAD(35+5*COS(SINE/12)))*CF(-1.5,-0.5,0),
  549. CF(0,0.5,0)*ANGLES(RAD(-120+15*COS(SINE/12)),RAD(0),RAD(-35-5*COS(SINE/12)))*CF(1.5,-0.5,0),
  550. CF(-0,0.5,0)*ANGLES(RAD(15+2*COS(SINE/12)),RAD(0),RAD(0))*CF(-0.5,1,0.5),
  551. CF(0,0.5,0)*ANGLES(RAD(15+2*COS(SINE/12)),RAD(0),RAD(0))*CF(0.5,0.9,0.5),
  552. },"Attack")
  553. until ATTACKING == false
  554. end))
  555. for i = 1, MRANDOM(25,35) do
  556. coroutine.resume(coroutine.create(function()
  557. local DIAMOND = CreatePart(3, workspace, "Granite", 0, 1, TORSO.BrickColor, "Diamond", VT(0.5,0.5,1.5), true)
  558. CreateMesh("SpecialMesh", DIAMOND, "FileMesh", DIAMONDMESH, "", VT(0.1, 0.05, 0.15), VT(0,0,0))
  559. DIAMOND.CFrame = ROOT.CFrame*CF(MRANDOM(-150,150)/20,0,-1.5)
  560. for i = 1, 15 do
  561. Swait()
  562. DIAMOND.Transparency = (15-i)/15
  563. DIAMOND.CFrame = DIAMOND.CFrame*CF(0,0,-(15-i)/35)
  564. end
  565. DIAMOND.Anchored = false
  566. DIAMOND.Transparency = 0
  567. local GO = IT("BodyVelocity",DIAMOND)
  568. GO.Velocity = DIAMOND.CFrame.lookVector*15
  569. Debris:AddItem(DIAMOND,1)
  570. DIAMOND.Touched:Connect(function(HIT)
  571. if HIT.Parent:FindFirstChildOfClass("Humanoid") and HIT.Parent ~= CHARACTER then
  572. DIAMOND:Remove()
  573. CreateSound(410625063, HIT.Parent:FindFirstChildOfClass("Humanoid").Torso, 2, 1, false)
  574. HIT.Parent:FindFirstChildOfClass("Humanoid").Health = HIT.Parent:FindFirstChildOfClass("Humanoid").Health - 7.5
  575. end
  576. end)
  577. for i = 1, 5 do
  578. Swait()
  579. GO.Velocity = DIAMOND.CFrame.lookVector*(15*i)
  580. end
  581. end))
  582. if TARGET.Health <= 0 or DEAD == true then
  583. break
  584. end
  585. Swait(7)
  586. end
  587. ATTACKING = false
  588. end
  589. end
  590. function RingAround(TARGET)
  591. local FOE = TARGET.Torso
  592. if FOE then
  593. ATTACKING = true
  594. ChaosOrAnything()
  595. local E = 0
  596. repeat
  597. Swait()
  598. E = E + 1
  599. ClerpBody({
  600. CF(0,(-E/25)+0.1*SIN(SINE/12),0)*ANGLES(RAD(0),RAD(0),RAD(0)),
  601. CF(0,-0.5,0)*ANGLES(RAD(15+2*COS(SINE/12)),RAD(0),RAD(0))*CF(0,-1,0),
  602. CF(0,0.5,0)*ANGLES(RAD(-120+15*COS(SINE/12)),RAD(0),RAD(35+5*COS(SINE/12)))*CF(-1.5,-0.5,0),
  603. CF(0,0.5,0)*ANGLES(RAD(-120+15*COS(SINE/12)),RAD(0),RAD(-35-5*COS(SINE/12)))*CF(1.5,-0.5,0),
  604. CF(-0,0.5,0)*ANGLES(RAD(15+2*COS(SINE/12)),RAD(0),RAD(0))*CF(-0.5,1,0.5),
  605. CF(0,0.5,0)*ANGLES(RAD(15+2*COS(SINE/12)),RAD(0),RAD(0))*CF(0.5,0.9,0.5),
  606. },"Attack")
  607. until ROOT.ChaosChaos.Playing == false and ROOT.MeDoAnything.Playing == false
  608. coroutine.resume(coroutine.create(function()
  609. repeat
  610. Swait()
  611. CHARACTER:SetPrimaryPartCFrame(Clerp(ROOT.CFrame,CF(ROOT.Position,VT(FOE.Position.X,ROOT.Position.Y,FOE.Position.Z)),0.2))
  612. ClerpBody({
  613. CF(0,0.1*SIN(SINE/12),0)*ANGLES(RAD(0),RAD(0),RAD(0)),
  614. CF(0,-0.5,0)*ANGLES(RAD(15+2*COS(SINE/12)),RAD(0),RAD(0))*CF(0,-1,0),
  615. CF(0,0.5,0)*ANGLES(RAD(-120+15*COS(SINE/12)),RAD(0),RAD(35+5*COS(SINE/12)))*CF(-1.5,-0.5,0),
  616. CF(0,0.5,0)*ANGLES(RAD(-120+15*COS(SINE/12)),RAD(0),RAD(-35-5*COS(SINE/12)))*CF(1.5,-0.5,0),
  617. CF(-0,0.5,0)*ANGLES(RAD(15+2*COS(SINE/12)),RAD(0),RAD(0))*CF(-0.5,1,0.5),
  618. CF(0,0.5,0)*ANGLES(RAD(15+2*COS(SINE/12)),RAD(0),RAD(0))*CF(0.5,0.9,0.5),
  619. },"Attack")
  620. until ATTACKING == false
  621. end))
  622. for i = 1, MRANDOM(2,4) do
  623. local SPAWN = CF(FOE.Position)*ANGLES(0,RAD(MRANDOM(0,359)),0)
  624. local SPADES = {}
  625. for i = 1, 10 do
  626. local SPADE = CreatePart(3, workspace, "Granite", 0, 1, TORSO.BrickColor, "Spade", VT(2,2,2), true)
  627. CreateMesh("SpecialMesh", SPADE, "FileMesh", SPADEMESH, "", VT(1.2,1.2,1.2), VT(0,0,0))
  628. SPADE.CFrame = SPAWN*ANGLES(0,RAD(36*i),0)*CF(0,0,35)
  629. SPADE.Touched:Connect(function(HIT)
  630. if HIT.Parent:FindFirstChildOfClass("Humanoid") and HIT.Parent ~= CHARACTER then
  631. SPADE:Remove()
  632. CreateSound(410625063, HIT.Parent:FindFirstChildOfClass("Humanoid").Torso, 2, 1, false)
  633. HIT.Parent:FindFirstChildOfClass("Humanoid").Health = HIT.Parent:FindFirstChildOfClass("Humanoid").Health - 10
  634. end
  635. end)
  636. table.insert(SPADES,SPADE)
  637. end
  638. for i = 1, 25 do
  639. for E = 1, #SPADES do
  640. SPADES[E].CFrame = SPADES[E].CFrame * CF(0,0,-0.5)
  641. SPADES[E].Transparency = (10-i)/9.5
  642. end
  643. Swait()
  644. end
  645. wait(0.2)
  646. for E = 1, #SPADES do
  647. coroutine.resume(coroutine.create(function()
  648. local SPADE = SPADES[E]
  649. for i = 1, 15 do
  650. SPADE.CFrame = SPADE.CFrame*CF(0,0,(15-i)/15)
  651. Swait()
  652. end
  653. SPADE.Anchored = false
  654. local GO = IT("BodyVelocity",SPADE)
  655. GO.Velocity = SPADE.CFrame.lookVector*5
  656. GO.MaxForce = GO.MaxForce * 100
  657. Debris:AddItem(SPADE,1)
  658. SPADE.Touched:Connect(function(HIT)
  659. if HIT.Parent:FindFirstChildOfClass("Humanoid") and HIT.Parent ~= CHARACTER then
  660. SPADE:Remove()
  661. CreateSound(410625063, HIT.Parent:FindFirstChildOfClass("Humanoid").Torso, 2, 1, false)
  662. HIT.Parent:FindFirstChildOfClass("Humanoid").Health = HIT.Parent:FindFirstChildOfClass("Humanoid").Health - 2.5
  663. end
  664. end)
  665. for i = 1, 15 do
  666. Swait()
  667. GO.Velocity = SPADE.CFrame.lookVector*(5*i)
  668. end
  669. end))
  670. Swait(5)
  671. end
  672. if TARGET.Health <= 0 or DEAD == true then
  673. break
  674. end
  675. end
  676. wait(0.5)
  677. ATTACKING = false
  678. end
  679. end
  680. function HeartsGoesOut(TARGET)
  681. local FOE = TARGET.Torso
  682. if FOE then
  683. ChaosOrAnything()
  684. ATTACKING = true
  685. coroutine.resume(coroutine.create(function()
  686. repeat
  687. Swait()
  688. CHARACTER:SetPrimaryPartCFrame(Clerp(ROOT.CFrame,CF(ROOT.Position,VT(FOE.Position.X,ROOT.Position.Y,FOE.Position.Z)),0.2))
  689. ClerpBody({
  690. CF(0,0.1*SIN(SINE/12),0)*ANGLES(RAD(0),RAD(0),RAD(0)),
  691. CF(0,-0.5,0)*ANGLES(RAD(15+2*COS(SINE/12)),RAD(0),RAD(0))*CF(0,-1,0),
  692. CF(0,0.5,0)*ANGLES(RAD(-120+15*COS(SINE/12)),RAD(0),RAD(35+5*COS(SINE/12)))*CF(-1.5,-0.5,0),
  693. CF(0,0.5,0)*ANGLES(RAD(-120+15*COS(SINE/12)),RAD(0),RAD(-35-5*COS(SINE/12)))*CF(1.5,-0.5,0),
  694. CF(-0,0.5,0)*ANGLES(RAD(15+2*COS(SINE/12)),RAD(0),RAD(0))*CF(-0.5,1,0.5),
  695. CF(0,0.5,0)*ANGLES(RAD(15+2*COS(SINE/12)),RAD(0),RAD(0))*CF(0.5,0.9,0.5),
  696. },"Attack")
  697. until ATTACKING == false
  698. end))
  699. for i = 1, MRANDOM(5,7) do
  700. local SPAWN = CF(FOE.Position+VT(0,1,0))*ANGLES(0,RAD(MRANDOM(0,359)),0)*CF(0,0,35)
  701. SPAWN = CF(SPAWN.p,FOE.Position+VT(0,1,0))
  702. coroutine.resume(coroutine.create(function()
  703. local HEARTS = {}
  704. for i = 1, 4 do
  705. local HEART = CreatePart(3, workspace, "Granite", 0, 1, TORSO.BrickColor, "Heart", VT(2,2,2), true)
  706. CreateMesh("SpecialMesh", HEART, "FileMesh", HEARTMESH, "", VT(3.5,3.5,3.5), VT(0,0,0))
  707. HEART.CFrame = SPAWN*ANGLES(0,RAD((360/4)*i),0)
  708. HEART.Touched:Connect(function(HIT)
  709. if HIT.Parent:FindFirstChildOfClass("Humanoid") and HIT.Parent ~= CHARACTER then
  710. HEART:Remove()
  711. CreateSound(410625063, HIT.Parent:FindFirstChildOfClass("Humanoid").Torso, 2, 1, false)
  712. HIT.Parent:FindFirstChildOfClass("Humanoid").Health = HIT.Parent:FindFirstChildOfClass("Humanoid").Health - 7.5
  713. end
  714. end)
  715. table.insert(HEARTS,HEART)
  716. end
  717. for i = 1, 10 do
  718. Swait()
  719. for E = 1, #HEARTS do
  720. HEARTS[E].CFrame = HEARTS[E].CFrame*CF(0,0,-(10-i)/10)
  721. HEARTS[E].Transparency = (10-i)/9.5
  722. end
  723. end
  724. local DIST = (HEARTS[1].Position - SPAWN.p).Magnitude
  725. for i = 1, 100 do
  726. Swait()
  727. SPAWN = SPAWN*CF(0,0,-1)
  728. for E = 1, #HEARTS do
  729. HEARTS[E].Transparency = 0
  730. HEARTS[E].CFrame = SPAWN*ANGLES(0,RAD(((360/4)*E)+(i*5)),0)*CF(0,0,-DIST)
  731. end
  732. end
  733. for E = 1, #HEARTS do
  734. HEARTS[E]:Destroy()
  735. end
  736. end))
  737. Swait(35)
  738. if TARGET.Health <= 0 or DEAD == true then
  739. break
  740. end
  741. end
  742. wait(0.5)
  743. ATTACKING = false
  744. end
  745. end
  746. function Meta(TARGET)
  747. local FOE = TARGET.Torso
  748. if FOE then
  749. ROOT.Metamorph:Play()
  750. ATTACKING = true
  751. local SCYTHE = CreatePart(3, workspace, "Granite", 0, 1, TORSO.BrickColor, "Diamond", VT(3,0,3), true)
  752. CreateMesh("SpecialMesh", SCYTHE, "FileMesh", SCYTHEMESH, "", VT(0.01, 0.01, 0.01), VT(0,0,0))
  753. SCYTHE.CFrame = TORSO.CFrame
  754. for i = 1, 3 do
  755. for i = 1, 15 do
  756. Swait()
  757. ClerpBody({
  758. CF(0,0.1*SIN(SINE/12),0)*ANGLES(RAD(0),RAD(0),RAD(0)),
  759. CF(0,-0.5,0)*ANGLES(RAD(15+2*COS(SINE/12)),RAD(0),RAD(0))*CF(0,-1,0),
  760. CF(0,0.5,0)*ANGLES(RAD(-120+15*COS(SINE/12)),RAD(0),RAD(35+5*COS(SINE/12)))*CF(-1.5,-0.5,0),
  761. CF(0,0.5,0)*ANGLES(RAD(-120+15*COS(SINE/12)),RAD(0),RAD(-35-5*COS(SINE/12)))*CF(1.5,-0.5,0),
  762. CF(-0,0.5,0)*ANGLES(RAD(15+2*COS(SINE/12)),RAD(0),RAD(0))*CF(-0.5,1,0.5),
  763. CF(0,0.5,0)*ANGLES(RAD(15+2*COS(SINE/12)),RAD(0),RAD(0))*CF(0.5,0.9,0.5),
  764. },"Attack")
  765. Transparent(i/15)
  766. SCYTHE.Transparency = (15-i)/15
  767. SCYTHE.CFrame = CF(TORSO.Position)*ANGLES(0,RAD(SINE*5),0)
  768. end
  769. for i = 1, 15 do
  770. Swait()
  771. ClerpBody({
  772. CF(0,0.1*SIN(SINE/12),0)*ANGLES(RAD(0),RAD(0),RAD(0)),
  773. CF(0,-0.5,0)*ANGLES(RAD(15+2*COS(SINE/12)),RAD(0),RAD(0))*CF(0,-1,0),
  774. CF(0,0.5,0)*ANGLES(RAD(-120+15*COS(SINE/12)),RAD(0),RAD(35+5*COS(SINE/12)))*CF(-1.5,-0.5,0),
  775. CF(0,0.5,0)*ANGLES(RAD(-120+15*COS(SINE/12)),RAD(0),RAD(-35-5*COS(SINE/12)))*CF(1.5,-0.5,0),
  776. CF(-0,0.5,0)*ANGLES(RAD(15+2*COS(SINE/12)),RAD(0),RAD(0))*CF(-0.5,1,0.5),
  777. CF(0,0.5,0)*ANGLES(RAD(15+2*COS(SINE/12)),RAD(0),RAD(0))*CF(0.5,0.9,0.5),
  778. },"Attack")
  779. Transparent((15-i)/15)
  780. SCYTHE.Transparency = i/15
  781. SCYTHE.CFrame = CF(TORSO.Position)*ANGLES(0,RAD(SINE*5),0)
  782. end
  783. end
  784. for i = 1, 15 do
  785. Swait()
  786. ClerpBody({
  787. CF(0,0.1*SIN(SINE/12),0)*ANGLES(RAD(0),RAD(0),RAD(0)),
  788. CF(0,-0.5,0)*ANGLES(RAD(15+2*COS(SINE/12)),RAD(0),RAD(0))*CF(0,-1,0),
  789. CF(0,0.5,0)*ANGLES(RAD(-120+15*COS(SINE/12)),RAD(0),RAD(35+5*COS(SINE/12)))*CF(-1.5,-0.5,0),
  790. CF(0,0.5,0)*ANGLES(RAD(-120+15*COS(SINE/12)),RAD(0),RAD(-35-5*COS(SINE/12)))*CF(1.5,-0.5,0),
  791. CF(-0,0.5,0)*ANGLES(RAD(15+2*COS(SINE/12)),RAD(0),RAD(0))*CF(-0.5,1,0.5),
  792. CF(0,0.5,0)*ANGLES(RAD(15+2*COS(SINE/12)),RAD(0),RAD(0))*CF(0.5,0.9,0.5),
  793. },"Attack")
  794. Transparent(i/15)
  795. SCYTHE.Transparency = (15-i)/15
  796. SCYTHE.CFrame = CF(TORSO.Position)*ANGLES(0,RAD(SINE*5),0)
  797. end
  798. Transparent(1)
  799. SCYTHE.Transparency = 0
  800. local SCYTHES = {SCYTHE}
  801. for i = 1, 3 do
  802. local COPY = SCYTHE:Clone()
  803. COPY.Parent = workspace
  804. COPY.CFrame = SCYTHE.CFrame
  805. table.insert(SCYTHES,COPY)
  806. end
  807. for E = 1, #SCYTHES do
  808. local DELAY = false
  809. SCYTHES[E].Touched:Connect(function(HIT)
  810. if HIT.Parent:FindFirstChildOfClass("Humanoid") and HIT.Parent ~= CHARACTER and DELAY == false then
  811. HIT.Parent:FindFirstChildOfClass("Humanoid").Health = HIT.Parent:FindFirstChildOfClass("Humanoid").Health - 3.5
  812. CreateSound(410625063, HIT.Parent:FindFirstChildOfClass("Humanoid").Torso, 2, 1, false)
  813. DELAY = true
  814. wait(1)
  815. DELAY = false
  816. end
  817. end)
  818. end
  819. local NOW = ROOT.CFrame
  820. CHARACTER:SetPrimaryPartCFrame(CF(0,5000,0))
  821. HUMANOID.Parent = nil
  822. local Y = FOE.Position.Y
  823. for i = 1, 750 do
  824. Swait()
  825. for E = 1, #SCYTHES do
  826. SCYTHES[E].CFrame = CF(Clerp(SCYTHES[E].CFrame,CF(FOE.Position.X,Y,FOE.Position.Z)*ANGLES(0,RAD((360/4*E)+SINE),0)*CF(0,0,45*SIN(i/50)),0.1).p)*ANGLES(0,RAD(SINE*5),0)
  827. end
  828. if TARGET.Health <= 0 or DEAD == true then
  829. break
  830. end
  831. end
  832. for i = 1, 25 do
  833. for E = 1, #SCYTHES do
  834. SCYTHES[E].CFrame = CF(Clerp(SCYTHES[E].CFrame,NOW,0.15).p)*ANGLES(0,RAD(SINE*5),0)
  835. end
  836. Swait()
  837. end
  838. CHARACTER:SetPrimaryPartCFrame(NOW)
  839. HUMANOID.Parent = CHARACTER
  840. for i = 1, 15 do
  841. Swait()
  842. ClerpBody({
  843. CF(0,0.1*SIN(SINE/12),0)*ANGLES(RAD(0),RAD(0),RAD(0)),
  844. CF(0,-0.5,0)*ANGLES(RAD(15+2*COS(SINE/12)),RAD(0),RAD(0))*CF(0,-1,0),
  845. CF(0,0.5,0)*ANGLES(RAD(-120+15*COS(SINE/12)),RAD(0),RAD(35+5*COS(SINE/12)))*CF(-1.5,-0.5,0),
  846. CF(0,0.5,0)*ANGLES(RAD(-120+15*COS(SINE/12)),RAD(0),RAD(-35-5*COS(SINE/12)))*CF(1.5,-0.5,0),
  847. CF(-0,0.5,0)*ANGLES(RAD(15+2*COS(SINE/12)),RAD(0),RAD(0))*CF(-0.5,1,0.5),
  848. CF(0,0.5,0)*ANGLES(RAD(15+2*COS(SINE/12)),RAD(0),RAD(0))*CF(0.5,0.9,0.5),
  849. },"Attack")
  850. Transparent((15-i)/15)
  851. for E = 1, #SCYTHES do
  852. SCYTHES[E].CFrame = CF(ROOT.Position)*ANGLES(0,RAD(SINE*5),0)
  853. SCYTHES[E].Transparency = i/15
  854. end
  855. end
  856. for E = 1, #SCYTHES do
  857. SCYTHES[E]:Remove()
  858. end
  859. ATTACKING = false
  860. end
  861. end
  862. local ATTACKS = {OhOhOh,Diamonds,RingAround,HeartsGoesOut,Meta}
  863.  
  864. --//=================================\\
  865. --|| WRAP
  866. --\\=================================//
  867.  
  868. function BEGINAI()
  869. local TORSOROT = 0
  870. CHARACTER:SetPrimaryPartCFrame(ROOT.CFrame*CF(0,1,0))
  871. coroutine.resume(coroutine.create(function()
  872. game:GetService("RunService").Heartbeat:connect(function()
  873. local DEFAULTS = {
  874. CF(0,0,0),
  875. CF(0,-0.5,0)*ANGLES(RAD(0),RAD(0),RAD(0))*CF(0,-1,0),
  876. CF(0,0.5,0)*ANGLES(RAD(0),RAD(0),RAD(0))*CF(-1.5,-0.5,0),
  877. CF(0,0.5,0)*ANGLES(RAD(0),RAD(0),RAD(0))*CF(1.5,-0.5,0),
  878. CF(-0,1,0)*ANGLES(RAD(0),RAD(0),RAD(0))*CF(-0.5,1,0),
  879. CF(0,1,0)*ANGLES(RAD(0),RAD(0),RAD(0))*CF(0.5,1,0),
  880. }
  881. SINE = SINE + 1
  882. end)
  883. while true do
  884. TORSOROT = 35
  885. for i = 1, 5 do
  886. ClerpBody({
  887. CF(0,0,0)*ANGLES(RAD(0),RAD(35),RAD(0)),
  888. CF(0,-0.5,0)*ANGLES(RAD(15),RAD(-20),RAD(0))*CF(0,-1,0),
  889. CF(0,0.5,0)*ANGLES(RAD(12),RAD(0),RAD(0))*CF(-1.5,-0.5,0),
  890. CF(0,0.5,0)*ANGLES(RAD(-120),RAD(0),RAD(-35))*CF(1.5,-0.5,0),
  891. CF(-0,0,0)*ANGLES(RAD(0),RAD(0),RAD(0))*CF(-0.5,1,1),
  892. CF(0,1,0)*ANGLES(RAD(15),RAD(0),RAD(0))*CF(0.5,0.9,0.2),
  893. },nil)
  894. end
  895. for i = 1, 15 do
  896. Swait()
  897. ClerpBody({
  898. CF(0,0.3,0)*ANGLES(RAD(0),RAD(35),RAD(0)),
  899. CF(0,-0.5,0)*ANGLES(RAD(0),RAD(-35),RAD(0))*CF(0,-1,0),
  900. CF(0,0.5,0)*ANGLES(RAD(12),RAD(0),RAD(0))*CF(-1.5,-0.5,0),
  901. CF(0,0.75,0)*ANGLES(RAD(-120),RAD(0),RAD(-35))*CF(1.5,-0.25,0),
  902. CF(-0,1,0)*ANGLES(RAD(0),RAD(0),RAD(0))*CF(-0.5,1,0.5),
  903. CF(0,1,0)*ANGLES(RAD(15),RAD(0),RAD(0))*CF(0.5,0.9,0.2),
  904. },nil)
  905. if DEAD == true then
  906. break
  907. end
  908. end
  909. if DEAD == true then
  910. break
  911. end
  912. TORSOROT = -35
  913. for i = 1, 5 do
  914. ClerpBody({
  915. CF(0,0,0)*ANGLES(RAD(0),RAD(-35),RAD(0)),
  916. CF(0,-0.5,0)*ANGLES(RAD(15),RAD(20),RAD(0))*CF(0,-1,0),
  917. CF(0,0.5,0)*ANGLES(RAD(-120),RAD(0),RAD(35))*CF(-1.5,-0.5,0),
  918. CF(0,0.5,0)*ANGLES(RAD(12),RAD(0),RAD(0))*CF(1.5,-0.5,0),
  919. CF(-0,1,0)*ANGLES(RAD(15),RAD(0),RAD(0))*CF(-0.5,0.9,0.2),
  920. CF(0,0,0)*ANGLES(RAD(0),RAD(0),RAD(0))*CF(0.5,0.9,1),
  921. },nil)
  922. end
  923. for i = 1, 15 do
  924. Swait()
  925. ClerpBody({
  926. CF(0,0.3,0)*ANGLES(RAD(0),RAD(-35),RAD(0)),
  927. CF(0,-0.5,0)*ANGLES(RAD(0),RAD(35),RAD(0))*CF(0,-1,0),
  928. CF(0,0.75,0)*ANGLES(RAD(-120),RAD(0),RAD(35))*CF(-1.5,-0.25,0),
  929. CF(0,0.5,0)*ANGLES(RAD(12),RAD(0),RAD(0))*CF(1.5,-0.5,0),
  930. CF(-0,1,0)*ANGLES(RAD(15),RAD(0),RAD(0))*CF(-0.5,1,0.2),
  931. CF(0,1,0)*ANGLES(RAD(0),RAD(0),RAD(0))*CF(0.5,1,0.5),
  932. },nil)
  933. if DEAD == true then
  934. break
  935. end
  936. end
  937. if DEAD == true then
  938. break
  939. end
  940. end
  941. end))
  942. local TARGET = nil
  943. local TARGETHUM = nil
  944. coroutine.resume(coroutine.create(function()
  945. --local h = HUMANOID
  946. local pathService = game:GetService("PathfindingService")
  947. local goToPos = function(loc,target)
  948. local distance = (loc-ROOT.Position).magnitude
  949. local start = tick()
  950. while distance > 7 do
  951. if target then
  952. if target.Torso and ATTACKING == false then
  953. GoTo(loc+VT(0,4.5,0))
  954. Swait()
  955. local RAYTEST = Raycast(ROOT.Position,CF(ROOT.Position,target.Torso.Position).lookVector,500,CHARACTER)
  956. if distance <= 7 or TARGETHUM ~= target or TestForTarget(RAYTEST,target) == false then -- Something may have gone wrong. Just break.
  957. break
  958. end
  959. distance = (loc+VT(0,4.5,0)-ROOT.Position).magnitude
  960. else
  961. break
  962. end
  963. else
  964. break
  965. end
  966. end
  967. end
  968.  
  969. while true do
  970. if DEAD == true then
  971. break
  972. end
  973. Swait()
  974. if TARGETHUM then
  975. local target = TARGETHUM
  976. if TARGETHUM.Torso then
  977. local RAYTEST = Raycast(ROOT.Position,CF(ROOT.Position,VT(target.Torso.Position.X,ROOT.Position.Y,target.Torso.Position.Z)).lookVector,500,CHARACTER)
  978. if TestForTarget(RAYTEST,target) == true then
  979. local path = pathService:ComputeRawPathAsync(ROOT.Position,TARGETHUM.Torso.Position,5000)
  980. local didBreak = false
  981. local targetStart
  982. if target and ROOT and target.Torso then
  983. targetStart = target.Torso.Position
  984. local previous = ROOT.Position
  985. local points = path:GetWaypoints()
  986. local s = #points > 1 and 2 or 1
  987. for i = s,#points do
  988. if GYRO == nil then
  989. local point = points[i].Position
  990. if didBreak then
  991. break
  992. end
  993. if target and target.Torso and target.Health > 0 and ATTACKING == false then
  994. if (ROOT.Position - point).Magnitude > 1 and TARGETHUM == target then
  995. local pos = previous:lerp(point,0.65)
  996. goToPos(previous:lerp(point,0.65),target)
  997. previous = point
  998. end
  999. else
  1000. didBreak = true
  1001. break
  1002. end
  1003. end
  1004. end
  1005. end
  1006. if not didBreak and targetStart then
  1007. goToPos(targetStart)
  1008. end
  1009. else
  1010. if ATTACKING == false then
  1011. GoTo(target.Torso.Position+VT(0,2.5,0))
  1012. end
  1013. end
  1014. end
  1015. end
  1016. end
  1017. end))
  1018. HUMANOID.Died:Connect(function()
  1019. if DEAD == false then
  1020. DEAD = true
  1021. repeat
  1022. Swait()
  1023. until ATTACKING == false
  1024. CHAIR.Transparency = 0
  1025. Transparent(0)
  1026. script.Music:Stop()
  1027. ROOT.Deathed:Play()
  1028. repeat
  1029. Swait()
  1030. ClerpBody({
  1031. CF(0,0,0)*ANGLES(RAD(0),RAD(0),RAD(0)),
  1032. CF(0,-0.5,0)*ANGLES(RAD(35),RAD(0),RAD(0))*CF(0,-1,0),
  1033. CF(0,0.5,0)*ANGLES(RAD(-35),RAD(0),RAD(5))*CF(-1.5,-0.3,0),
  1034. CF(0,0.5,0)*ANGLES(RAD(-35),RAD(0),RAD(-5))*CF(1.5,-0.3,0),
  1035. CF(-0,0,0)*ANGLES(RAD(-15),RAD(0),RAD(0))*CF(-0.5,1,1),
  1036. CF(0,0,0)*ANGLES(RAD(-15),RAD(0),RAD(0))*CF(0.5,1,1),
  1037. },nil)
  1038. until ROOT.Deathed.Playing == false
  1039. CHARACTER.Head.Nametag:Remove()
  1040. TORSO.Neck:Remove()
  1041. TORSO.Die:Play()
  1042. ROOT:Remove()
  1043. CHARACTER:BreakJoints()
  1044. CHAIR:Destroy()
  1045. Debris:AddItem(CHARACTER,5)
  1046. end
  1047. end)
  1048. HUMANOID.HealthChanged:Connect(function()
  1049. if HIT == false and DEAD == false then
  1050. HIT = true
  1051. local HA = {ROOT.Ha1,ROOT.Ha2}
  1052. HA[MRANDOM(1,2)]:Play()
  1053. for i = 1, 100 do
  1054. Swait()
  1055. if ATTACKING == true then
  1056. Neck.C1 = Clerp(Neck.C1, CF(0,-2.5,0)*ANGLES(0,0,RAD(65*SIN(i/6)))*CF(0,-1,0), 0.2)
  1057. else
  1058. Neck.C1 = Clerp(Neck.C1, CF(0,-2.5,0)*ANGLES(0,0,RAD(65*SIN(i/6)))*ANGLES(0,RAD(-TORSOROT),0)*CF(0,-1,0), 0.7)
  1059. end
  1060. if DEAD == true then
  1061. break
  1062. end
  1063. end
  1064. HIT = false
  1065. end
  1066. end)
  1067. while true do
  1068. if DEAD == true then
  1069. break
  1070. end
  1071. local TARGETVARIANTS = {}
  1072. TARGET = nil
  1073. for index, CHILD in pairs(workspace:GetChildren()) do
  1074. if CHILD ~= CHARACTER and CHILD:FindFirstChild("Slain") == nil then
  1075. local HUMAN = CHILD:FindFirstChildOfClass("Humanoid")
  1076. if HUMAN then
  1077. if HUMAN.Health > 0 then
  1078. if HUMAN.Torso then
  1079. local DISTANCE = (HUMAN.Torso.Position - ROOT.Position).Magnitude
  1080. table.insert(TARGETVARIANTS,{CHILD,DISTANCE})
  1081. end
  1082. end
  1083. end
  1084. end
  1085. end
  1086. local DIST = math.huge
  1087. for E = 1, #TARGETVARIANTS do
  1088. local PLAYER = TARGETVARIANTS[E]
  1089. local CHARACTER = PLAYER[1]
  1090. local DISTANCE = PLAYER[2]
  1091. if DISTANCE < DIST then
  1092. DIST = DISTANCE
  1093. TARGET = CHARACTER
  1094. end
  1095. end
  1096. if TARGET and TARGET:FindFirstChild("HumanoidRootPart") then
  1097. TARGETHUM = TARGET:FindFirstChildOfClass("Humanoid")
  1098. --[[HUMANOID.WalkSpeed = 22
  1099. HUMANOID.JumpPower = 125]]
  1100. local RAY = Raycast(ROOT.Position,CF(ROOT.Position,TARGETHUM.Torso.Position).lookVector,25,CHARACTER)
  1101. if DIST <= 25 and TestForTarget(RAY,TARGETHUM) == false and (TARGETHUM.Torso.Position.Y > ROOT.Position.Y-1 or TARGETHUM.Torso.Position.Y < ROOT.Position.Y+2) then
  1102. ATTACKS[MRANDOM(1,#ATTACKS)](TARGETHUM)
  1103. end
  1104. else
  1105. TARGETHUM = nil
  1106. end
  1107. wait()
  1108. end
  1109. end
  1110.  
  1111. BEGINAI()
Add Comment
Please, Sign In to add comment