Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ By: Brutez ]]--
- local SCP106MainScript = script;
- local SCP106 = SCP106MainScript.Parent;
- local Head = SCP106:FindFirstChild("Head");
- local HumanoidRootPart = SCP106:FindFirstChild("HumanoidRootPart");
- local LeftArm = SCP106:FindFirstChild("Left Arm");
- local LeftLeg = SCP106:FindFirstChild("Left Leg");
- local RightArm = SCP106:FindFirstChild("Right Arm");
- local RightLeg = SCP106:FindFirstChild("Right Leg");
- local Torso = SCP106:FindFirstChild("Torso");
- local SCP106Humanoid = SCP106:FindFirstChild("Humanoid");
- local SCP106WalkAnimation = SCP106Humanoid:LoadAnimation(SCP106.WalkAnim);
- repeat Wait(0) until SCP106Humanoid ~= nil
- repeat SCP106Humanoid:TakeDamage(10) SCP106Humanoid.Health = SCP106Humanoid.MaxHealth Wait(0) until SCP106Humanoid.Health == SCP106Humanoid.MaxHealth
- local SpawnForceField = Instance.new("ForceField")
- SpawnForceField.Name = "SpawnForceField"
- SpawnForceField.Parent = SCP106
- function FollowTarget(TargetHumanoid, TargetTorso)
- if not TargetHumanoid or not TargetHumanoid.Parent or TargetHumanoid.Health == 0 or not TargetTorso or not TargetTorso.Parent then
- return
- end
- local SCP106RadiusXAxis = math.random(-2,2)
- local SCP106RadiusYAxis = math.random(-2,2)
- local SCP106RadiusZAxis = math.random(-2,2)
- Torso.CFrame = (Torso.CFrame + Torso.CFrame.lookVector * (SCP106Humanoid.WalkSpeed/30))
- Torso.CFrame = CFrame.new(Torso.Position, TargetTorso.Position)
- SCP106Humanoid:MoveTo(TargetTorso.Position+Vector3.new(SCP106RadiusXAxis,SCP106RadiusYAxis,SCP106RadiusZAxis), TargetTorso)
- end
- function CloseAttack(TargetHumanoid, TargetTorso)
- if not TargetHumanoid or not TargetHumanoid.Parent or TargetHumanoid.Health == 0 or not TargetTorso or not TargetTorso.Parent then
- return
- end
- local NeckSnapAnim = SCP106Humanoid:LoadAnimation(SCP106.NeckSnapAnim);
- NeckSnapAnim:Play()
- Wait(0.2)
- if TargetTorso~=nil and(Torso.Position-TargetTorso.Position).magnitude<=10 then
- local SelectedAttackList = {"NeckSnap1", "NeckSnap2", "NeckSnap3"};
- local SelectedAttackSound = Head[math.random(1, #SelectedAttackList)];
- SelectedAttackSound:Play()
- TargetTorso.Parent.Humanoid:TakeDamage(99999e99999)
- end
- Wait(0.3)
- end
- function FindTarget()
- local ClosestCharacter
- local ClosestHumanoid = nil
- local ClosestTorso = nil
- local ClosestTorsoDistance = 99999e99999
- for TargetCount, TargetModel in pairs(Game.Workspace:GetChildren()) do
- if TargetModel:IsA("Model") and (TargetModel ~= SCP106) and (TargetModel.Name ~= SCP106.Name) and (TargetModel.Name ~= "SCP-173") and (TargetModel.Name ~= "SCP-432-1") and (TargetModel.Name ~= "SCP-049") and (TargetModel.Name ~= "SCP-096") then
- if TargetModel:FindFirstChild("Humanoid")~=nil then
- local humanoid = TargetModel:FindFirstChild("Humanoid")
- local torso = TargetModel:FindFirstChild("Torso")
- if torso ~= nil then
- local TorsoDistance = (torso.Position - Torso.Position).magnitude
- if humanoid and humanoid.Health > 0 and torso and TorsoDistance <= ClosestTorsoDistance then
- ClosestCharacter = TargetModel
- ClosestHumanoid = humanoid
- ClosestTorso = torso
- ClosestTorsoDistance = TorsoDistance
- end
- end
- end
- end
- end
- return ClosestCharacter, ClosestHumanoid, ClosestTorso
- end
- function FindTarget2()
- local ClosestCharacter
- local ClosestHumanoid = nil
- local ClosestTorso = nil
- local ClosestTorsoDistance = 7
- for TargetCount, TargetModel in pairs(Game.Workspace:GetChildren()) do
- if TargetModel:IsA("Model") and (TargetModel ~= SCP106) and (TargetModel.Name ~= SCP106.Name) and (TargetModel.Name ~= "SCP-173") and (TargetModel.Name ~= "SCP-432-1") and (TargetModel.Name ~= "SCP-049") and (TargetModel.Name ~= "SCP-096") then
- if TargetModel:FindFirstChild("Humanoid")~=nil then
- local humanoid = TargetModel:FindFirstChild("Humanoid")
- local torso = TargetModel:FindFirstChild("Torso")
- if torso ~= nil then
- local TorsoDistance = (torso.Position - Torso.Position).magnitude
- if humanoid and humanoid.Health > 0 and torso and TorsoDistance <= ClosestTorsoDistance then
- ClosestCharacter = TargetModel
- ClosestHumanoid = humanoid
- ClosestTorso = torso
- ClosestTorsoDistance = TorsoDistance
- end
- end
- end
- end
- end
- return ClosestCharacter, ClosestHumanoid, ClosestTorso
- end
- Wait(5)
- for DavidHealthCheck = 1,5 do
- SCP106Humanoid.Health = SCP106Humanoid.MaxHealth
- Wait(0)
- end
- SCP106WalkAnimation:Play()
- Torso.Anchored = true
- SpawnForceField:Destroy()
- Head["Oldman5"]:Play()
- if SCP106Humanoid.Health > 0 then
- SCP106["BumpInTheNight"]:Play()
- end
- coroutine.resume(coroutine.create(function()
- while Wait(0) do
- if SCP106Humanoid.Health == 0 or SCP106Humanoid.Health < 0 then
- Torso.Anchored = false
- SCP106["BumpInTheNight"]:Stop()
- SCP106Humanoid.WalkSpeed = 0
- Wait(5)
- SCP106:Destroy()
- end
- if SCP106Humanoid.AutoRotate==false then
- SCP106Humanoid.AutoRotate=true
- end
- if SCP106Humanoid.Jump==true then
- SCP106Humanoid.Jump=false
- end
- if SCP106Humanoid.PlatformStand==true then
- SCP106Humanoid.PlatformStand=false
- end
- if SCP106Humanoid.Sit==true then
- SCP106Humanoid.Sit=false
- end
- end
- end))
- coroutine.resume(coroutine.create(function()
- while Wait(0) do
- if SCP106Humanoid.Health ~= 0 or SCP106Humanoid.Health > 0 then
- local character, humanoid, torso = FindTarget()
- if character and character.Parent and humanoid and humanoid.Parent and torso and torso.Parent then
- FollowTarget(humanoid, torso)
- end
- end
- end
- end))
- coroutine.resume(coroutine.create(function()
- while Wait(0) do
- if SCP106Humanoid.Health ~= 0 or SCP106Humanoid.Health > 0 then
- local character, humanoid, torso = FindTarget2()
- if character and character.Parent and humanoid and humanoid.Parent and torso and torso.Parent then
- CloseAttack(humanoid, torso)
- end
- end
- end
- end))
- --[[ By: Brutez ]]--
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement