Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ai = script.Parent
- local rs = game:GetService("RunService")
- local canAttack = ai:WaitForChild("CanAttack")
- local rageMode = ai:WaitForChild("Rage")
- local zom = ai:WaitForChild("Zombie")
- local laserbeamPoint = ai:WaitForChild("LaserBeamPoint")
- local staff = ai:WaitForChild("Handle")
- local staffpower = staff:WaitForChild("SpreadMagic")
- local torso = ai:WaitForChild("Torso")
- local ignorefolder = Instance.new("Folder", game.Workspace)
- ignorefolder.Name = ai.Name
- ai.Parent = ignorefolder
- local ignoreParts = {}
- for i, v in pairs(ignorefolder:GetDescendants()) do
- if v:IsA('BasePart') or v:IsA("MeshPart") then
- table.insert(ignoreParts, v)
- end
- end
- local laserbeamRagePart1 = zom:LoadAnimation(script.LaserBeamRage1)
- local laserbeamRagePart2 = zom:LoadAnimation(script.LaserBeamRage2)
- local spreadExplosion = zom:LoadAnimation(script.SpreadExplosion)
- local explosiveThrow = zom:LoadAnimation(script.ExplosiveThrow)
- local floorSlam = zom:LoadAnimation(script.FloorSlam)
- local spreadExplosionDmg = 75
- local laserbeamDmg = math.huge
- local explosionDmg = 60
- local selfBlastDmg = 95
- --ragemode dmg
- local rspreadExplosionDmg = 150
- local rlaserbeamDmg = math.huge
- local rexplosionDmg = 100
- local rselfBlastDmg = 175
- --ragemode dmg
- local maxSpreadExplosionAmount = 1
- local maxlaserBeamAmount = 1
- local maxExplosionAmount = 4
- local maxSelfBlast = 1
- local SpreadExplosionAmount = 1
- local laserBeamAmount = 1
- local explosionAmount = 4
- local selfBlastAmount = 1
- local canOperate = true
- function findNearestTorso(pos)
- local list = game.Workspace:children()
- local torso = nil
- local dist = 100000
- local temp = nil
- local human = nil
- local temp2 = nil
- for x = 1, #list do
- temp2 = list[x]
- if (temp2.className == "Model") and (temp2 ~= script.Parent) then
- temp = temp2:findFirstChild("HumanoidRootPart")
- human = temp2:findFirstChild("Humanoid")
- if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
- if (temp.Position - pos).magnitude < dist then
- torso = temp
- dist = (temp.Position - pos).magnitude
- end
- end
- end
- end
- return torso
- end
- while true do
- if canOperate == true and zom.Health > 0 then
- local target = findNearestTorso(torso.Position)
- if target ~= nil and zom.Health > 0 and canAttack.Value == true then
- if (torso.CFrame.p - target.CFrame.p).magnitude > 15 and (torso.CFrame.p - target.CFrame.p).magnitude < 100 and zom.Health > 0 then
- while explosionAmount > 0 and zom.Health > 0 and canAttack.Value == true do
- explosiveThrow:Play()
- local speed, jump = zom.WalkSpeed, zom.JumpPower
- zom.WalkSpeed = 0
- zom.JumpPower = 0
- explosiveThrow.Stopped:Wait()
- zom.WalkSpeed = speed
- zom.JumpPower = jump
- explosionAmount = explosionAmount - 1
- local t = 1
- local g = Vector3.new(0, -game.Workspace.Gravity, 0)
- local x0 = staff.CFrame * Vector3.new(0, 1, 0)
- local v0 = (target.CFrame.p - x0 - 0.5*g*t*t)/t
- local blastOrb1 = Instance.new("Part", game.Workspace)
- blastOrb1.Name = "ExplosionBlastOrb"
- blastOrb1.Velocity = v0
- if rageMode.Value == false then
- blastOrb1.Color = Color3.fromRGB(0, 255, 255)
- else
- blastOrb1.Color = Color3.fromRGB(0, 0, 0)
- end
- blastOrb1.Material = Enum.Material.Neon
- blastOrb1.Rotation = Vector3.new(8,8,8)
- blastOrb1.Transparency = .6
- blastOrb1.CanCollide = false
- blastOrb1.Anchored = false
- blastOrb1.Size = Vector3.new(2, 2.25, 2)
- blastOrb1.CFrame = CFrame.new(x0)
- local emitBlock = Instance.new("Part", game.Workspace)
- emitBlock.Name = "EmitterBlock"
- emitBlock.Color = Color3.fromRGB(0, 0, 0)
- emitBlock.Material = Enum.Material.SmoothPlastic
- emitBlock.Rotation = Vector3.new(8,8,8)
- emitBlock.Transparency = 1
- emitBlock.CanCollide = false
- emitBlock.Anchored = false
- emitBlock.Massless = true
- emitBlock.Locked = true
- emitBlock.Size = Vector3.new(2, 2.25, 2)
- local motor = Instance.new("Motor6D", emitBlock)
- motor.Part0 = emitBlock
- motor.Part1 = blastOrb1
- motor.C0 = CFrame.new()
- motor.C1 = CFrame.new()
- local emit
- if rageMode.Value == false then
- emit = script.BlastOrbProjectile1:Clone()
- emit.Parent = emitBlock
- emit.Enabled = true
- else
- emit = script.BlastOrbProjectile2:Clone()
- emit.Parent = emitBlock
- emit.Enabled = true
- end
- local proSpin = script.ProjectileSpin:Clone()
- proSpin.Parent = blastOrb1
- proSpin.Disabled = false
- blastOrb1.Touched:Connect(function(hit)
- local once = true
- if hit and hit ~= emitBlock and hit ~= staffpower and hit.Parent and hit.Parent ~= ai and not hit:FindFirstChild("HThunderValue") and not hit:FindFirstChild("ExplosionValue") then
- if once == true then
- once = false
- emitBlock.Anchored = true
- emit.Enabled = false
- local harmlessThunder = Instance.new("Part", game.Workspace)
- harmlessThunder.Name = "HarmlessThunderEffect"
- if rageMode.Value == false then
- harmlessThunder.Color = Color3.fromRGB(0, 255, 255)
- else
- harmlessThunder.Color = Color3.fromRGB(0, 0, 0)
- end
- harmlessThunder.Material = Enum.Material.Neon
- harmlessThunder.Size = Vector3.new(15, math.huge, 15)
- harmlessThunder.CFrame = CFrame.new(blastOrb1.Position)
- harmlessThunder.CanCollide = false
- harmlessThunder.Anchored = true
- harmlessThunder.Transparency = .25
- local friendlyPartValue = Instance.new("Folder", harmlessThunder)
- friendlyPartValue.Name = "HThunderValue"
- local thunderParticle = script.ThunderParticle:Clone()
- thunderParticle.Parent = harmlessThunder
- thunderParticle.Enabled = true
- local thunderTEffect = script.ThunderTweenEffect:Clone()
- thunderTEffect.Parent = harmlessThunder
- thunderTEffect.Disabled = false
- local blastOrb = Instance.new("Part", game.Workspace)
- blastOrb.Name = "ExplosionBlast"
- if rageMode.Value == false then
- blastOrb.Color = Color3.fromRGB(0, 255, 255)
- else
- blastOrb.Color = Color3.fromRGB(0, 0, 0)
- end
- blastOrb.Material = Enum.Material.Neon
- blastOrb.Size = Vector3.new(15, 25, 15)
- blastOrb.CFrame = CFrame.new(blastOrb1.Position)
- blastOrb.CanCollide = false
- blastOrb.Anchored = true
- blastOrb1:Destroy()
- game:GetService("Debris"):AddItem(emitBlock, 2)
- local specialMesh = Instance.new("SpecialMesh", blastOrb)
- specialMesh.Name = "ExplosionMesh"
- specialMesh.MeshId = "http://www.roblox.com/asset/?id=92588061"
- specialMesh.MeshType = Enum.MeshType.FileMesh
- specialMesh.Offset = Vector3.new(0, 0, -0.9)
- specialMesh.Scale = Vector3.new(.25, .25, .25)
- local friendlyPartValue2 = Instance.new("Folder", blastOrb)
- friendlyPartValue2.Name = "ExplosionValue"
- local tween1 = script.Tween:Clone()
- tween1.Parent = blastOrb
- tween1.Disabled = false
- local tween2 = script.Tween2:Clone()
- tween2.Parent = blastOrb
- tween2.Disabled = false
- local spin = script.Spin:Clone()
- spin.Parent = blastOrb
- spin.Disabled = false
- blastOrb.Touched:Connect(function(hit)
- if hit and hit ~= staffpower and hit.Parent then
- if hit.className ~= "Accessory" or hit.className ~= "Hat" then
- if not hit.Parent:FindFirstChild("AttackFilterBlast1") then
- local hum = hit.Parent:FindFirstChild("Humanoid")
- if (hum ~= nil) and (hum.Health > 0) then
- local filter = Instance.new("Folder", hit.Parent)
- filter.Name = "AttackFilterBlast1"
- hum:TakeDamage(explosionDmg)
- game:GetService("Debris"):AddItem(filter, 1)
- end
- end
- end
- end
- end)
- end
- end
- end)
- wait(0.55)
- end
- if explosionAmount <= 0 then
- wait(3)
- explosionAmount = maxExplosionAmount
- end
- elseif (torso.CFrame.p - target.CFrame.p).magnitude < 15 then
- while selfBlastAmount > 0 and zom.Health > 0 and canAttack.Value == true do
- floorSlam:Play()
- local speed, jump = zom.WalkSpeed, zom.JumpPower
- zom.WalkSpeed = 0
- zom.JumpPower = 0
- floorSlam.Stopped:Wait()
- zom.WalkSpeed = speed
- zom.JumpPower = jump
- selfBlastAmount = selfBlastAmount - 1
- local blastOrb2 = Instance.new("Part", game.Workspace)
- blastOrb2.Name = "SelfBlastOrb"
- if rageMode.Value == false then
- blastOrb2.Color = Color3.fromRGB(0, 255, 255)
- else
- blastOrb2.Color = Color3.fromRGB(0, 0, 0)
- end
- blastOrb2.Material = Enum.Material.Neon
- blastOrb2.Size = Vector3.new(25, 25, 25)
- blastOrb2.CFrame = CFrame.new(ai.Head.Position)
- blastOrb2.CanCollide = false
- blastOrb2.Anchored = true
- local specialMesh = Instance.new("SpecialMesh", blastOrb2)
- specialMesh.Name = "ExplosionMesh"
- specialMesh.MeshId = "http://www.roblox.com/asset/?id=92588061"
- specialMesh.MeshType = Enum.MeshType.FileMesh
- specialMesh.Offset = Vector3.new(0, 2, -1.8)
- specialMesh.Scale = Vector3.new(.5, .5, .5)
- local tween1 = script.Tween:Clone()
- tween1.Parent = blastOrb2
- tween1.Disabled = false
- local tween2 = script.Tween2:Clone()
- tween2.Parent = blastOrb2
- tween2.Disabled = false
- local spin = script.Spin:Clone()
- spin.Parent = blastOrb2
- spin.Disabled = false
- blastOrb2.Touched:Connect(function(hit)
- if hit and hit ~= staffpower and hit.Parent then
- if hit.className ~= "Accessory" or hit.className ~= "Hat" then
- if not hit.Parent:FindFirstChild("AttackFilterBlast1") then
- local hum = hit.Parent:FindFirstChild("Humanoid")
- if (hum ~= nil) and (hum.Health > 0) then
- local filter = Instance.new("Folder", hit.Parent)
- filter.Name = "AttackFilterBlast1"
- hum:TakeDamage(selfBlastDmg)
- game:GetService("Debris"):AddItem(filter, 1)
- end
- end
- end
- end
- end)
- wait(1)
- end
- if selfBlastAmount <= 0 then
- wait(2)
- selfBlastAmount = maxSelfBlast
- end
- elseif (torso.CFrame.p - target.CFrame.p).magnitude > 100 and (torso.CFrame.p - target.CFrame.p).magnitude < 10000 and not rageMode.Value == true then
- while SpreadExplosionAmount > 0 and zom.Health > 0 and canAttack.Value == true do
- spreadExplosion:Play()
- local speed, jump = zom.WalkSpeed, zom.JumpPower
- zom.WalkSpeed = 0
- zom.JumpPower = 0
- spreadExplosion.Stopped:Wait()
- zom.WalkSpeed = speed
- zom.JumpPower = jump
- SpreadExplosionAmount = SpreadExplosionAmount - 1
- for i = 1, 10 do
- local t = 1
- local g = Vector3.new(0, -game.Workspace.Gravity, 0)
- local x0 = ai.Head.CFrame * Vector3.new(0, 20, 0)
- local v0 = (target.CFrame.p - x0 - 0.5*g*t*t)/t
- local blastOrb1 = Instance.new("Part", game.Workspace)
- blastOrb1.Name = "ExplosionBlastOrb"
- blastOrb1.Velocity = v0
- if rageMode.Value == false then
- blastOrb1.Color = Color3.fromRGB(0, 255, 255)
- else
- blastOrb1.Color = Color3.fromRGB(0, 0, 0)
- end
- blastOrb1.Material = Enum.Material.Neon
- blastOrb1.Rotation = Vector3.new(8,8,8)
- blastOrb1.Transparency = .6
- blastOrb1.CanCollide = false
- blastOrb1.Anchored = false
- blastOrb1.Size = Vector3.new(2, 2.25, 2)
- blastOrb1.CFrame = CFrame.new(x0)
- local emitBlock = Instance.new("Part", game.Workspace)
- emitBlock.Name = "EmitterBlock"
- emitBlock.Color = Color3.fromRGB(0, 0, 0)
- emitBlock.Material = Enum.Material.SmoothPlastic
- emitBlock.Rotation = Vector3.new(8,8,8)
- emitBlock.Transparency = 1
- emitBlock.CanCollide = false
- emitBlock.Anchored = false
- emitBlock.Massless = true
- emitBlock.Locked = true
- emitBlock.Size = Vector3.new(2, 2.25, 2)
- local motor = Instance.new("Motor6D", emitBlock)
- motor.Part0 = emitBlock
- motor.Part1 = blastOrb1
- motor.C0 = CFrame.new()
- motor.C1 = CFrame.new()
- local emit
- if rageMode.Value == false then
- emit = script.BlastOrbProjectile1:Clone()
- emit.Parent = emitBlock
- emit.Enabled = true
- else
- emit = script.BlastOrbProjectile2:Clone()
- emit.Parent = emitBlock
- emit.Enabled = true
- end
- local proSpin = script.ProjectileSpin:Clone()
- proSpin.Parent = blastOrb1
- proSpin.Disabled = false
- blastOrb1.Touched:Connect(function(hit)
- local once = true
- if hit and hit ~= emitBlock and hit ~= staffpower and hit.Parent and hit.Parent ~= ai and not hit:FindFirstChild("HThunderValue") and not hit:FindFirstChild("ExplosionValue") then
- if once == true then
- once = false
- emitBlock.Anchored = true
- emit.Enabled = false
- local harmlessThunder = Instance.new("Part", game.Workspace)
- harmlessThunder.Name = "HarmlessThunderEffect"
- harmlessThunder.Color = Color3.fromRGB(0, 225, 225)
- harmlessThunder.Material = Enum.Material.Neon
- harmlessThunder.Size = Vector3.new(15, math.huge, 15)
- harmlessThunder.CFrame = CFrame.new(blastOrb1.Position)
- harmlessThunder.CanCollide = false
- harmlessThunder.Anchored = true
- harmlessThunder.Transparency = .25
- local friendlyPartValue = Instance.new("Folder", harmlessThunder)
- friendlyPartValue.Name = "HThunderValue"
- local thunderParticle = script.ThunderParticle:Clone()
- thunderParticle.Parent = harmlessThunder
- thunderParticle.Enabled = true
- local thunderTEffect = script.ThunderTweenEffect:Clone()
- thunderTEffect.Parent = harmlessThunder
- thunderTEffect.Disabled = false
- local blastOrb = Instance.new("Part", game.Workspace)
- blastOrb.Name = "ExplosionBlast"
- blastOrb.Color = Color3.fromRGB(0, 255, 255)
- blastOrb.Material = Enum.Material.Neon
- blastOrb.Size = Vector3.new(15, 25, 15)
- blastOrb.CFrame = CFrame.new(blastOrb1.Position)
- blastOrb.CanCollide = false
- blastOrb.Anchored = true
- blastOrb1:Destroy()
- game:GetService("Debris"):AddItem(emitBlock, 2)
- local specialMesh = Instance.new("SpecialMesh", blastOrb)
- specialMesh.Name = "ExplosionMesh"
- specialMesh.MeshId = "http://www.roblox.com/asset/?id=92588061"
- specialMesh.MeshType = Enum.MeshType.FileMesh
- specialMesh.Offset = Vector3.new(0, 0, -0.9)
- specialMesh.Scale = Vector3.new(.25, .25, .25)
- local friendlyPartValue2 = Instance.new("Folder", blastOrb)
- friendlyPartValue2.Name = "ExplosionValue"
- local tween1 = script.Tween:Clone()
- tween1.Parent = blastOrb
- tween1.Disabled = false
- local tween2 = script.Tween2:Clone()
- tween2.Parent = blastOrb
- tween2.Disabled = false
- local spin = script.Spin:Clone()
- spin.Parent = blastOrb
- spin.Disabled = false
- blastOrb.Touched:Connect(function(hit)
- if hit and hit ~= staffpower and hit.Parent then
- if hit.className ~= "Accessory" or hit.className ~= "Hat" then
- if not hit.Parent:FindFirstChild("AttackFilterBlast1") then
- local hum = hit.Parent:FindFirstChild("Humanoid")
- if (hum ~= nil) and (hum.Health > 0) then
- local filter = Instance.new("Folder", hit.Parent)
- filter.Name = "AttackFilterBlast1"
- hum:TakeDamage(explosionDmg)
- game:GetService("Debris"):AddItem(filter, .25)
- end
- end
- end
- end
- end)
- end
- end
- end)
- wait(.25)
- end
- end
- if SpreadExplosionAmount <= 0 then
- wait(3)
- SpreadExplosionAmount = maxSpreadExplosionAmount
- end
- elseif (torso.CFrame.p - target.CFrame.p).magnitude > 100 and (torso.CFrame.p - target.CFrame.p).magnitude < 10000 and rageMode.Value == true then
- while laserBeamAmount > 0 and zom.Health > 0 and canAttack.Value == true do
- laserbeamRagePart1:Play()
- local speed, jump = zom.WalkSpeed, zom.JumpPower
- zom.WalkSpeed = 0
- zom.JumpPower = 0
- laserbeamRagePart1.Stopped:Wait()
- laserbeamRagePart2:Play()
- laserbeamRagePart2:AdjustSpeed(.5)
- local spamFolder = Instance.new("Folder", ai)
- spamFolder.Name = "SpamFolder"
- local boomFolder = Instance.new("Folder", ai)
- boomFolder.Name = "BoomFolder"
- game:GetService("Debris"):AddItem(spamFolder, 10)
- game:GetService("Debris"):AddItem(boomFolder, 10)
- for i = 1, 450 do
- rs.Heartbeat:Wait()
- local ray = Ray.new(laserbeamPoint.CFrame.p, (laserbeamPoint.CFrame.LookVector * 1000 - ai.Head.CFrame.p).unit * 1000)
- local hit, pos = workspace:FindPartOnRayWithIgnoreList(ray, {ai, spamFolder, boomFolder})
- local dist = (laserbeamPoint.CFrame.p - pos).magnitude
- local deadlybeam = Instance.new("Part", spamFolder)
- deadlybeam.Parent = spamFolder
- deadlybeam.Name = "DeadlyLaserBeam"
- if rageMode.Value == false then
- deadlybeam.Color = Color3.fromRGB(0, 255, 255)
- else
- deadlybeam.Color = Color3.fromRGB(0, 0, 0)
- end
- deadlybeam.Material = Enum.Material.Neon
- deadlybeam.Anchored = true
- deadlybeam.Massless = true
- deadlybeam.CanCollide = false
- deadlybeam.Size = Vector3.new(3.5, 3.5, dist)
- deadlybeam.CFrame = CFrame.new(laserbeamPoint.CFrame.p, pos) * CFrame.new(0, 0, -dist/2)
- local boomPartEffect = Instance.new("Part", boomFolder)
- boomPartEffect.Name = "EndPart"
- boomPartEffect.Size = Vector3.new(4, 4, 4)
- if rageMode.Value == false then
- boomPartEffect.Color = Color3.fromRGB(0, 255, 255)
- else
- boomPartEffect.Color = Color3.fromRGB(0, 0, 0)
- end
- boomPartEffect.Material = Enum.Material.Neon
- boomPartEffect.Anchored = true
- boomPartEffect.CanCollide = false
- boomPartEffect.Massless = true
- boomPartEffect.CFrame = CFrame.new(pos)
- local laserbeamTween = script.LaserbeamTweenEffect:Clone()
- laserbeamTween.Parent = deadlybeam
- laserbeamTween.Disabled = false
- game:GetService("Debris"):AddItem(boomPartEffect, .1725)
- deadlybeam.Touched:Connect(function(hit)
- if hit and hit.Parent then
- if not hit:IsA("Accessory") then
- if not hit.Parent:FindFirstChild("AttackFilterInstantKill") then
- local hum = hit.Parent:FindFirstChild("Humanoid")
- if (hum ~= nil) and (hum.Health > 0) then
- local filter = Instance.new("Folder", hit.Parent)
- filter.Name = "AttackFilterInstantKill"
- hum:TakeDamage(laserbeamDmg)
- game:GetService("Debris"):AddItem(filter, .1)
- end
- end
- end
- end
- end)
- end
- laserbeamRagePart2.Stopped:Wait()
- zom.WalkSpeed = speed
- zom.JumpPower = jump
- laserBeamAmount = laserBeamAmount - 1
- end
- if laserBeamAmount <= 0 then
- wait(3)
- laserBeamAmount = maxlaserBeamAmount
- end
- end
- end
- end
- wait()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement