Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- IT = Instance.new
- CF = CFrame.new
- VT = Vector3.new
- RAD = math.rad
- C3 = Color3.new
- UD2 = UDim2.new
- BRICKC = BrickColor.new
- ANGLES = CFrame.Angles
- EULER = CFrame.fromEulerAnglesXYZ
- COS = math.cos
- ACOS = math.acos
- SIN = math.sin
- ASIN = math.asin
- ABS = math.abs
- MRANDOM = math.random
- FLOOR = math.floor
- local GYRO = nil
- local CHARACTER = script.Parent
- local HUMANOID = CHARACTER:FindFirstChildOfClass("Humanoid")
- local TORSO = CHARACTER.Torso
- local ROOT = CHARACTER.HumanoidRootPart
- local RIGHTARM = CHARACTER["Right Arm"]
- local LEFTARM = CHARACTER["Left Arm"]
- local RIGHTLEG = CHARACTER["Right Leg"]
- local LEFTLEG = CHARACTER["Left Leg"]
- RootJoint = ROOT["Root"]
- Neck = TORSO["Head"]
- RightShoulder = TORSO["RArm"]
- LeftShoulder = TORSO["LArm"]
- RightHip = TORSO["RLeg"]
- LeftHip = TORSO["LLeg"]
- local BODY = {}
- local CHAIR = CHARACTER.Wheelchair
- for index, CHILD in pairs(CHARACTER:GetDescendants()) do
- if (CHILD:IsA("BasePart") or CHILD:IsA("Decal") or CHILD:IsA("Beam")) and CHILD ~= ROOT and CHILD ~= CHAIR then
- table.insert(BODY,CHILD)
- end
- end
- local ATTACKING = false
- if script:FindFirstChild("Color") then
- script.Color.Parent = game.Lighting
- end
- local HIT = false
- local MUSIC = script.Music
- local DEAD = false
- MUSIC:Play()
- local CLUBSMESH = 2761335666
- local DIAMONDMESH = 1254392112
- local SPADEMESH = 2760895053
- local HEARTMESH = 105992239 --VT(3.5,3.5,3.5)
- local SCYTHEMESH = 455516381
- local SINE = 0
- local HITPLAYERSOUNDS = {--[["199149137", "199149186", "199149221", "199149235", "199149269", "199149297"--]]"263032172", "263032182", "263032200", "263032221", "263032252", "263033191"}
- Debris = game:GetService("Debris")
- local Effects = IT("Folder",CHARACTER)
- --//=================================\\
- --|| SAZERENOS' ARTIFICIAL HEARTBEAT
- --\\=================================//
- ArtificialHB = Instance.new("BindableEvent", script)
- ArtificialHB.Name = "ArtificialHB"
- script:WaitForChild("ArtificialHB")
- frame = 1/60
- tf = 0
- allowframeloss = false
- tossremainder = false
- lastframe = tick()
- script.ArtificialHB:Fire()
- game:GetService("RunService").Heartbeat:connect(function(s, p)
- tf = tf + s
- if tf >= frame then
- if allowframeloss then
- script.ArtificialHB:Fire()
- lastframe = tick()
- else
- for i = 1, math.floor(tf / frame) do
- script.ArtificialHB:Fire()
- end
- lastframe = tick()
- end
- if tossremainder then
- tf = 0
- else
- tf = tf - frame * math.floor(tf / frame)
- end
- end
- end)
- function PositiveAngle(NUMBER)
- if NUMBER >= 0 then
- NUMBER = 0
- end
- return NUMBER
- end
- function NegativeAngle(NUMBER)
- if NUMBER <= 0 then
- NUMBER = 0
- end
- return NUMBER
- end
- function Swait(NUMBER)
- if NUMBER == 0 or NUMBER == nil then
- ArtificialHB.Event:wait()
- else
- for i = 1, NUMBER do
- ArtificialHB.Event:wait()
- end
- end
- end
- --//=================================\\
- --|| FUNCTIONS
- --\\=================================//
- function CreateMesh(MESH, PARENT, MESHTYPE, MESHID, TEXTUREID, SCALE, OFFSET)
- local NEWMESH = IT(MESH)
- if MESH == "SpecialMesh" then
- NEWMESH.MeshType = MESHTYPE
- if MESHID ~= "nil" and MESHID ~= "" then
- NEWMESH.MeshId = "http://www.roblox.com/asset/?id="..MESHID
- end
- if TEXTUREID ~= "nil" and TEXTUREID ~= "" then
- NEWMESH.TextureId = "http://www.roblox.com/asset/?id="..TEXTUREID
- end
- end
- NEWMESH.Offset = OFFSET or VT(0, 0, 0)
- NEWMESH.Scale = SCALE
- NEWMESH.Parent = PARENT
- return NEWMESH
- end
- function CreatePart(FORMFACTOR, PARENT, MATERIAL, REFLECTANCE, TRANSPARENCY, BRICKCOLOR, NAME, SIZE, ANCHOR)
- local NEWPART = IT("Part")
- NEWPART.formFactor = FORMFACTOR
- NEWPART.Reflectance = REFLECTANCE
- NEWPART.Transparency = TRANSPARENCY
- NEWPART.CanCollide = false
- NEWPART.Locked = true
- NEWPART.Anchored = true
- if ANCHOR == false then
- NEWPART.Anchored = false
- end
- NEWPART.BrickColor = BRICKC(tostring(BRICKCOLOR))
- NEWPART.Name = NAME
- NEWPART.Size = SIZE
- NEWPART.Position = TORSO.Position
- NEWPART.Material = MATERIAL
- NEWPART:BreakJoints()
- NEWPART.Parent = PARENT
- return NEWPART
- end
- local function weldBetween(a, b)
- local weldd = IT("ManualWeld")
- weldd.Part0 = a
- weldd.Part1 = b
- weldd.C0 = CF()
- weldd.C1 = b.CFrame:inverse() * a.CFrame
- weldd.Parent = a
- return weldd
- end
- local S = IT("Sound")
- function CreateSound(ID, PARENT, VOLUME, PITCH, DOESLOOP)
- local NEWSOUND = nil
- coroutine.resume(coroutine.create(function()
- NEWSOUND = S:Clone()
- NEWSOUND.Parent = PARENT
- NEWSOUND.Volume = VOLUME
- NEWSOUND.Pitch = PITCH
- NEWSOUND.SoundId = "http://www.roblox.com/asset/?id="..ID
- NEWSOUND:play()
- if DOESLOOP == true then
- NEWSOUND.Looped = true
- else
- repeat wait(1) until NEWSOUND.Playing == false
- NEWSOUND:remove()
- end
- end))
- return NEWSOUND
- end
- function Raycast(POSITION, DIRECTION, RANGE, IGNOREDECENDANTS)
- return workspace:FindPartOnRay(Ray.new(POSITION, DIRECTION.unit * RANGE), IGNOREDECENDANTS)
- end
- function ApplyDamage(Humanoid,Damage)
- Damage = Damage * 1
- if Humanoid.Health ~= 0 then
- Humanoid.Health = Humanoid.Health - Damage
- end
- end
- function ApplyAoE(POSITION,RANGE,MINDMG,MAXDMG,FLING,INSTAKILL)
- for index, CHILD in pairs(workspace:GetDescendants()) do
- if CHILD.ClassName == "Model" and CHILD ~= CHARACTER then
- local HUM = CHILD:FindFirstChildOfClass("Humanoid")
- if HUM then
- local TORSO = CHILD:FindFirstChild("Torso") or CHILD:FindFirstChild("UpperTorso")
- if TORSO then
- if (TORSO.Position - POSITION).Magnitude <= RANGE then
- if INSTAKILL == true then
- CHILD:BreakJoints()
- else
- local DMG = MRANDOM(MINDMG,MAXDMG)
- ApplyDamage(HUM,DMG)
- end
- if FLING > 0 then
- for _, c in pairs(CHILD:GetChildren()) do
- if c:IsA("BasePart") then
- local bv = Instance.new("BodyVelocity")
- bv.maxForce = Vector3.new(1e9, 1e9, 1e9)
- bv.velocity = CF(POSITION,TORSO.Position).lookVector*FLING
- bv.Parent = c
- Debris:AddItem(bv,0.05)
- end
- end
- end
- end
- end
- end
- end
- end
- end
- --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})
- function WACKYEFFECT(Table)
- local TYPE = (Table.EffectType or "Sphere")
- local SIZE = (Table.Size or VT(1,1,1))
- local ENDSIZE = (Table.Size2 or VT(0,0,0))
- local TRANSPARENCY = (Table.Transparency or 0)
- local ENDTRANSPARENCY = (Table.Transparency2 or 1)
- local CFRAME = (Table.CFrame or TORSO.CFrame)
- local MOVEDIRECTION = (Table.MoveToPos or nil)
- local ROTATION1 = (Table.RotationX or 0)
- local ROTATION2 = (Table.RotationY or 0)
- local ROTATION3 = (Table.RotationZ or 0)
- local MATERIAL = (Table.Material or "Neon")
- local COLOR = (Table.Color or C3(1,1,1))
- local TIME = (Table.Time or 45)
- local SOUNDID = (Table.SoundID or nil)
- local SOUNDPITCH = (Table.SoundPitch or nil)
- local SOUNDVOLUME = (Table.SoundVolume or nil)
- coroutine.resume(coroutine.create(function()
- local PLAYSSOUND = false
- local SOUND = nil
- local EFFECT = CreatePart(3, Effects, MATERIAL, 0, TRANSPARENCY, BRICKC("Pearl"), "Effect", VT(1,1,1), true)
- if SOUNDID ~= nil and SOUNDPITCH ~= nil and SOUNDVOLUME ~= nil then
- PLAYSSOUND = true
- SOUND = CreateSound(SOUNDID, EFFECT, SOUNDVOLUME, SOUNDPITCH, false)
- end
- EFFECT.Color = COLOR
- local MSH = nil
- if TYPE == "Sphere" then
- MSH = CreateMesh("SpecialMesh", EFFECT, "Sphere", "", "", SIZE, VT(0,0,0))
- elseif TYPE == "Block" or TYPE == "Box" then
- MSH = IT("BlockMesh",EFFECT)
- MSH.Scale = VT(SIZE.X,SIZE.X,SIZE.X)
- elseif TYPE == "Wave" then
- MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "20329976", "", SIZE, VT(0,0,-SIZE.X/8))
- elseif TYPE == "Ring" then
- MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "559831844", "", VT(SIZE.X,SIZE.X,0.1), VT(0,0,0))
- elseif TYPE == "Slash" then
- MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "662586858", "", VT(SIZE.X/10,0,SIZE.X/10), VT(0,0,0))
- elseif TYPE == "Round Slash" then
- MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "662585058", "", VT(SIZE.X/10,0,SIZE.X/10), VT(0,0,0))
- elseif TYPE == "Swirl" then
- MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "1051557", "", SIZE, VT(0,0,0))
- elseif TYPE == "Skull" then
- MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "4770583", "", SIZE, VT(0,0,0))
- elseif TYPE == "Crystal" then
- MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "9756362", "", SIZE, VT(0,0,0))
- end
- if MSH ~= nil then
- local MOVESPEED = nil
- if MOVEDIRECTION ~= nil then
- MOVESPEED = (CFRAME.p - MOVEDIRECTION).Magnitude/TIME
- end
- local GROWTH = SIZE - ENDSIZE
- local TRANS = TRANSPARENCY - ENDTRANSPARENCY
- if TYPE == "Block" then
- EFFECT.CFrame = CFRAME*ANGLES(RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)))
- else
- EFFECT.CFrame = CFRAME
- end
- for LOOP = 1, TIME+1 do
- Swait()
- MSH.Scale = MSH.Scale - GROWTH/TIME
- if TYPE == "Wave" then
- MSH.Offset = VT(0,0,-MSH.Scale.X/8)
- end
- EFFECT.Transparency = EFFECT.Transparency - TRANS/TIME
- if TYPE == "Block" then
- EFFECT.CFrame = CFRAME*ANGLES(RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)))
- else
- EFFECT.CFrame = EFFECT.CFrame*ANGLES(RAD(ROTATION1),RAD(ROTATION2),RAD(ROTATION3))
- end
- if MOVEDIRECTION ~= nil then
- local ORI = EFFECT.Orientation
- EFFECT.CFrame = CF(EFFECT.Position,MOVEDIRECTION)*CF(0,0,-MOVESPEED)
- EFFECT.Orientation = ORI
- end
- end
- if PLAYSSOUND == false then
- EFFECT:remove()
- else
- repeat Swait() until SOUND.Playing == false
- EFFECT:remove()
- end
- else
- if PLAYSSOUND == false then
- EFFECT:remove()
- else
- repeat Swait() until SOUND.Playing == false
- EFFECT:remove()
- end
- end
- end))
- end
- function Transparent(CY)
- for E = 1, #BODY do
- if BODY[E].ClassName ~= "Beam" then
- BODY[E].Transparency = CY
- else
- BODY[E].Transparency = NumberSequence.new(CY)
- end
- end
- end
- --//=================================\\
- --|| CLERPING
- --\\=================================//
- function QuaternionFromCFrame(cf)
- local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
- local trace = m00 + m11 + m22
- if trace > 0 then
- local s = math.sqrt(1 + trace)
- local recip = 0.5 / s
- return (m21 - m12) * recip, (m02 - m20) * recip, (m10 - m01) * recip, s * 0.5
- else
- local i = 0
- if m11 > m00 then
- i = 1
- end
- if m22 > (i == 0 and m00 or m11) then
- i = 2
- end
- if i == 0 then
- local s = math.sqrt(m00 - m11 - m22 + 1)
- local recip = 0.5 / s
- return 0.5 * s, (m10 + m01) * recip, (m20 + m02) * recip, (m21 - m12) * recip
- elseif i == 1 then
- local s = math.sqrt(m11 - m22 - m00 + 1)
- local recip = 0.5 / s
- return (m01 + m10) * recip, 0.5 * s, (m21 + m12) * recip, (m02 - m20) * recip
- elseif i == 2 then
- local s = math.sqrt(m22 - m00 - m11 + 1)
- local recip = 0.5 / s return (m02 + m20) * recip, (m12 + m21) * recip, 0.5 * s, (m10 - m01) * recip
- end
- end
- end
- function QuaternionToCFrame(px, py, pz, x, y, z, w)
- local xs, ys, zs = x + x, y + y, z + z
- local wx, wy, wz = w * xs, w * ys, w * zs
- local xx = x * xs
- local xy = x * ys
- local xz = x * zs
- local yy = y * ys
- local yz = y * zs
- local zz = z * zs
- 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))
- end
- function QuaternionSlerp(a, b, t)
- local cosTheta = a[1] * b[1] + a[2] * b[2] + a[3] * b[3] + a[4] * b[4]
- local startInterp, finishInterp;
- if cosTheta >= 0.0001 then
- if (1 - cosTheta) > 0.0001 then
- local theta = ACOS(cosTheta)
- local invSinTheta = 1 / SIN(theta)
- startInterp = SIN((1 - t) * theta) * invSinTheta
- finishInterp = SIN(t * theta) * invSinTheta
- else
- startInterp = 1 - t
- finishInterp = t
- end
- else
- if (1 + cosTheta) > 0.0001 then
- local theta = ACOS(-cosTheta)
- local invSinTheta = 1 / SIN(theta)
- startInterp = SIN((t - 1) * theta) * invSinTheta
- finishInterp = SIN(t * theta) * invSinTheta
- else
- startInterp = t - 1
- finishInterp = t
- end
- end
- 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
- end
- function Clerp(a, b, t)
- local qa = {QuaternionFromCFrame(a)}
- local qb = {QuaternionFromCFrame(b)}
- local ax, ay, az = a.x, a.y, a.z
- local bx, by, bz = b.x, b.y, b.z
- local _t = 1 - t
- return QuaternionToCFrame(_t * ax + t * bx, _t * ay + t * by, _t * az + t * bz, QuaternionSlerp(qa, qb, t))
- end
- function ClerpBody(TABLE,PRIORITY)
- if PRIORITY == "Attack" or ATTACKING == false then
- RootJoint.C1 = Clerp(RootJoint.C1, TABLE[1], 0.35)
- if HIT == false then
- Neck.C1 = Clerp(Neck.C1, TABLE[2], 0.35)
- end
- RightShoulder.C1 = Clerp(RightShoulder.C1, TABLE[3], 0.35)
- LeftShoulder.C1 = Clerp(LeftShoulder.C1, TABLE[4], 0.35)
- RightHip.C1 = Clerp(RightHip.C1, TABLE[5], 0.35)
- LeftHip.C1 = Clerp(LeftHip.C1, TABLE[6], 0.35)
- end
- end
- --//=================================\\
- --|| ATRIFICIAL INTELLIGENCE
- --\\=================================//
- local GoTo = function(TO)
- CHARACTER:SetPrimaryPartCFrame(Clerp(ROOT.CFrame,CF(ROOT.Position,TO),0.5)*CF(0,0,-HUMANOID.WalkSpeed/32))
- CHARACTER:SetPrimaryPartCFrame(CF(ROOT.Position)*ANGLES(0,RAD(ROOT.Orientation.Y),0))
- end
- function TestForTarget(PRT,target)
- local to = true
- if PRT then
- if PRT:FindFirstAncestorOfClass("Model") == target.Parent then
- to = false
- end
- end
- return to
- end
- function ChaosOrAnything()
- local PLAY = {ROOT.MeDoAnything,ROOT.ChaosChaos}
- PLAY[MRANDOM(1,2)]:Play()
- end
- function OhOhOh(TARGET)
- local FOE = TARGET.Torso
- if FOE then
- ATTACKING = true
- ChaosOrAnything()
- local E = 0
- repeat
- Swait()
- E = E + 1
- ClerpBody({
- CF(0,-E/25,0)*ANGLES(RAD(0),RAD(0),RAD(0)),
- CF(0,-0.5,0)*ANGLES(RAD(15),RAD(0),RAD(0))*CF(0,-1,0),
- CF(0,0.5,0)*ANGLES(RAD(-120),RAD(0),RAD(35))*CF(-1.5,-0.5,0),
- CF(0,0.5,0)*ANGLES(RAD(-120),RAD(0),RAD(-35))*CF(1.5,-0.5,0),
- CF(-0,0.5,0)*ANGLES(RAD(15),RAD(0),RAD(0))*CF(-0.5,1,0.5),
- CF(0,0.5,0)*ANGLES(RAD(15),RAD(0),RAD(0))*CF(0.5,0.9,0.5),
- },"Attack")
- until ROOT.ChaosChaos.Playing == false and ROOT.MeDoAnything.Playing == false
- for i = 1, MRANDOM(3,5) do
- local TO = FOE.Position
- local MOVETO = CF(FOE.Position+VT(0,1,0))*ANGLES(0,RAD(MRANDOM(0,359)),0)*CF(0,0,15)
- CHARACTER:SetPrimaryPartCFrame(MOVETO)
- Transparent(0)
- ROOT.OH:Play()
- for i = 1, 5 do
- ClerpBody({
- CF(0,0,0)*ANGLES(RAD(0),RAD(0),RAD(0)),
- CF(0,-0.5,0)*ANGLES(RAD(5),RAD(0),RAD(0))*CF(0,-1,0),
- CF(0,0.5,0)*ANGLES(RAD(-75),RAD(0),RAD(-35))*CF(-1.5,-0.5,0),
- CF(0,0.5,0)*ANGLES(RAD(-75),RAD(0),RAD(35))*CF(1.5,-0.5,0),
- CF(-0,0.5,0)*ANGLES(RAD(15),RAD(0),RAD(0))*CF(-0.5,1,0.5),
- CF(0,0.5,0)*ANGLES(RAD(15),RAD(0),RAD(0))*CF(0.5,0.9,0.5),
- },"Attack")
- end
- for i = 1, 3 do
- local ANGLE = (50-(25*i))/1.25
- coroutine.resume(coroutine.create(function()
- local TOFIREFROM = ROOT.CFrame*ANGLES(0,RAD(ANGLE),0)
- local CLUB = CreatePart(3, workspace, "Granite", 0, 0, TORSO.BrickColor, "Spade", VT(1.5,0.5,1.5), false)
- CreateMesh("SpecialMesh", CLUB, "FileMesh", CLUBSMESH, "", VT(0.75,0.75,0.75), VT(0,0,0))
- CLUB.CFrame = TOFIREFROM
- local GO = IT("BodyVelocity",CLUB)
- GO.Velocity = CLUB.CFrame.lookVector*65
- Debris:AddItem(CLUB,1)
- CLUB.Touched:Connect(function(HIT)
- if HIT.Parent:FindFirstChildOfClass("Humanoid") and HIT.Parent ~= CHARACTER then
- CLUB:Remove()
- CreateSound(410625063, HIT.Parent:FindFirstChildOfClass("Humanoid").Torso, 2, 1, false)
- HIT.Parent:FindFirstChildOfClass("Humanoid").Health = HIT.Parent:FindFirstChildOfClass("Humanoid").Health - 10
- end
- end)
- end))
- end
- for i = 1, 35 do
- Swait()
- ClerpBody({
- CF(0,-i/350,0)*ANGLES(RAD(0),RAD(0),RAD(0)),
- CF(0,-0.5,0)*ANGLES(RAD(15),RAD(0),RAD(0))*CF(0,-1,0),
- CF(0,0.5,0)*ANGLES(RAD(-120),RAD(0),RAD(35))*CF(-1.5,-0.5,0),
- CF(0,0.5,0)*ANGLES(RAD(-120),RAD(0),RAD(-35))*CF(1.5,-0.5,0),
- CF(-0,0.5,0)*ANGLES(RAD(15),RAD(0),RAD(0))*CF(-0.5,1,0.5),
- CF(0,0.5,0)*ANGLES(RAD(15),RAD(0),RAD(0))*CF(0.5,0.9,0.5),
- },"Attack")
- Transparent(i/35)
- end
- if TARGET.Health <= 0 or DEAD == true then
- break
- end
- end
- ATTACKING = false
- for i = 1, 25 do
- Swait()
- Transparent((25-i)/25)
- end
- Transparent(0)
- end
- end
- function Diamonds(TARGET)
- local FOE = TARGET.Torso
- if FOE then
- ChaosOrAnything()
- ATTACKING = true
- coroutine.resume(coroutine.create(function()
- repeat
- Swait()
- CHARACTER:SetPrimaryPartCFrame(Clerp(ROOT.CFrame,CF(VT(ROOT.Position.X,FOE.Position.Y,ROOT.Position.Z),FOE.Position),0.2))
- ClerpBody({
- CF(0,0.1*SIN(SINE/12),0)*ANGLES(RAD(0),RAD(0),RAD(0)),
- CF(0,-0.5,0)*ANGLES(RAD(15+2*COS(SINE/12)),RAD(0),RAD(0))*CF(0,-1,0),
- 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),
- 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),
- CF(-0,0.5,0)*ANGLES(RAD(15+2*COS(SINE/12)),RAD(0),RAD(0))*CF(-0.5,1,0.5),
- CF(0,0.5,0)*ANGLES(RAD(15+2*COS(SINE/12)),RAD(0),RAD(0))*CF(0.5,0.9,0.5),
- },"Attack")
- until ATTACKING == false
- end))
- for i = 1, MRANDOM(25,35) do
- coroutine.resume(coroutine.create(function()
- local DIAMOND = CreatePart(3, workspace, "Granite", 0, 1, TORSO.BrickColor, "Diamond", VT(0.5,0.5,1.5), true)
- CreateMesh("SpecialMesh", DIAMOND, "FileMesh", DIAMONDMESH, "", VT(0.1, 0.05, 0.15), VT(0,0,0))
- DIAMOND.CFrame = ROOT.CFrame*CF(MRANDOM(-150,150)/20,0,-1.5)
- for i = 1, 15 do
- Swait()
- DIAMOND.Transparency = (15-i)/15
- DIAMOND.CFrame = DIAMOND.CFrame*CF(0,0,-(15-i)/35)
- end
- DIAMOND.Anchored = false
- DIAMOND.Transparency = 0
- local GO = IT("BodyVelocity",DIAMOND)
- GO.Velocity = DIAMOND.CFrame.lookVector*15
- Debris:AddItem(DIAMOND,1)
- DIAMOND.Touched:Connect(function(HIT)
- if HIT.Parent:FindFirstChildOfClass("Humanoid") and HIT.Parent ~= CHARACTER then
- DIAMOND:Remove()
- CreateSound(410625063, HIT.Parent:FindFirstChildOfClass("Humanoid").Torso, 2, 1, false)
- HIT.Parent:FindFirstChildOfClass("Humanoid").Health = HIT.Parent:FindFirstChildOfClass("Humanoid").Health - 7.5
- end
- end)
- for i = 1, 5 do
- Swait()
- GO.Velocity = DIAMOND.CFrame.lookVector*(15*i)
- end
- end))
- if TARGET.Health <= 0 or DEAD == true then
- break
- end
- Swait(7)
- end
- ATTACKING = false
- end
- end
- function RingAround(TARGET)
- local FOE = TARGET.Torso
- if FOE then
- ATTACKING = true
- ChaosOrAnything()
- local E = 0
- repeat
- Swait()
- E = E + 1
- ClerpBody({
- CF(0,(-E/25)+0.1*SIN(SINE/12),0)*ANGLES(RAD(0),RAD(0),RAD(0)),
- CF(0,-0.5,0)*ANGLES(RAD(15+2*COS(SINE/12)),RAD(0),RAD(0))*CF(0,-1,0),
- 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),
- 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),
- CF(-0,0.5,0)*ANGLES(RAD(15+2*COS(SINE/12)),RAD(0),RAD(0))*CF(-0.5,1,0.5),
- CF(0,0.5,0)*ANGLES(RAD(15+2*COS(SINE/12)),RAD(0),RAD(0))*CF(0.5,0.9,0.5),
- },"Attack")
- until ROOT.ChaosChaos.Playing == false and ROOT.MeDoAnything.Playing == false
- coroutine.resume(coroutine.create(function()
- repeat
- Swait()
- CHARACTER:SetPrimaryPartCFrame(Clerp(ROOT.CFrame,CF(ROOT.Position,VT(FOE.Position.X,ROOT.Position.Y,FOE.Position.Z)),0.2))
- ClerpBody({
- CF(0,0.1*SIN(SINE/12),0)*ANGLES(RAD(0),RAD(0),RAD(0)),
- CF(0,-0.5,0)*ANGLES(RAD(15+2*COS(SINE/12)),RAD(0),RAD(0))*CF(0,-1,0),
- 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),
- 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),
- CF(-0,0.5,0)*ANGLES(RAD(15+2*COS(SINE/12)),RAD(0),RAD(0))*CF(-0.5,1,0.5),
- CF(0,0.5,0)*ANGLES(RAD(15+2*COS(SINE/12)),RAD(0),RAD(0))*CF(0.5,0.9,0.5),
- },"Attack")
- until ATTACKING == false
- end))
- for i = 1, MRANDOM(2,4) do
- local SPAWN = CF(FOE.Position)*ANGLES(0,RAD(MRANDOM(0,359)),0)
- local SPADES = {}
- for i = 1, 10 do
- local SPADE = CreatePart(3, workspace, "Granite", 0, 1, TORSO.BrickColor, "Spade", VT(2,2,2), true)
- CreateMesh("SpecialMesh", SPADE, "FileMesh", SPADEMESH, "", VT(1.2,1.2,1.2), VT(0,0,0))
- SPADE.CFrame = SPAWN*ANGLES(0,RAD(36*i),0)*CF(0,0,35)
- SPADE.Touched:Connect(function(HIT)
- if HIT.Parent:FindFirstChildOfClass("Humanoid") and HIT.Parent ~= CHARACTER then
- SPADE:Remove()
- CreateSound(410625063, HIT.Parent:FindFirstChildOfClass("Humanoid").Torso, 2, 1, false)
- HIT.Parent:FindFirstChildOfClass("Humanoid").Health = HIT.Parent:FindFirstChildOfClass("Humanoid").Health - 10
- end
- end)
- table.insert(SPADES,SPADE)
- end
- for i = 1, 25 do
- for E = 1, #SPADES do
- SPADES[E].CFrame = SPADES[E].CFrame * CF(0,0,-0.5)
- SPADES[E].Transparency = (10-i)/9.5
- end
- Swait()
- end
- wait(0.2)
- for E = 1, #SPADES do
- coroutine.resume(coroutine.create(function()
- local SPADE = SPADES[E]
- for i = 1, 15 do
- SPADE.CFrame = SPADE.CFrame*CF(0,0,(15-i)/15)
- Swait()
- end
- SPADE.Anchored = false
- local GO = IT("BodyVelocity",SPADE)
- GO.Velocity = SPADE.CFrame.lookVector*5
- GO.MaxForce = GO.MaxForce * 100
- Debris:AddItem(SPADE,1)
- SPADE.Touched:Connect(function(HIT)
- if HIT.Parent:FindFirstChildOfClass("Humanoid") and HIT.Parent ~= CHARACTER then
- SPADE:Remove()
- CreateSound(410625063, HIT.Parent:FindFirstChildOfClass("Humanoid").Torso, 2, 1, false)
- HIT.Parent:FindFirstChildOfClass("Humanoid").Health = HIT.Parent:FindFirstChildOfClass("Humanoid").Health - 2.5
- end
- end)
- for i = 1, 15 do
- Swait()
- GO.Velocity = SPADE.CFrame.lookVector*(5*i)
- end
- end))
- Swait(5)
- end
- if TARGET.Health <= 0 or DEAD == true then
- break
- end
- end
- wait(0.5)
- ATTACKING = false
- end
- end
- function HeartsGoesOut(TARGET)
- local FOE = TARGET.Torso
- if FOE then
- ChaosOrAnything()
- ATTACKING = true
- coroutine.resume(coroutine.create(function()
- repeat
- Swait()
- CHARACTER:SetPrimaryPartCFrame(Clerp(ROOT.CFrame,CF(ROOT.Position,VT(FOE.Position.X,ROOT.Position.Y,FOE.Position.Z)),0.2))
- ClerpBody({
- CF(0,0.1*SIN(SINE/12),0)*ANGLES(RAD(0),RAD(0),RAD(0)),
- CF(0,-0.5,0)*ANGLES(RAD(15+2*COS(SINE/12)),RAD(0),RAD(0))*CF(0,-1,0),
- 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),
- 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),
- CF(-0,0.5,0)*ANGLES(RAD(15+2*COS(SINE/12)),RAD(0),RAD(0))*CF(-0.5,1,0.5),
- CF(0,0.5,0)*ANGLES(RAD(15+2*COS(SINE/12)),RAD(0),RAD(0))*CF(0.5,0.9,0.5),
- },"Attack")
- until ATTACKING == false
- end))
- for i = 1, MRANDOM(5,7) do
- local SPAWN = CF(FOE.Position+VT(0,1,0))*ANGLES(0,RAD(MRANDOM(0,359)),0)*CF(0,0,35)
- SPAWN = CF(SPAWN.p,FOE.Position+VT(0,1,0))
- coroutine.resume(coroutine.create(function()
- local HEARTS = {}
- for i = 1, 4 do
- local HEART = CreatePart(3, workspace, "Granite", 0, 1, TORSO.BrickColor, "Heart", VT(2,2,2), true)
- CreateMesh("SpecialMesh", HEART, "FileMesh", HEARTMESH, "", VT(3.5,3.5,3.5), VT(0,0,0))
- HEART.CFrame = SPAWN*ANGLES(0,RAD((360/4)*i),0)
- HEART.Touched:Connect(function(HIT)
- if HIT.Parent:FindFirstChildOfClass("Humanoid") and HIT.Parent ~= CHARACTER then
- HEART:Remove()
- CreateSound(410625063, HIT.Parent:FindFirstChildOfClass("Humanoid").Torso, 2, 1, false)
- HIT.Parent:FindFirstChildOfClass("Humanoid").Health = HIT.Parent:FindFirstChildOfClass("Humanoid").Health - 7.5
- end
- end)
- table.insert(HEARTS,HEART)
- end
- for i = 1, 10 do
- Swait()
- for E = 1, #HEARTS do
- HEARTS[E].CFrame = HEARTS[E].CFrame*CF(0,0,-(10-i)/10)
- HEARTS[E].Transparency = (10-i)/9.5
- end
- end
- local DIST = (HEARTS[1].Position - SPAWN.p).Magnitude
- for i = 1, 100 do
- Swait()
- SPAWN = SPAWN*CF(0,0,-1)
- for E = 1, #HEARTS do
- HEARTS[E].Transparency = 0
- HEARTS[E].CFrame = SPAWN*ANGLES(0,RAD(((360/4)*E)+(i*5)),0)*CF(0,0,-DIST)
- end
- end
- for E = 1, #HEARTS do
- HEARTS[E]:Destroy()
- end
- end))
- Swait(35)
- if TARGET.Health <= 0 or DEAD == true then
- break
- end
- end
- wait(0.5)
- ATTACKING = false
- end
- end
- function Meta(TARGET)
- local FOE = TARGET.Torso
- if FOE then
- ROOT.Metamorph:Play()
- ATTACKING = true
- local SCYTHE = CreatePart(3, workspace, "Granite", 0, 1, TORSO.BrickColor, "Diamond", VT(3,0,3), true)
- CreateMesh("SpecialMesh", SCYTHE, "FileMesh", SCYTHEMESH, "", VT(0.01, 0.01, 0.01), VT(0,0,0))
- SCYTHE.CFrame = TORSO.CFrame
- for i = 1, 3 do
- for i = 1, 15 do
- Swait()
- ClerpBody({
- CF(0,0.1*SIN(SINE/12),0)*ANGLES(RAD(0),RAD(0),RAD(0)),
- CF(0,-0.5,0)*ANGLES(RAD(15+2*COS(SINE/12)),RAD(0),RAD(0))*CF(0,-1,0),
- 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),
- 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),
- CF(-0,0.5,0)*ANGLES(RAD(15+2*COS(SINE/12)),RAD(0),RAD(0))*CF(-0.5,1,0.5),
- CF(0,0.5,0)*ANGLES(RAD(15+2*COS(SINE/12)),RAD(0),RAD(0))*CF(0.5,0.9,0.5),
- },"Attack")
- Transparent(i/15)
- SCYTHE.Transparency = (15-i)/15
- SCYTHE.CFrame = CF(TORSO.Position)*ANGLES(0,RAD(SINE*5),0)
- end
- for i = 1, 15 do
- Swait()
- ClerpBody({
- CF(0,0.1*SIN(SINE/12),0)*ANGLES(RAD(0),RAD(0),RAD(0)),
- CF(0,-0.5,0)*ANGLES(RAD(15+2*COS(SINE/12)),RAD(0),RAD(0))*CF(0,-1,0),
- 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),
- 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),
- CF(-0,0.5,0)*ANGLES(RAD(15+2*COS(SINE/12)),RAD(0),RAD(0))*CF(-0.5,1,0.5),
- CF(0,0.5,0)*ANGLES(RAD(15+2*COS(SINE/12)),RAD(0),RAD(0))*CF(0.5,0.9,0.5),
- },"Attack")
- Transparent((15-i)/15)
- SCYTHE.Transparency = i/15
- SCYTHE.CFrame = CF(TORSO.Position)*ANGLES(0,RAD(SINE*5),0)
- end
- end
- for i = 1, 15 do
- Swait()
- ClerpBody({
- CF(0,0.1*SIN(SINE/12),0)*ANGLES(RAD(0),RAD(0),RAD(0)),
- CF(0,-0.5,0)*ANGLES(RAD(15+2*COS(SINE/12)),RAD(0),RAD(0))*CF(0,-1,0),
- 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),
- 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),
- CF(-0,0.5,0)*ANGLES(RAD(15+2*COS(SINE/12)),RAD(0),RAD(0))*CF(-0.5,1,0.5),
- CF(0,0.5,0)*ANGLES(RAD(15+2*COS(SINE/12)),RAD(0),RAD(0))*CF(0.5,0.9,0.5),
- },"Attack")
- Transparent(i/15)
- SCYTHE.Transparency = (15-i)/15
- SCYTHE.CFrame = CF(TORSO.Position)*ANGLES(0,RAD(SINE*5),0)
- end
- Transparent(1)
- SCYTHE.Transparency = 0
- local SCYTHES = {SCYTHE}
- for i = 1, 3 do
- local COPY = SCYTHE:Clone()
- COPY.Parent = workspace
- COPY.CFrame = SCYTHE.CFrame
- table.insert(SCYTHES,COPY)
- end
- for E = 1, #SCYTHES do
- local DELAY = false
- SCYTHES[E].Touched:Connect(function(HIT)
- if HIT.Parent:FindFirstChildOfClass("Humanoid") and HIT.Parent ~= CHARACTER and DELAY == false then
- HIT.Parent:FindFirstChildOfClass("Humanoid").Health = HIT.Parent:FindFirstChildOfClass("Humanoid").Health - 3.5
- CreateSound(410625063, HIT.Parent:FindFirstChildOfClass("Humanoid").Torso, 2, 1, false)
- DELAY = true
- wait(1)
- DELAY = false
- end
- end)
- end
- local NOW = ROOT.CFrame
- CHARACTER:SetPrimaryPartCFrame(CF(0,5000,0))
- HUMANOID.Parent = nil
- local Y = FOE.Position.Y
- for i = 1, 750 do
- Swait()
- for E = 1, #SCYTHES do
- 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)
- end
- if TARGET.Health <= 0 or DEAD == true then
- break
- end
- end
- for i = 1, 25 do
- for E = 1, #SCYTHES do
- SCYTHES[E].CFrame = CF(Clerp(SCYTHES[E].CFrame,NOW,0.15).p)*ANGLES(0,RAD(SINE*5),0)
- end
- Swait()
- end
- CHARACTER:SetPrimaryPartCFrame(NOW)
- HUMANOID.Parent = CHARACTER
- for i = 1, 15 do
- Swait()
- ClerpBody({
- CF(0,0.1*SIN(SINE/12),0)*ANGLES(RAD(0),RAD(0),RAD(0)),
- CF(0,-0.5,0)*ANGLES(RAD(15+2*COS(SINE/12)),RAD(0),RAD(0))*CF(0,-1,0),
- 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),
- 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),
- CF(-0,0.5,0)*ANGLES(RAD(15+2*COS(SINE/12)),RAD(0),RAD(0))*CF(-0.5,1,0.5),
- CF(0,0.5,0)*ANGLES(RAD(15+2*COS(SINE/12)),RAD(0),RAD(0))*CF(0.5,0.9,0.5),
- },"Attack")
- Transparent((15-i)/15)
- for E = 1, #SCYTHES do
- SCYTHES[E].CFrame = CF(ROOT.Position)*ANGLES(0,RAD(SINE*5),0)
- SCYTHES[E].Transparency = i/15
- end
- end
- for E = 1, #SCYTHES do
- SCYTHES[E]:Remove()
- end
- ATTACKING = false
- end
- end
- local ATTACKS = {OhOhOh,Diamonds,RingAround,HeartsGoesOut,Meta}
- --//=================================\\
- --|| WRAP
- --\\=================================//
- function BEGINAI()
- local TORSOROT = 0
- CHARACTER:SetPrimaryPartCFrame(ROOT.CFrame*CF(0,1,0))
- coroutine.resume(coroutine.create(function()
- game:GetService("RunService").Heartbeat:connect(function()
- local DEFAULTS = {
- CF(0,0,0),
- CF(0,-0.5,0)*ANGLES(RAD(0),RAD(0),RAD(0))*CF(0,-1,0),
- CF(0,0.5,0)*ANGLES(RAD(0),RAD(0),RAD(0))*CF(-1.5,-0.5,0),
- CF(0,0.5,0)*ANGLES(RAD(0),RAD(0),RAD(0))*CF(1.5,-0.5,0),
- CF(-0,1,0)*ANGLES(RAD(0),RAD(0),RAD(0))*CF(-0.5,1,0),
- CF(0,1,0)*ANGLES(RAD(0),RAD(0),RAD(0))*CF(0.5,1,0),
- }
- SINE = SINE + 1
- end)
- while true do
- TORSOROT = 35
- for i = 1, 5 do
- ClerpBody({
- CF(0,0,0)*ANGLES(RAD(0),RAD(35),RAD(0)),
- CF(0,-0.5,0)*ANGLES(RAD(15),RAD(-20),RAD(0))*CF(0,-1,0),
- CF(0,0.5,0)*ANGLES(RAD(12),RAD(0),RAD(0))*CF(-1.5,-0.5,0),
- CF(0,0.5,0)*ANGLES(RAD(-120),RAD(0),RAD(-35))*CF(1.5,-0.5,0),
- CF(-0,0,0)*ANGLES(RAD(0),RAD(0),RAD(0))*CF(-0.5,1,1),
- CF(0,1,0)*ANGLES(RAD(15),RAD(0),RAD(0))*CF(0.5,0.9,0.2),
- },nil)
- end
- for i = 1, 15 do
- Swait()
- ClerpBody({
- CF(0,0.3,0)*ANGLES(RAD(0),RAD(35),RAD(0)),
- CF(0,-0.5,0)*ANGLES(RAD(0),RAD(-35),RAD(0))*CF(0,-1,0),
- CF(0,0.5,0)*ANGLES(RAD(12),RAD(0),RAD(0))*CF(-1.5,-0.5,0),
- CF(0,0.75,0)*ANGLES(RAD(-120),RAD(0),RAD(-35))*CF(1.5,-0.25,0),
- CF(-0,1,0)*ANGLES(RAD(0),RAD(0),RAD(0))*CF(-0.5,1,0.5),
- CF(0,1,0)*ANGLES(RAD(15),RAD(0),RAD(0))*CF(0.5,0.9,0.2),
- },nil)
- if DEAD == true then
- break
- end
- end
- if DEAD == true then
- break
- end
- TORSOROT = -35
- for i = 1, 5 do
- ClerpBody({
- CF(0,0,0)*ANGLES(RAD(0),RAD(-35),RAD(0)),
- CF(0,-0.5,0)*ANGLES(RAD(15),RAD(20),RAD(0))*CF(0,-1,0),
- CF(0,0.5,0)*ANGLES(RAD(-120),RAD(0),RAD(35))*CF(-1.5,-0.5,0),
- CF(0,0.5,0)*ANGLES(RAD(12),RAD(0),RAD(0))*CF(1.5,-0.5,0),
- CF(-0,1,0)*ANGLES(RAD(15),RAD(0),RAD(0))*CF(-0.5,0.9,0.2),
- CF(0,0,0)*ANGLES(RAD(0),RAD(0),RAD(0))*CF(0.5,0.9,1),
- },nil)
- end
- for i = 1, 15 do
- Swait()
- ClerpBody({
- CF(0,0.3,0)*ANGLES(RAD(0),RAD(-35),RAD(0)),
- CF(0,-0.5,0)*ANGLES(RAD(0),RAD(35),RAD(0))*CF(0,-1,0),
- CF(0,0.75,0)*ANGLES(RAD(-120),RAD(0),RAD(35))*CF(-1.5,-0.25,0),
- CF(0,0.5,0)*ANGLES(RAD(12),RAD(0),RAD(0))*CF(1.5,-0.5,0),
- CF(-0,1,0)*ANGLES(RAD(15),RAD(0),RAD(0))*CF(-0.5,1,0.2),
- CF(0,1,0)*ANGLES(RAD(0),RAD(0),RAD(0))*CF(0.5,1,0.5),
- },nil)
- if DEAD == true then
- break
- end
- end
- if DEAD == true then
- break
- end
- end
- end))
- local TARGET = nil
- local TARGETHUM = nil
- coroutine.resume(coroutine.create(function()
- --local h = HUMANOID
- local pathService = game:GetService("PathfindingService")
- local goToPos = function(loc,target)
- local distance = (loc-ROOT.Position).magnitude
- local start = tick()
- while distance > 7 do
- if target then
- if target.Torso and ATTACKING == false then
- GoTo(loc+VT(0,4.5,0))
- Swait()
- local RAYTEST = Raycast(ROOT.Position,CF(ROOT.Position,target.Torso.Position).lookVector,500,CHARACTER)
- if distance <= 7 or TARGETHUM ~= target or TestForTarget(RAYTEST,target) == false then -- Something may have gone wrong. Just break.
- break
- end
- distance = (loc+VT(0,4.5,0)-ROOT.Position).magnitude
- else
- break
- end
- else
- break
- end
- end
- end
- while true do
- if DEAD == true then
- break
- end
- Swait()
- if TARGETHUM then
- local target = TARGETHUM
- if TARGETHUM.Torso then
- local RAYTEST = Raycast(ROOT.Position,CF(ROOT.Position,VT(target.Torso.Position.X,ROOT.Position.Y,target.Torso.Position.Z)).lookVector,500,CHARACTER)
- if TestForTarget(RAYTEST,target) == true then
- local path = pathService:ComputeRawPathAsync(ROOT.Position,TARGETHUM.Torso.Position,5000)
- local didBreak = false
- local targetStart
- if target and ROOT and target.Torso then
- targetStart = target.Torso.Position
- local previous = ROOT.Position
- local points = path:GetWaypoints()
- local s = #points > 1 and 2 or 1
- for i = s,#points do
- if GYRO == nil then
- local point = points[i].Position
- if didBreak then
- break
- end
- if target and target.Torso and target.Health > 0 and ATTACKING == false then
- if (ROOT.Position - point).Magnitude > 1 and TARGETHUM == target then
- local pos = previous:lerp(point,0.65)
- goToPos(previous:lerp(point,0.65),target)
- previous = point
- end
- else
- didBreak = true
- break
- end
- end
- end
- end
- if not didBreak and targetStart then
- goToPos(targetStart)
- end
- else
- if ATTACKING == false then
- GoTo(target.Torso.Position+VT(0,2.5,0))
- end
- end
- end
- end
- end
- end))
- HUMANOID.Died:Connect(function()
- if DEAD == false then
- DEAD = true
- repeat
- Swait()
- until ATTACKING == false
- CHAIR.Transparency = 0
- Transparent(0)
- script.Music:Stop()
- ROOT.Deathed:Play()
- repeat
- Swait()
- ClerpBody({
- CF(0,0,0)*ANGLES(RAD(0),RAD(0),RAD(0)),
- CF(0,-0.5,0)*ANGLES(RAD(35),RAD(0),RAD(0))*CF(0,-1,0),
- CF(0,0.5,0)*ANGLES(RAD(-35),RAD(0),RAD(5))*CF(-1.5,-0.3,0),
- CF(0,0.5,0)*ANGLES(RAD(-35),RAD(0),RAD(-5))*CF(1.5,-0.3,0),
- CF(-0,0,0)*ANGLES(RAD(-15),RAD(0),RAD(0))*CF(-0.5,1,1),
- CF(0,0,0)*ANGLES(RAD(-15),RAD(0),RAD(0))*CF(0.5,1,1),
- },nil)
- until ROOT.Deathed.Playing == false
- CHARACTER.Head.Nametag:Remove()
- TORSO.Neck:Remove()
- TORSO.Die:Play()
- ROOT:Remove()
- CHARACTER:BreakJoints()
- CHAIR:Destroy()
- Debris:AddItem(CHARACTER,5)
- end
- end)
- HUMANOID.HealthChanged:Connect(function()
- if HIT == false and DEAD == false then
- HIT = true
- local HA = {ROOT.Ha1,ROOT.Ha2}
- HA[MRANDOM(1,2)]:Play()
- for i = 1, 100 do
- Swait()
- if ATTACKING == true then
- Neck.C1 = Clerp(Neck.C1, CF(0,-2.5,0)*ANGLES(0,0,RAD(65*SIN(i/6)))*CF(0,-1,0), 0.2)
- else
- 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)
- end
- if DEAD == true then
- break
- end
- end
- HIT = false
- end
- end)
- while true do
- if DEAD == true then
- break
- end
- local TARGETVARIANTS = {}
- TARGET = nil
- for index, CHILD in pairs(workspace:GetChildren()) do
- if CHILD ~= CHARACTER and CHILD:FindFirstChild("Slain") == nil then
- local HUMAN = CHILD:FindFirstChildOfClass("Humanoid")
- if HUMAN then
- if HUMAN.Health > 0 then
- if HUMAN.Torso then
- local DISTANCE = (HUMAN.Torso.Position - ROOT.Position).Magnitude
- table.insert(TARGETVARIANTS,{CHILD,DISTANCE})
- end
- end
- end
- end
- end
- local DIST = math.huge
- for E = 1, #TARGETVARIANTS do
- local PLAYER = TARGETVARIANTS[E]
- local CHARACTER = PLAYER[1]
- local DISTANCE = PLAYER[2]
- if DISTANCE < DIST then
- DIST = DISTANCE
- TARGET = CHARACTER
- end
- end
- if TARGET and TARGET:FindFirstChild("HumanoidRootPart") then
- TARGETHUM = TARGET:FindFirstChildOfClass("Humanoid")
- --[[HUMANOID.WalkSpeed = 22
- HUMANOID.JumpPower = 125]]
- local RAY = Raycast(ROOT.Position,CF(ROOT.Position,TARGETHUM.Torso.Position).lookVector,25,CHARACTER)
- 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
- ATTACKS[MRANDOM(1,#ATTACKS)](TARGETHUM)
- end
- else
- TARGETHUM = nil
- end
- wait()
- end
- end
- BEGINAI()
Add Comment
Please, Sign In to add comment