Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Converted with ttyyuu12345's model to script plugin v4
- function sandbox(var,func)
- local env = getfenv(func)
- local newenv = setmetatable({},{
- __index = function(self,k)
- if k=="script" then
- return var
- else
- return env[k]
- end
- end,
- })
- setfenv(func,newenv)
- return func
- end
- cors = {}
- mas = Instance.new("Model",game:GetService("Lighting"))
- Model0 = Instance.new("Model")
- Model1 = Instance.new("Model")
- Script2 = Instance.new("Script")
- LocalScript3 = Instance.new("LocalScript")
- ObjectValue4 = Instance.new("ObjectValue")
- Script5 = Instance.new("Script")
- Script6 = Instance.new("Script")
- Script7 = Instance.new("Script")
- Script8 = Instance.new("Script")
- Animation9 = Instance.new("Animation")
- BodyColors10 = Instance.new("BodyColors")
- BrickColorValue11 = Instance.new("BrickColorValue")
- Script12 = Instance.new("Script")
- Humanoid13 = Instance.new("Humanoid")
- Script14 = Instance.new("Script")
- Script15 = Instance.new("Script")
- StringValue16 = Instance.new("StringValue")
- Animation17 = Instance.new("Animation")
- StringValue18 = Instance.new("StringValue")
- Animation19 = Instance.new("Animation")
- StringValue20 = Instance.new("StringValue")
- Animation21 = Instance.new("Animation")
- NumberValue22 = Instance.new("NumberValue")
- Animation23 = Instance.new("Animation")
- NumberValue24 = Instance.new("NumberValue")
- StringValue25 = Instance.new("StringValue")
- Animation26 = Instance.new("Animation")
- StringValue27 = Instance.new("StringValue")
- Animation28 = Instance.new("Animation")
- StringValue29 = Instance.new("StringValue")
- Animation30 = Instance.new("Animation")
- StringValue31 = Instance.new("StringValue")
- Animation32 = Instance.new("Animation")
- Part33 = Instance.new("Part")
- SpecialMesh34 = Instance.new("SpecialMesh")
- Decal35 = Instance.new("Decal")
- Part36 = Instance.new("Part")
- Part37 = Instance.new("Part")
- Part38 = Instance.new("Part")
- Part39 = Instance.new("Part")
- Part40 = Instance.new("Part")
- Sound41 = Instance.new("Sound")
- Motor6D42 = Instance.new("Motor6D")
- Motor6D43 = Instance.new("Motor6D")
- Motor6D44 = Instance.new("Motor6D")
- Motor6D45 = Instance.new("Motor6D")
- Motor6D46 = Instance.new("Motor6D")
- Part47 = Instance.new("Part")
- Motor6D48 = Instance.new("Motor6D")
- Script49 = Instance.new("Script")
- Part50 = Instance.new("Part")
- Decal51 = Instance.new("Decal")
- Script52 = Instance.new("Script")
- ManualWeld53 = Instance.new("ManualWeld")
- Model54 = Instance.new("Model")
- Model55 = Instance.new("Model")
- Script56 = Instance.new("Script")
- LocalScript57 = Instance.new("LocalScript")
- ObjectValue58 = Instance.new("ObjectValue")
- Script59 = Instance.new("Script")
- Script60 = Instance.new("Script")
- Script61 = Instance.new("Script")
- Script62 = Instance.new("Script")
- Animation63 = Instance.new("Animation")
- BodyColors64 = Instance.new("BodyColors")
- BrickColorValue65 = Instance.new("BrickColorValue")
- Script66 = Instance.new("Script")
- Humanoid67 = Instance.new("Humanoid")
- Script68 = Instance.new("Script")
- Script69 = Instance.new("Script")
- StringValue70 = Instance.new("StringValue")
- Animation71 = Instance.new("Animation")
- StringValue72 = Instance.new("StringValue")
- Animation73 = Instance.new("Animation")
- StringValue74 = Instance.new("StringValue")
- Animation75 = Instance.new("Animation")
- NumberValue76 = Instance.new("NumberValue")
- Animation77 = Instance.new("Animation")
- NumberValue78 = Instance.new("NumberValue")
- StringValue79 = Instance.new("StringValue")
- Animation80 = Instance.new("Animation")
- StringValue81 = Instance.new("StringValue")
- Animation82 = Instance.new("Animation")
- StringValue83 = Instance.new("StringValue")
- Animation84 = Instance.new("Animation")
- StringValue85 = Instance.new("StringValue")
- Animation86 = Instance.new("Animation")
- Part87 = Instance.new("Part")
- SpecialMesh88 = Instance.new("SpecialMesh")
- Decal89 = Instance.new("Decal")
- Part90 = Instance.new("Part")
- Part91 = Instance.new("Part")
- Part92 = Instance.new("Part")
- Part93 = Instance.new("Part")
- Part94 = Instance.new("Part")
- Sound95 = Instance.new("Sound")
- Motor6D96 = Instance.new("Motor6D")
- Motor6D97 = Instance.new("Motor6D")
- Motor6D98 = Instance.new("Motor6D")
- Motor6D99 = Instance.new("Motor6D")
- Motor6D100 = Instance.new("Motor6D")
- Part101 = Instance.new("Part")
- Motor6D102 = Instance.new("Motor6D")
- Script103 = Instance.new("Script")
- Part104 = Instance.new("Part")
- Decal105 = Instance.new("Decal")
- Script106 = Instance.new("Script")
- ManualWeld107 = Instance.new("ManualWeld")
- Model108 = Instance.new("Model")
- Model109 = Instance.new("Model")
- Script110 = Instance.new("Script")
- LocalScript111 = Instance.new("LocalScript")
- ObjectValue112 = Instance.new("ObjectValue")
- Script113 = Instance.new("Script")
- Script114 = Instance.new("Script")
- Script115 = Instance.new("Script")
- Script116 = Instance.new("Script")
- Animation117 = Instance.new("Animation")
- BodyColors118 = Instance.new("BodyColors")
- BrickColorValue119 = Instance.new("BrickColorValue")
- Script120 = Instance.new("Script")
- Humanoid121 = Instance.new("Humanoid")
- Script122 = Instance.new("Script")
- Script123 = Instance.new("Script")
- StringValue124 = Instance.new("StringValue")
- Animation125 = Instance.new("Animation")
- StringValue126 = Instance.new("StringValue")
- Animation127 = Instance.new("Animation")
- StringValue128 = Instance.new("StringValue")
- Animation129 = Instance.new("Animation")
- NumberValue130 = Instance.new("NumberValue")
- Animation131 = Instance.new("Animation")
- NumberValue132 = Instance.new("NumberValue")
- StringValue133 = Instance.new("StringValue")
- Animation134 = Instance.new("Animation")
- StringValue135 = Instance.new("StringValue")
- Animation136 = Instance.new("Animation")
- StringValue137 = Instance.new("StringValue")
- Animation138 = Instance.new("Animation")
- StringValue139 = Instance.new("StringValue")
- Animation140 = Instance.new("Animation")
- Part141 = Instance.new("Part")
- SpecialMesh142 = Instance.new("SpecialMesh")
- Decal143 = Instance.new("Decal")
- Part144 = Instance.new("Part")
- Part145 = Instance.new("Part")
- Part146 = Instance.new("Part")
- Part147 = Instance.new("Part")
- Part148 = Instance.new("Part")
- Sound149 = Instance.new("Sound")
- Motor6D150 = Instance.new("Motor6D")
- Motor6D151 = Instance.new("Motor6D")
- Motor6D152 = Instance.new("Motor6D")
- Motor6D153 = Instance.new("Motor6D")
- Motor6D154 = Instance.new("Motor6D")
- Part155 = Instance.new("Part")
- Motor6D156 = Instance.new("Motor6D")
- Script157 = Instance.new("Script")
- Part158 = Instance.new("Part")
- Decal159 = Instance.new("Decal")
- Script160 = Instance.new("Script")
- ManualWeld161 = Instance.new("ManualWeld")
- Model0.Parent = mas
- Model1.Name = "Zombie"
- Model1.Parent = Model0
- Script2.Name = "Ragdoller"
- Script2.Parent = Model1
- table.insert(cors,sandbox(Script2,function()
- print("Ragdoll script activated")
- Gibs = game.Workspace
- function getKillerOfHumanoidIfStillInGame(humanoid)
- local tag = humanoid:findFirstChild("creator")
- if tag ~= nil then
- local killer = tag.Value
- if killer.Parent ~= nil then
- return killer
- end
- end
- return nil
- end
- function OnDeath(Character)
- local svch = Character
- local hum = Character:findFirstChild("Humanoid")
- local getkiller = getKillerOfHumanoidIfStillInGame(hum)
- Character.Archivable = true
- local chrclone = Character:clone()
- Character.Archivable = false
- local ch = chrclone:GetChildren()
- local i
- for i = 1,#ch do
- if ch[i].Name == "THandle1" or ch[i].Name == "THandle2" or ch[i].ClassName == "Script" then
- ch[i]:remove()
- end
- end
- local function Scan(ch)
- local e
- for e = 1,#ch do
- Scan(ch[e]:GetChildren())
- if ch[e].ClassName == "Weld" or ch[e].ClassName == "Motor6D" then
- ch[e]:remove()
- end
- end
- end
- Scan(chrclone:GetChildren())
- local hum2 = chrclone:findFirstChild("Humanoid")
- if hum2 ~= nil then
- hum2.Name = "Humanoid2"
- hum2.PlatformStand = true
- hum2.Sit = true
- hum2.MaxHealth = 0
- hum2.Health = 0
- end
- local ch = Character:GetChildren()
- local i
- for i = 1,#ch do
- if ch[i].Name == "THandle1" or ch[i].Name == "THandle2" then
- ch[i]:remove()
- end
- end
- wait(0.2)
- local ch = Character:GetChildren()
- local i
- for i = 1,#ch do
- if ch[i].ClassName == "Part" or ch[i].ClassName == "Hat" or ch[i].Name == "THandle1" or ch[i].Name == "THandle2" then
- ch[i]:remove()
- end
- end
- Character = chrclone
- local Torso = Character.Torso
- local movevector = Vector3.new()
- if Torso then
- if getkiller ~= nil then
- if getkiller.Character ~= nil then
- local killtors = getkiller.Character:findFirstChild("Torso")
- if killtors ~= nil then
- movevector = CFrame.new(killtors.Position,Torso.Position).lookVector
- end
- end
- end
- local Head = Character:FindFirstChild("Head")
- if Head then
- local Neck = Instance.new("Weld")
- Neck.Name = "Neck"
- Neck.Part0 = Torso
- Neck.Part1 = Head
- Neck.C0 = CFrame.new(0, 1.5, 0)
- Neck.C1 = CFrame.new()
- Neck.Parent = Torso
- local nsc = script.CamAttach:clone()
- nsc.CamPart.Value = hum2.Parent.Head
- nsc.Disabled = false
- nsc.Parent = svch
- end
- local Limb = Character:FindFirstChild("Right Arm")
- if Limb then
- Limb.CFrame = Torso.CFrame * CFrame.new(1.5, 0, 0)
- local Joint = Instance.new("Glue")
- Joint.Name = "RightShoulder"
- Joint.Part0 = Torso
- Joint.Part1 = Limb
- Joint.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- Joint.C1 = CFrame.new(-0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- Joint.Parent = Torso
- local B = Instance.new("Part")
- B.TopSurface = 0
- B.BottomSurface = 0
- B.formFactor = "Symmetric"
- B.Size = Vector3.new(1, 1, 1)
- B.Transparency = 1
- B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
- B.Parent = Character
- local W = Instance.new("Weld")
- W.Part0 = Limb
- W.Part1 = B
- W.C0 = CFrame.new(0, -0.5, 0)
- W.Parent = Limb
- end
- local Limb = Character:FindFirstChild("Left Arm")
- if Limb then
- Limb.CFrame = Torso.CFrame * CFrame.new(-1.5, 0, 0)
- local Joint = Instance.new("Glue")
- Joint.Name = "LeftShoulder"
- Joint.Part0 = Torso
- Joint.Part1 = Limb
- Joint.C0 = CFrame.new(-1.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- Joint.C1 = CFrame.new(0, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- Joint.Parent = Torso
- local B = Instance.new("Part")
- B.TopSurface = 0
- B.BottomSurface = 0
- B.formFactor = "Symmetric"
- B.Size = Vector3.new(1, 1, 1)
- B.Transparency = 1
- B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
- B.Parent = Character
- local W = Instance.new("Weld")
- W.Part0 = Limb
- W.Part1 = B
- W.C0 = CFrame.new(0, -0.5, 0)
- W.Parent = Limb
- end
- local Limb = Character:FindFirstChild("Right Leg")
- if Limb then
- Limb.CFrame = Torso.CFrame * CFrame.new(0.5, -2, 0)
- local Joint = Instance.new("Glue")
- Joint.Name = "RightHip"
- Joint.Part0 = Torso
- Joint.Part1 = Limb
- Joint.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- Joint.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- Joint.Parent = Torso
- local B = Instance.new("Part")
- B.TopSurface = 0
- B.BottomSurface = 0
- B.formFactor = "Symmetric"
- B.Size = Vector3.new(1, 1, 1)
- B.Transparency = 1
- B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
- B.Parent = Character
- local W = Instance.new("Weld")
- W.Part0 = Limb
- W.Part1 = B
- W.C0 = CFrame.new(0, -0.5, 0)
- W.Parent = Limb
- end
- local Limb = Character:FindFirstChild("Left Leg")
- if Limb then
- Limb.CFrame = Torso.CFrame * CFrame.new(-0.5, -2, 0)
- local Joint = Instance.new("Glue")
- Joint.Name = "LeftHip"
- Joint.Part0 = Torso
- Joint.Part1 = Limb
- Joint.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- Joint.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- Joint.Parent = Torso
- local B = Instance.new("Part")
- B.TopSurface = 0
- B.BottomSurface = 0
- B.formFactor = "Symmetric"
- B.Size = Vector3.new(1, 1, 1)
- B.Transparency = 1
- B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
- B.Parent = Character
- local W = Instance.new("Weld")
- W.Part0 = Limb
- W.Part1 = B
- W.C0 = CFrame.new(0, -0.5, 0)
- W.Parent = Limb
- end
- --[
- local Bar = Instance.new("Part")
- Bar.TopSurface = 0
- Bar.BottomSurface = 0
- Bar.formFactor = "Symmetric"
- Bar.Size = Vector3.new(1, 1, 1)
- Bar.Transparency = 1
- Bar.CFrame = Torso.CFrame * CFrame.new(0, 0.5, 0)
- Bar.Parent = Character
- local Weld = Instance.new("Weld")
- Weld.Part0 = Torso
- Weld.Part1 = Bar
- Weld.C0 = CFrame.new(0, 0.5, 0)
- Weld.Parent = Torso
- --]]
- end
- Character.Parent = Gibs
- game.Debris:AddItem(Character, 12)
- if movevector ~= Vector3.new() then
- for i = 1,10 do
- wait()
- Torso.Velocity = movevector * 30
- end
- end
- end
- script.Parent.Humanoid.Died:connect(function()
- OnDeath(script.Parent)
- end)
- end))
- LocalScript3.Name = "CamAttach"
- LocalScript3.Parent = Script2
- LocalScript3.Disabled = true
- table.insert(cors,sandbox(LocalScript3,function()
- wait()
- game.Workspace.CurrentCamera.CameraSubject = script.CamPart.Value
- end))
- ObjectValue4.Name = "CamPart"
- ObjectValue4.Parent = LocalScript3
- Script5.Name = "ZombieScript"
- Script5.Parent = Model1
- table.insert(cors,sandbox(Script5,function()
- wait()
- -- Handles damage, sounds
- local hum = script.Parent:FindFirstChild("Humanoid")
- local torso = script.Parent:FindFirstChild("HumanoidRootPart")
- local head = script.Parent:FindFirstChild("Head")
- DB = false
- local function onTouch(hit)
- if DB then return end
- if hit == nil then return end
- if hit.Parent == nil then return end
- local vhum = hit.Parent:FindFirstChild("Humanoid")
- if vhum ~= nil then
- if hum.Health <= 0 then return end
- if vhum ~= hum and not hit.Parent:FindFirstChild("ZombieScript") then -- keeps it from hurting itself/ zombies
- vhum:TakeDamage(math.random(6, 9))
- DB = true
- wait(1)
- DB = false
- end
- end
- end
- torso.Touched:connect(onTouch)
- local zombienoises = {93591696, 208668860, 179266532, 229895387, 150076506}
- local moan = head:FindFirstChild("Moan")
- while head ~= nil do
- wait(math.random(6, 13))
- moan.Pitch = math.random(8, 10)/10
- moan.SoundId = "rbxassetid://"..tostring(zombienoises[math.random(1, #zombienoises)])
- moan:Play()
- end
- end))
- Script6.Name = "Follow"
- Script6.Parent = Model1
- table.insert(cors,sandbox(Script6,function()
- wait()
- local hum = script.Parent:FindFirstChild("Humanoid")
- local torso = script.Parent:FindFirstChild("HumanoidRootPart")
- local max_dist = 200
- function findNearestTorso()
- for _, player in pairs(game.Players:GetPlayers()) do
- if player.Character ~= nil then
- local target_torso = player.Character:FindFirstChild("HumanoidRootPart")
- if target_torso ~= nil then
- if (target_torso.Position - torso.Position).magnitude < max_dist then
- return target_torso
- end
- end
- end
- end
- end
- local old_pos = torso.Position
- wait(math.random(0, 90)/100)
- while hum ~= nil do
- local target = findNearestTorso()
- if target ~= nil then
- while target ~= nil and target.Parent ~= nil and hum ~= nil do
- if (target.Position - torso.Position).magnitude < max_dist then
- hum:MoveTo(target.Position, target)
- if target.Position.Y > torso.Position.Y + 3 then
- hum.Jump = true
- end
- if (old_pos - torso.Position).magnitude < 0.5 then
- if math.random(1, 3) == 1 then
- torso.Velocity = torso.CFrame.lookVector * -40
- hum:MoveTo(torso.Position + Vector3.new(math.random(-1, 1), 0, math.random(-1, 1))*20)
- wait(1.2)
- else
- hum.Jump = true
- hum:MoveTo(target.Position, target)
- end
- end
- else break end
- old_pos = torso.Position
- wait(0.5)
- end
- end
- wait(4)
- end
- end))
- Script7.Name = "Die"
- Script7.Parent = Model1
- table.insert(cors,sandbox(Script7,function()
- human = script.Parent.Humanoid
- --tool = script.Parent.Pistol
- function Die()
- --if tool ~= nil then tool:remove() end
- game.workspace.Scripts.WaveScript.Dead_Zombies.Value = game.workspace.Scripts.WaveScript.Dead_Zombies.Value + 1
- wait(2.5)
- script.Parent:remove()
- end
- human.Died:connect(Die)
- end))
- Script8.Name = "ZombieScript"
- Script8.Parent = Model1
- table.insert(cors,sandbox(Script8,function()
- --Made by Stickmasterluke
- --Zombie artificial stupidity script
- sp=script.Parent
- lastattack=0
- nextrandom=0
- nextsound=0
- nextjump=0
- chasing=false
- variance=4
- damage=10
- attackrange=4.5
- sightrange=999--60
- runspeed=10
- wonderspeed=8
- healthregen=false
- colors={"Sand red","Dusty Rose","Medium blue","Sand blue","Lavender","Earth green","Brown","Medium stone grey","Brick yellow"}
- function raycast(spos,vec,currentdist)
- local hit2,pos2=game.Workspace:FindPartOnRay(Ray.new(spos+(vec*.01),vec*currentdist),script.Parent)
- if hit2~=nil and pos2 then
- if hit2.Parent==script.Parent and hit2.Transparency>=.8 or hit2.Name=="Handle" or string.sub(hit2.Name,1,6)=="Effect" or hit2.Parent:IsA("Hat") or hit2.Parent:IsA("Tool") or (hit2.Parent:FindFirstChild("Humanoid") and hit2.Parent:FindFirstChild("TEAM") and hit2.Parent:FindFirstChild("TEAM").Value == script.Parent.TEAM.Value) or (not hit2.Parent:FindFirstChild("Humanoid") and hit2.CanCollide==false) then
- local currentdist=currentdist-(pos2-spos).magnitude
- return raycast(pos2,vec,currentdist)
- end
- end
- return hit2,pos2
- end
- function waitForChild(parent,childName)
- local child=parent:findFirstChild(childName)
- if child then return child end
- while true do
- child=parent.ChildAdded:wait()
- if child.Name==childName then return child end
- end
- end
- -- ANIMATION
- -- declarations
- local Torso=waitForChild(sp,"Torso")
- local Head=waitForChild(sp,"Head")
- local RightShoulder=waitForChild(Torso,"Right Shoulder")
- local LeftShoulder=waitForChild(Torso,"Left Shoulder")
- local RightHip=waitForChild(Torso,"Right Hip")
- local LeftHip=waitForChild(Torso,"Left Hip")
- local Neck=waitForChild(Torso,"Neck")
- local Humanoid=waitForChild(sp,"Humanoid")
- local BodyColors=waitForChild(sp,"Body Colors")
- local pose="Standing"
- local hitsound=waitForChild(Torso,"HitSound")
- local Anim = Humanoid:LoadAnimation(sp.AttackAnim)
- --[[local sounds={
- waitForChild(Torso,"GroanSound"),
- waitForChild(Torso,"RawrSound")
- }]]
- if healthregen then
- local regenscript=waitForChild(sp,"HealthRegenerationScript")
- regenscript.Disabled=false
- end
- Humanoid.WalkSpeed=wonderspeed
- local toolAnim="None"
- local toolAnimTime=0
- --[[BodyColors.HeadColor=BrickColor.new("Grime")
- local randomcolor1=colors[math.random(1,#colors)]
- BodyColors.TorsoColor=BrickColor.new(randomcolor1)
- BodyColors.LeftArmColor=BrickColor.new(randomcolor1)
- BodyColors.RightArmColor=BrickColor.new(randomcolor1)
- local randomcolor2=colors[math.random(1,#colors)]
- BodyColors.LeftLegColor=BrickColor.new(randomcolor2)
- BodyColors.RightLegColor=BrickColor.new(randomcolor2)]]
- function onRunning(speed)
- if speed>0 then
- pose="Running"
- else
- pose="Standing"
- end
- end
- function onDied()
- pose="Dead"
- end
- function onJumping()
- pose="Jumping"
- end
- function onClimbing()
- pose="Climbing"
- end
- function onGettingUp()
- pose = "GettingUp"
- end
- function onFreeFall()
- pose = "FreeFall"
- end
- function onFallingDown()
- pose = "FallingDown"
- end
- function onSeated()
- pose = "Seated"
- end
- function onPlatformStanding()
- pose = "PlatformStanding"
- end
- function moveJump()
- RightShoulder.MaxVelocity = 0.5
- LeftShoulder.MaxVelocity = 0.5
- RightShoulder.DesiredAngle=3.14
- LeftShoulder.DesiredAngle=-3.14
- RightHip.DesiredAngle=0
- LeftHip.DesiredAngle=0
- end
- function moveFreeFall()
- RightShoulder.MaxVelocity = 0.5
- LeftShoulder.MaxVelocity =0.5
- RightShoulder.DesiredAngle=3.14
- LeftShoulder.DesiredAngle=-3.14
- RightHip.DesiredAngle=0
- LeftHip.DesiredAngle=0
- end
- function moveSit()
- RightShoulder.MaxVelocity = 0.15
- LeftShoulder.MaxVelocity = 0.15
- RightShoulder.DesiredAngle=3.14 /2
- LeftShoulder.DesiredAngle=-3.14 /2
- RightHip.DesiredAngle=3.14 /2
- LeftHip.DesiredAngle=-3.14 /2
- end
- function animate(time)
- local amplitude
- local frequency
- if (pose == "Jumping") then
- moveJump()
- return
- end
- if (pose == "FreeFall") then
- moveFreeFall()
- return
- end
- if (pose == "Seated") then
- moveSit()
- return
- end
- local climbFudge = 0
- if (pose == "Running") then
- RightShoulder.MaxVelocity = 0.15
- LeftShoulder.MaxVelocity = 0.15
- amplitude = 1
- frequency = 9
- elseif (pose == "Climbing") then
- RightShoulder.MaxVelocity = 0.5
- LeftShoulder.MaxVelocity = 0.5
- amplitude = 1
- frequency = 9
- climbFudge = 3.14
- else
- amplitude = 0.1
- frequency = 1
- end
- desiredAngle = amplitude * math.sin(time*frequency)
- if not chasing and frequency==9 then
- frequency=4
- end
- if chasing then
- --[[RightShoulder.DesiredAngle=math.pi/2
- LeftShoulder.DesiredAngle=-math.pi/2
- RightHip.DesiredAngle=-desiredAngle*2
- LeftHip.DesiredAngle=-desiredAngle*2]]
- else
- RightShoulder.DesiredAngle=desiredAngle + climbFudge
- LeftShoulder.DesiredAngle=desiredAngle - climbFudge
- RightHip.DesiredAngle=-desiredAngle
- LeftHip.DesiredAngle=-desiredAngle
- end
- end
- function attack(time,attackpos)
- if time-lastattack>=0.25 then
- local hit,pos=raycast(Torso.Position,(attackpos-Torso.Position).unit,attackrange)
- if hit and hit.Parent~=nil then
- local h=hit.Parent:FindFirstChild("Humanoid")
- local TEAM=hit.Parent:FindFirstChild("TEAM")
- if h and TEAM and TEAM.Value~=sp.TEAM.Value then
- local creator=sp:FindFirstChild("creator")
- if creator then
- if creator.Value~=nil then
- if creator.Value~=game.Players:GetPlayerFromCharacter(h.Parent) then
- for i,oldtag in ipairs(h:GetChildren()) do
- if oldtag.Name=="creator" then
- oldtag:remove()
- end
- end
- creator:clone().Parent=h
- else
- return
- end
- end
- end
- if Anim then Anim:Play(nil,nil,1.5) end
- h:TakeDamage(damage)
- hitsound.Volume=1
- hitsound.Pitch=.75+(math.random()*.5)
- hitsound:Play()
- --[[if RightShoulder and LeftShoulder then
- RightShoulder.CurrentAngle=0
- LeftShoulder.CurrentAngle=0
- end]]
- end
- end
- lastattack=time
- end
- end
- Humanoid.Died:connect(onDied)
- Humanoid.Running:connect(onRunning)
- Humanoid.Jumping:connect(onJumping)
- Humanoid.Climbing:connect(onClimbing)
- Humanoid.GettingUp:connect(onGettingUp)
- Humanoid.FreeFalling:connect(onFreeFall)
- Humanoid.FallingDown:connect(onFallingDown)
- Humanoid.Seated:connect(onSeated)
- Humanoid.PlatformStanding:connect(onPlatformStanding)
- function populatehumanoids(mdl)
- if mdl.ClassName=="Humanoid" then
- if mdl.Parent:FindFirstChild("TEAM") and mdl.Parent:FindFirstChild("TEAM").Value~=sp.TEAM.Value then
- table.insert(humanoids,mdl)
- end
- end
- for i2,mdl2 in ipairs(mdl:GetChildren()) do
- populatehumanoids(mdl2)
- end
- end
- --[[function playsound(time)
- nextsound=time+5+(math.random()*5)
- local randomsound=sounds[math.random(1,#sounds)]
- randomsound.Volume=.5+(.5*math.random())
- randomsound.Pitch=.5+(.5*math.random())
- randomsound:Play()
- end]]
- while sp.Parent~=nil and Humanoid and Humanoid.Parent~=nil and Humanoid.Health>0 and Torso and Head and Torso~=nil and Torso.Parent~=nil do
- local _,time=wait(0.25)--wait(1/3)
- humanoids={}
- populatehumanoids(game.Workspace)
- closesttarget=nil
- closestdist=sightrange
- local creator=sp:FindFirstChild("creator")
- for i,h in ipairs(humanoids) do
- if h and h.Parent~=nil then
- if h.Health>0 and h.Parent~=sp then
- local plr=game.Players:GetPlayerFromCharacter(h.Parent)
- if creator==nil or plr==nil or creator.Value~=plr then
- local t=h.Parent:FindFirstChild("Torso")
- if t~=nil then
- local dist=(t.Position-Torso.Position).magnitude
- if dist<closestdist then
- closestdist=dist
- closesttarget=t
- end
- end
- end
- end
- end
- end
- if closesttarget~=nil then
- if not chasing then
- --playsound(time)
- chasing=true
- Humanoid.WalkSpeed=runspeed
- end
- Humanoid:MoveTo(closesttarget.Position+(Vector3.new(1,1,1)*(variance*((math.random()*2)-1))),closesttarget)
- if math.random()<.5 then
- attack(time,closesttarget.Position)
- end
- else
- if chasing then
- chasing=false
- Humanoid.WalkSpeed=wonderspeed
- end
- if time>nextrandom then
- nextrandom=time+3+(math.random()*5)
- local randompos=Torso.Position+((Vector3.new(1,1,1)*math.random()-Vector3.new(.5,.5,.5))*40)
- Humanoid:MoveTo(randompos,game.Workspace.Terrain)
- end
- end
- if time>nextsound then
- --playsound(time)
- end
- if time>nextjump then
- nextjump=time+7+(math.random()*5)
- Humanoid.Jump=true
- end
- animate(time)
- end
- wait(4)
- sp:remove() --Rest In Pizza
- end))
- Animation9.Name = "AttackAnim"
- Animation9.Parent = Model1
- Animation9.AnimationId = "http://www.roblox.com/Asset?ID=105211514"
- BodyColors10.Parent = Model1
- BodyColors10.HeadColor = BrickColor.new("Medium green")
- BodyColors10.LeftArmColor = BrickColor.new("Medium green")
- BodyColors10.LeftLegColor = BrickColor.new("Reddish brown")
- BodyColors10.RightArmColor = BrickColor.new("Medium green")
- BodyColors10.RightLegColor = BrickColor.new("Reddish brown")
- BodyColors10.TorsoColor = BrickColor.new("Reddish brown")
- BrickColorValue11.Name = "TEAM"
- BrickColorValue11.Parent = Model1
- BrickColorValue11.Value = BrickColor.new("Bright green")
- Script12.Name = "Sound"
- Script12.Parent = Model1
- table.insert(cors,sandbox(Script12,function()
- -- util
- function waitForChild(parent, childName)
- local child = parent:findFirstChild(childName)
- if child then return child end
- while true do
- child = parent.ChildAdded:wait()
- if child.Name==childName then return child end
- end
- end
- function newSound(id)
- local sound = Instance.new("Sound")
- sound.SoundId = id
- sound.archivable = false
- sound.Parent = script.Parent.Head
- return sound
- end
- -- declarations
- local sDied = newSound("rbxasset://sounds/uuhhh.wav")
- sDied.Pitch = 0.75
- local sFallingDown = newSound("rbxasset://sounds/splat.wav")
- local sFreeFalling = newSound("rbxasset://sounds/swoosh.wav")
- local sGettingUp = newSound("rbxasset://sounds/hit.wav")
- local sJumping = newSound("rbxasset://sounds/button.wav")
- local sRunning = newSound("rbxasset://sounds/bfsl-minifigfoots1.mp3")
- sRunning.Looped = true
- local Figure = script.Parent
- local Head = waitForChild(Figure, "Head")
- local Humanoid = waitForChild(Figure, "Humanoid")
- -- functions
- function onDied()
- sDied:Play()
- wait(2.5)
- script.Parent:Destroy()
- end
- function onState(state, sound)
- if state then
- sound:Play()
- else
- sound:Pause()
- end
- end
- function onRunning(speed)
- if speed>0 then
- sRunning:Play()
- else
- sRunning:Pause()
- end
- end
- -- connect up
- Humanoid.Died:connect(onDied)
- Humanoid.Running:connect(onRunning)
- Humanoid.Jumping:connect(function(state) onState(state, sJumping) end)
- Humanoid.GettingUp:connect(function(state) onState(state, sGettingUp) end)
- Humanoid.FreeFalling:connect(function(state) onState(state, sFreeFalling) end)
- Humanoid.FallingDown:connect(function(state) onState(state, sFallingDown) end)
- end))
- Humanoid13.Parent = Model1
- Humanoid13.RightLeg = Part38
- Humanoid13.LeftLeg = Part39
- Humanoid13.Torso = Part47
- Script14.Name = "HealthRegenerationScript"
- Script14.Parent = Model1
- Script14.Disabled = true
- table.insert(cors,sandbox(Script14,function()
- -- Renegeration Script for the bot
- -- Renegerates about 1% of max hp per second until it reaches max health
- bot = script.Parent
- Humanoid = bot:FindFirstChild("Humanoid")
- local regen = false
- function regenerate()
- if regen then return end
- -- Lock this function until the regeneration to max health is complete by using a boolean toggle
- regen = true
- while Humanoid.Health < Humanoid.MaxHealth do
- local delta = wait(1)
- local health = Humanoid.Health
- if health > 0 and health < Humanoid.MaxHealth then
- -- This delta is for regenerating 1% of max hp per second instead of 1 hp per second
- delta = 0.01 * delta * Humanoid.MaxHealth
- health = health + delta
- Humanoid.Health = math.min(health, Humanoid.MaxHealth)
- end
- end
- -- release the lock, since the health is at max now, and if the character loses health again
- -- it needs to start regenerating
- regen = false
- end
- if Humanoid then
- -- Better than a while true do loop since it only fires when the health actually changes
- Humanoid.HealthChanged:connect(regenerate)
- end
- end))
- Script15.Name = "Animate"
- Script15.Parent = Model1
- table.insert(cors,sandbox(Script15,function()
- function waitForChild(parent, childName)
- local child = parent:findFirstChild(childName)
- if child then return child end
- while true do
- child = parent.ChildAdded:wait()
- if child.Name==childName then return child end
- end
- end
- local Figure = script.Parent
- local Torso = waitForChild(Figure, "Torso")
- local RightShoulder = waitForChild(Torso, "Right Shoulder")
- local LeftShoulder = waitForChild(Torso, "Left Shoulder")
- local RightHip = waitForChild(Torso, "Right Hip")
- local LeftHip = waitForChild(Torso, "Left Hip")
- local Neck = waitForChild(Torso, "Neck")
- local Humanoid = waitForChild(Figure, "Humanoid")
- local pose = "Standing"
- local currentAnim = ""
- local currentAnimTrack = nil
- local currentAnimKeyframeHandler = nil
- local currentAnimSpeed = 1.0
- local animTable = {}
- local animNames = {
- idle = {
- { id = "http://www.roblox.com/asset/?id=125750544", weight = 9 },
- { id = "http://www.roblox.com/asset/?id=125750618", weight = 1 }
- },
- walk = {
- { id = "http://www.roblox.com/asset/?id=125749145", weight = 10 }
- },
- run = {
- { id = "run.xml", weight = 10 }
- },
- jump = {
- { id = "http://www.roblox.com/asset/?id=125750702", weight = 10 }
- },
- fall = {
- { id = "http://www.roblox.com/asset/?id=125750759", weight = 10 }
- },
- climb = {
- { id = "http://www.roblox.com/asset/?id=125750800", weight = 10 }
- },
- toolnone = {
- { id = "http://www.roblox.com/asset/?id=125750867", weight = 10 }
- },
- toolslash = {
- { id = "http://www.roblox.com/asset/?id=129967390", weight = 10 }
- -- { id = "slash.xml", weight = 10 }
- },
- toollunge = {
- { id = "http://www.roblox.com/asset/?id=129967478", weight = 10 }
- },
- wave = {
- { id = "http://www.roblox.com/asset/?id=128777973", weight = 10 }
- },
- point = {
- { id = "http://www.roblox.com/asset/?id=128853357", weight = 10 }
- },
- dance = {
- { id = "http://www.roblox.com/asset/?id=130018893", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=132546839", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=132546884", weight = 10 }
- },
- dance2 = {
- { id = "http://www.roblox.com/asset/?id=160934142", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=160934298", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=160934376", weight = 10 }
- },
- dance3 = {
- { id = "http://www.roblox.com/asset/?id=160934458", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=160934530", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=160934593", weight = 10 }
- },
- laugh = {
- { id = "http://www.roblox.com/asset/?id=129423131", weight = 10 }
- },
- cheer = {
- { id = "http://www.roblox.com/asset/?id=129423030", weight = 10 }
- },
- }
- -- Existance in this list signifies that it is an emote, the value indicates if it is a looping emote
- local emoteNames = { wave = false, point = false, dance = true, dance2 = true, dance3 = true, laugh = false, cheer = false}
- math.randomseed(tick())
- function configureAnimationSet(name, fileList)
- if (animTable[name] ~= nil) then
- for _, connection in pairs(animTable[name].connections) do
- connection:disconnect()
- end
- end
- animTable[name] = {}
- animTable[name].count = 0
- animTable[name].totalWeight = 0
- animTable[name].connections = {}
- -- check for config values
- local config = script:FindFirstChild(name)
- if (config ~= nil) then
- -- print("Loading anims " .. name)
- table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end))
- table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end))
- local idx = 1
- for _, childPart in pairs(config:GetChildren()) do
- if (childPart:IsA("Animation")) then
- table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end))
- animTable[name][idx] = {}
- animTable[name][idx].anim = childPart
- local weightObject = childPart:FindFirstChild("Weight")
- if (weightObject == nil) then
- animTable[name][idx].weight = 1
- else
- animTable[name][idx].weight = weightObject.Value
- end
- animTable[name].count = animTable[name].count + 1
- animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
- -- print(name .. " [" .. idx .. "] " .. animTable[name][idx].anim.AnimationId .. " (" .. animTable[name][idx].weight .. ")")
- idx = idx + 1
- end
- end
- end
- -- fallback to defaults
- if (animTable[name].count <= 0) then
- for idx, anim in pairs(fileList) do
- animTable[name][idx] = {}
- animTable[name][idx].anim = Instance.new("Animation")
- animTable[name][idx].anim.Name = name
- animTable[name][idx].anim.AnimationId = anim.id
- animTable[name][idx].weight = anim.weight
- animTable[name].count = animTable[name].count + 1
- animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
- -- print(name .. " [" .. idx .. "] " .. anim.id .. " (" .. anim.weight .. ")")
- end
- end
- end
- -- Setup animation objects
- function scriptChildModified(child)
- local fileList = animNames[child.Name]
- if (fileList ~= nil) then
- configureAnimationSet(child.Name, fileList)
- end
- end
- script.ChildAdded:connect(scriptChildModified)
- script.ChildRemoved:connect(scriptChildModified)
- for name, fileList in pairs(animNames) do
- configureAnimationSet(name, fileList)
- end
- -- ANIMATION
- -- declarations
- local toolAnim = "None"
- local toolAnimTime = 0
- local jumpAnimTime = 0
- local jumpAnimDuration = 0.3
- local toolTransitionTime = 0.1
- local fallTransitionTime = 0.3
- local jumpMaxLimbVelocity = 0.75
- -- functions
- function stopAllAnimations()
- local oldAnim = currentAnim
- -- return to idle if finishing an emote
- if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
- oldAnim = "idle"
- end
- currentAnim = ""
- if (currentAnimKeyframeHandler ~= nil) then
- currentAnimKeyframeHandler:disconnect()
- end
- if (currentAnimTrack ~= nil) then
- currentAnimTrack:Stop()
- currentAnimTrack:Destroy()
- currentAnimTrack = nil
- end
- return oldAnim
- end
- function setAnimationSpeed(speed)
- if speed ~= currentAnimSpeed then
- currentAnimSpeed = speed
- currentAnimTrack:AdjustSpeed(currentAnimSpeed)
- end
- end
- function keyFrameReachedFunc(frameName)
- if (frameName == "End") then
- -- print("Keyframe : ".. frameName)
- local repeatAnim = stopAllAnimations()
- local animSpeed = currentAnimSpeed
- playAnimation(repeatAnim, 0.0, Humanoid)
- setAnimationSpeed(animSpeed)
- end
- end
- -- Preload animations
- function playAnimation(animName, transitionTime, humanoid)
- local idleFromEmote = (animName == "idle" and emoteNames[currentAnim] ~= nil)
- if (animName ~= currentAnim and not idleFromEmote) then
- if (currentAnimTrack ~= nil) then
- currentAnimTrack:Stop(transitionTime)
- currentAnimTrack:Destroy()
- end
- currentAnimSpeed = 1.0
- local roll = math.random(1, animTable[animName].totalWeight)
- local origRoll = roll
- local idx = 1
- while (roll > animTable[animName][idx].weight) do
- roll = roll - animTable[animName][idx].weight
- idx = idx + 1
- end
- -- print(animName .. " " .. idx .. " [" .. origRoll .. "]")
- local anim = animTable[animName][idx].anim
- -- load it to the humanoid; get AnimationTrack
- currentAnimTrack = humanoid:LoadAnimation(anim)
- -- play the animation
- currentAnimTrack:Play(transitionTime)
- currentAnim = animName
- -- set up keyframe name triggers
- if (currentAnimKeyframeHandler ~= nil) then
- currentAnimKeyframeHandler:disconnect()
- end
- currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
- end
- end
- -------------------------------------------------------------------------------------------
- -------------------------------------------------------------------------------------------
- local toolAnimName = ""
- local toolAnimTrack = nil
- local currentToolAnimKeyframeHandler = nil
- function toolKeyFrameReachedFunc(frameName)
- if (frameName == "End") then
- -- print("Keyframe : ".. frameName)
- local repeatAnim = stopToolAnimations()
- playToolAnimation(repeatAnim, 0.0, Humanoid)
- end
- end
- function playToolAnimation(animName, transitionTime, humanoid)
- if (animName ~= toolAnimName) then
- if (toolAnimTrack ~= nil) then
- toolAnimTrack:Stop()
- toolAnimTrack:Destroy()
- transitionTime = 0
- end
- local roll = math.random(1, animTable[animName].totalWeight)
- local origRoll = roll
- local idx = 1
- while (roll > animTable[animName][idx].weight) do
- roll = roll - animTable[animName][idx].weight
- idx = idx + 1
- end
- -- print(animName .. " * " .. idx .. " [" .. origRoll .. "]")
- local anim = animTable[animName][idx].anim
- -- load it to the humanoid; get AnimationTrack
- toolAnimTrack = humanoid:LoadAnimation(anim)
- -- play the animation
- toolAnimTrack:Play(transitionTime)
- toolAnimName = animName
- currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc)
- end
- end
- function stopToolAnimations()
- local oldAnim = toolAnimName
- if (currentToolAnimKeyframeHandler ~= nil) then
- currentToolAnimKeyframeHandler:disconnect()
- end
- toolAnimName = ""
- if (toolAnimTrack ~= nil) then
- toolAnimTrack:Stop()
- toolAnimTrack:Destroy()
- toolAnimTrack = nil
- end
- return oldAnim
- end
- -------------------------------------------------------------------------------------------
- -------------------------------------------------------------------------------------------
- function onRunning(speed)
- if speed>0.01 then
- playAnimation("walk", 0.1, Humanoid)
- pose = "Running"
- else
- playAnimation("idle", 0.1, Humanoid)
- pose = "Standing"
- end
- end
- function onDied()
- pose = "Dead"
- end
- function onJumping()
- playAnimation("jump", 0.1, Humanoid)
- jumpAnimTime = jumpAnimDuration
- pose = "Jumping"
- end
- function onClimbing(speed)
- playAnimation("climb", 0.1, Humanoid)
- setAnimationSpeed(speed / 12.0)
- pose = "Climbing"
- end
- function onGettingUp()
- pose = "GettingUp"
- end
- function onFreeFall()
- if (jumpAnimTime <= 0) then
- playAnimation("fall", fallTransitionTime, Humanoid)
- end
- pose = "FreeFall"
- end
- function onFallingDown()
- pose = "FallingDown"
- end
- function onSeated()
- pose = "Seated"
- end
- function onPlatformStanding()
- pose = "PlatformStanding"
- end
- function onSwimming(speed)
- if speed>0 then
- pose = "Running"
- else
- pose = "Standing"
- end
- end
- function getTool()
- for _, kid in ipairs(Figure:GetChildren()) do
- if kid.className == "Tool" then return kid end
- end
- return nil
- end
- function getToolAnim(tool)
- for _, c in ipairs(tool:GetChildren()) do
- if c.Name == "toolanim" and c.className == "StringValue" then
- return c
- end
- end
- return nil
- end
- function animateTool()
- if (toolAnim == "None") then
- playToolAnimation("toolnone", toolTransitionTime, Humanoid)
- return
- end
- if (toolAnim == "Slash") then
- playToolAnimation("toolslash", 0, Humanoid)
- return
- end
- if (toolAnim == "Lunge") then
- playToolAnimation("toollunge", 0, Humanoid)
- return
- end
- end
- function moveSit()
- RightShoulder.MaxVelocity = 0.15
- LeftShoulder.MaxVelocity = 0.15
- RightShoulder:SetDesiredAngle(3.14 /2)
- LeftShoulder:SetDesiredAngle(-3.14 /2)
- RightHip:SetDesiredAngle(3.14 /2)
- LeftHip:SetDesiredAngle(-3.14 /2)
- end
- local lastTick = 0
- function move(time)
- local amplitude = 1
- local frequency = 1
- local deltaTime = time - lastTick
- lastTick = time
- local climbFudge = 0
- local setAngles = false
- if (jumpAnimTime > 0) then
- jumpAnimTime = jumpAnimTime - deltaTime
- end
- if (pose == "FreeFall" and jumpAnimTime <= 0) then
- playAnimation("fall", fallTransitionTime, Humanoid)
- elseif (pose == "Seated") then
- stopAllAnimations()
- moveSit()
- return
- elseif (pose == "Running") then
- playAnimation("walk", 0.1, Humanoid)
- elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
- -- print("Wha " .. pose)
- amplitude = 0.1
- frequency = 1
- setAngles = true
- end
- if (setAngles) then
- desiredAngle = amplitude * math.sin(time * frequency)
- RightShoulder:SetDesiredAngle(desiredAngle + climbFudge)
- LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge)
- RightHip:SetDesiredAngle(-desiredAngle)
- LeftHip:SetDesiredAngle(-desiredAngle)
- end
- -- Tool Animation handling
- local tool = getTool()
- if tool then
- animStringValueObject = getToolAnim(tool)
- if animStringValueObject then
- toolAnim = animStringValueObject.Value
- -- message recieved, delete StringValue
- animStringValueObject.Parent = nil
- toolAnimTime = time + .3
- end
- if time > toolAnimTime then
- toolAnimTime = 0
- toolAnim = "None"
- end
- animateTool()
- else
- stopToolAnimations()
- toolAnim = "None"
- toolAnimTime = 0
- end
- end
- -- connect events
- Humanoid.Died:connect(onDied)
- Humanoid.Running:connect(onRunning)
- Humanoid.Jumping:connect(onJumping)
- Humanoid.Climbing:connect(onClimbing)
- Humanoid.GettingUp:connect(onGettingUp)
- Humanoid.FreeFalling:connect(onFreeFall)
- Humanoid.FallingDown:connect(onFallingDown)
- Humanoid.Seated:connect(onSeated)
- Humanoid.PlatformStanding:connect(onPlatformStanding)
- Humanoid.Swimming:connect(onSwimming)
- -- setup emote chat hook
- -- main program
- local runService = game:service("RunService");
- -- initialize to idle
- playAnimation("idle", 0.1, Humanoid)
- pose = "Standing"
- while Figure.Parent~=nil do
- local _, time = wait(0.1)
- move(time)
- end
- end))
- StringValue16.Name = "climb"
- StringValue16.Parent = Script15
- Animation17.Name = "ClimbAnim"
- Animation17.Parent = StringValue16
- Animation17.AnimationId = "http://www.roblox.com/asset/?id=125750800"
- StringValue18.Name = "fall"
- StringValue18.Parent = Script15
- Animation19.Name = "FallAnim"
- Animation19.Parent = StringValue18
- Animation19.AnimationId = "http://www.roblox.com/asset/?id=125750759"
- StringValue20.Name = "idle"
- StringValue20.Parent = Script15
- Animation21.Name = "Animation1"
- Animation21.Parent = StringValue20
- Animation21.AnimationId = "http://www.roblox.com/asset/?id=125750544"
- NumberValue22.Name = "Weight"
- NumberValue22.Parent = Animation21
- NumberValue22.Value = 9
- Animation23.Name = "Animation2"
- Animation23.Parent = StringValue20
- Animation23.AnimationId = "http://www.roblox.com/asset/?id=125750618"
- NumberValue24.Name = "Weight"
- NumberValue24.Parent = Animation23
- NumberValue24.Value = 1
- StringValue25.Name = "jump"
- StringValue25.Parent = Script15
- Animation26.Name = "JumpAnim"
- Animation26.Parent = StringValue25
- Animation26.AnimationId = "http://www.roblox.com/asset/?id=125750702"
- StringValue27.Name = "run"
- StringValue27.Parent = Script15
- Animation28.Name = "RunAnim"
- Animation28.Parent = StringValue27
- Animation28.AnimationId = "http://www.roblox.com/asset/?id=125749145"
- StringValue29.Name = "toolnone"
- StringValue29.Parent = Script15
- Animation30.Name = "ToolNoneAnim"
- Animation30.Parent = StringValue29
- Animation30.AnimationId = "http://www.roblox.com/asset/?id=125750867"
- StringValue31.Name = "walk"
- StringValue31.Parent = Script15
- Animation32.Name = "WalkAnim"
- Animation32.Parent = StringValue31
- Animation32.AnimationId = "http://www.roblox.com/asset/?id=125749145"
- Part33.Name = "Head"
- Part33.Parent = Model1
- Part33.BrickColor = BrickColor.new("Cool yellow")
- Part33.Rotation = Vector3.new(0, 90, 0)
- Part33.FormFactor = Enum.FormFactor.Symmetric
- Part33.Size = Vector3.new(2, 1, 1)
- Part33.CFrame = CFrame.new(8.79732513, 4.45095634, -21.2196484, 0.000532949809, -0.000846050854, 1.00000048, 7.0162085e-09, 0.999999642, 0.000846053765, -1.00000155, -4.46565792e-07, 0.000533248123)
- Part33.BottomSurface = Enum.SurfaceType.Smooth
- Part33.TopSurface = Enum.SurfaceType.Smooth
- Part33.Color = Color3.new(0.992157, 0.917647, 0.552941)
- Part33.Position = Vector3.new(8.79732513, 4.45095634, -21.2196484)
- Part33.Orientation = Vector3.new(-0.049999997, 89.9700012, 0)
- Part33.Color = Color3.new(0.992157, 0.917647, 0.552941)
- SpecialMesh34.Parent = Part33
- SpecialMesh34.Scale = Vector3.new(1.25, 1.25, 1.25)
- SpecialMesh34.Scale = Vector3.new(1.25, 1.25, 1.25)
- Decal35.Parent = Part33
- Decal35.Texture = "http://www.roblox.com/asset/?id=134724710"
- Part36.Name = "Right Arm"
- Part36.Parent = Model1
- Part36.BrickColor = BrickColor.new("Cool yellow")
- Part36.Rotation = Vector3.new(0, 90, 0)
- Part36.CanCollide = false
- Part36.FormFactor = Enum.FormFactor.Symmetric
- Part36.Size = Vector3.new(1, 2, 1)
- Part36.CFrame = CFrame.new(8.79939365, 2.95095706, -22.7196503, 0.000532949809, -0.000846050738, 1.00000048, 7.0162085e-09, 0.999999523, 0.000846053765, -1.00000155, -4.46565736e-07, 0.000533248123)
- Part36.BottomSurface = Enum.SurfaceType.Smooth
- Part36.TopSurface = Enum.SurfaceType.Smooth
- Part36.Color = Color3.new(0.992157, 0.917647, 0.552941)
- Part36.Position = Vector3.new(8.79939365, 2.95095706, -22.7196503)
- Part36.Orientation = Vector3.new(-0.049999997, 89.9700012, 0)
- Part36.Color = Color3.new(0.992157, 0.917647, 0.552941)
- Part37.Name = "Left Arm"
- Part37.Parent = Model1
- Part37.BrickColor = BrickColor.new("Cool yellow")
- Part37.Rotation = Vector3.new(0, 90, 0)
- Part37.CanCollide = false
- Part37.FormFactor = Enum.FormFactor.Symmetric
- Part37.Size = Vector3.new(1, 2, 1)
- Part37.CFrame = CFrame.new(8.7977953, 2.95095706, -19.7196465, 0.000532949809, -0.000846050738, 1.00000048, 7.0162085e-09, 0.999999523, 0.000846053765, -1.00000155, -4.46565736e-07, 0.000533248123)
- Part37.BottomSurface = Enum.SurfaceType.Smooth
- Part37.TopSurface = Enum.SurfaceType.Smooth
- Part37.Color = Color3.new(0.992157, 0.917647, 0.552941)
- Part37.Position = Vector3.new(8.7977953, 2.95095706, -19.7196465)
- Part37.Orientation = Vector3.new(-0.049999997, 89.9700012, 0)
- Part37.Color = Color3.new(0.992157, 0.917647, 0.552941)
- Part38.Name = "Right Leg"
- Part38.Parent = Model1
- Part38.BrickColor = BrickColor.new("Bright blue")
- Part38.Rotation = Vector3.new(0, 90, 0)
- Part38.CanCollide = false
- Part38.FormFactor = Enum.FormFactor.Symmetric
- Part38.Size = Vector3.new(1, 2, 1)
- Part38.CFrame = CFrame.new(8.80055332, 0.950957894, -21.7196484, 0.000532949809, -0.000846050738, 1.00000048, 7.0162085e-09, 0.999999523, 0.000846053765, -1.00000155, -4.46565736e-07, 0.000533248123)
- Part38.BottomSurface = Enum.SurfaceType.Smooth
- Part38.TopSurface = Enum.SurfaceType.Smooth
- Part38.Color = Color3.new(0.0509804, 0.411765, 0.67451)
- Part38.Position = Vector3.new(8.80055332, 0.950957894, -21.7196484)
- Part38.Orientation = Vector3.new(-0.049999997, 89.9700012, 0)
- Part38.Color = Color3.new(0.0509804, 0.411765, 0.67451)
- Part39.Name = "Left Leg"
- Part39.Parent = Model1
- Part39.BrickColor = BrickColor.new("Bright blue")
- Part39.Rotation = Vector3.new(0, 90, 0)
- Part39.CanCollide = false
- Part39.FormFactor = Enum.FormFactor.Symmetric
- Part39.Size = Vector3.new(1, 2, 1)
- Part39.CFrame = CFrame.new(8.80002022, 0.950957894, -20.7196465, 0.000532949809, -0.000846050738, 1.00000048, 7.0162085e-09, 0.999999523, 0.000846053765, -1.00000155, -4.46565736e-07, 0.000533248123)
- Part39.BottomSurface = Enum.SurfaceType.Smooth
- Part39.TopSurface = Enum.SurfaceType.Smooth
- Part39.Color = Color3.new(0.0509804, 0.411765, 0.67451)
- Part39.Position = Vector3.new(8.80002022, 0.950957894, -20.7196465)
- Part39.Orientation = Vector3.new(-0.049999997, 89.9700012, 0)
- Part39.Color = Color3.new(0.0509804, 0.411765, 0.67451)
- Part40.Name = "Torso"
- Part40.Parent = Model1
- Part40.BrickColor = BrickColor.new("Dark green")
- Part40.Rotation = Vector3.new(0, 90, 0)
- Part40.CanCollide = false
- Part40.FormFactor = Enum.FormFactor.Symmetric
- Part40.Size = Vector3.new(2, 2, 1)
- Part40.CFrame = CFrame.new(8.79859447, 2.95095706, -21.2196484, 0.000532949809, -0.000846050854, 1.00000048, 7.0162085e-09, 0.999999642, 0.000846053765, -1.00000155, -4.46565792e-07, 0.000533248123)
- Part40.BottomSurface = Enum.SurfaceType.Smooth
- Part40.TopSurface = Enum.SurfaceType.Smooth
- Part40.Color = Color3.new(0.156863, 0.498039, 0.278431)
- Part40.Position = Vector3.new(8.79859447, 2.95095706, -21.2196484)
- Part40.Orientation = Vector3.new(-0.049999997, 89.9700012, 0)
- Part40.Color = Color3.new(0.156863, 0.498039, 0.278431)
- Sound41.Name = "HitSound"
- Sound41.Parent = Part40
- Sound41.SoundId = "http://www.roblox.com/asset/?id=93591808"
- Motor6D42.Name = "Left Hip"
- Motor6D42.Parent = Part40
- Motor6D42.C0 = CFrame.new(-1, -1, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08)
- Motor6D42.C1 = CFrame.new(-0.5, 1, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08)
- Motor6D42.Part0 = Part40
- Motor6D42.Part1 = Part39
- Motor6D42.MaxVelocity = 0.10000000149012
- Motor6D43.Name = "Right Hip"
- Motor6D43.Parent = Part40
- Motor6D43.C0 = CFrame.new(1, -1, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08)
- Motor6D43.C1 = CFrame.new(0.5, 1, 0, -4.37113883e-08, 0, 1, 0, 0.99999994, 0, -1, 0, -4.37113883e-08)
- Motor6D43.Part0 = Part40
- Motor6D43.Part1 = Part38
- Motor6D43.MaxVelocity = 0.10000000149012
- Motor6D44.Name = "Left Shoulder"
- Motor6D44.Parent = Part40
- Motor6D44.C0 = CFrame.new(-1, 0.5, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08)
- Motor6D44.C1 = CFrame.new(0.5, 0.5, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08)
- Motor6D44.Part0 = Part40
- Motor6D44.Part1 = Part37
- Motor6D44.MaxVelocity = 0.10000000149012
- Motor6D45.Name = "Right Shoulder"
- Motor6D45.Parent = Part40
- Motor6D45.C0 = CFrame.new(1, 0.5, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08)
- Motor6D45.C1 = CFrame.new(-0.5, 0.5, 0, -4.37113883e-08, 0, 1, 0, 0.99999994, 0, -1, 0, -4.37113883e-08)
- Motor6D45.Part0 = Part40
- Motor6D45.Part1 = Part36
- Motor6D45.MaxVelocity = 0.10000000149012
- Motor6D46.Name = "Neck"
- Motor6D46.Parent = Part40
- Motor6D46.C0 = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Motor6D46.C1 = CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Motor6D46.Part0 = Part40
- Motor6D46.Part1 = Part33
- Motor6D46.MaxVelocity = 0.10000000149012
- Part47.Name = "HumanoidRootPart"
- Part47.Parent = Model1
- Part47.Transparency = 1
- Part47.Rotation = Vector3.new(0, 90, 0)
- Part47.FormFactor = Enum.FormFactor.Symmetric
- Part47.Size = Vector3.new(2, 2, 1)
- Part47.CFrame = CFrame.new(8.79859447, 2.95095706, -21.2196484, 0.000532949809, -0.000846050854, 1.00000048, 7.0162085e-09, 0.999999642, 0.000846053765, -1.00000155, -4.46565792e-07, 0.000533248123)
- Part47.BottomSurface = Enum.SurfaceType.Smooth
- Part47.TopSurface = Enum.SurfaceType.Smooth
- Part47.Position = Vector3.new(8.79859447, 2.95095706, -21.2196484)
- Part47.Orientation = Vector3.new(-0.049999997, 89.9700012, 0)
- Motor6D48.Name = "Root Hip"
- Motor6D48.Parent = Part47
- Motor6D48.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Motor6D48.C1 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Motor6D48.Part0 = Part47
- Motor6D48.Part1 = Part40
- Motor6D48.MaxVelocity = 0.10000000149012
- Script49.Name = "READ ME"
- Script49.Parent = Model1
- table.insert(cors,sandbox(Script49,function()
- --- Please support and like and fav. Zombie wars for more updates.
- ---THANK YOU
- --YUANRAVIEH190
- end))
- Part50.Name = "MonsterSpawn"
- Part50.Parent = Model0
- Part50.Material = Enum.Material.Neon
- Part50.BrickColor = BrickColor.new("Reddish brown")
- Part50.Rotation = Vector3.new(0, 90, 0)
- Part50.Anchored = true
- Part50.CanCollide = false
- Part50.FormFactor = Enum.FormFactor.Custom
- Part50.Size = Vector3.new(6, 0.200000003, 6)
- Part50.CFrame = CFrame.new(8.40015602, -0.149426997, -21.229414, -1.94256427e-06, 2.03144737e-08, 1.00000048, 1.57338604e-08, 0.999990463, -3.37604433e-09, -1.00000083, 1.46186778e-08, -1.79343624e-06)
- Part50.BottomSurface = Enum.SurfaceType.Smooth
- Part50.TopSurface = Enum.SurfaceType.Smooth
- Part50.Color = Color3.new(0.411765, 0.25098, 0.156863)
- Part50.Position = Vector3.new(8.40015602, -0.149426997, -21.229414)
- Part50.Orientation = Vector3.new(0, 90, 0)
- Part50.Color = Color3.new(0.411765, 0.25098, 0.156863)
- Decal51.Parent = Part50
- Decal51.Texture = "http://www.roblox.com/asset/?id=134724710"
- Decal51.Face = Enum.NormalId.Top
- Script52.Parent = Part50
- table.insert(cors,sandbox(Script52,function()
- zombie = script.Parent.Parent.Zombie
- zombiebackup = zombie:Clone()
- zombie:remove()
- while true do
- wait(5)
- local newzombie = zombiebackup:Clone()
- newzombie.Parent = game.Workspace
- newzombie:MakeJoints()
- newzombie.Torso.CFrame = script.Parent.CFrame + Vector3.new(0, 5, 0)
- newzombie:MakeJoints()
- zombie = newzombie
- zombiebackup = zombie:Clone()
- end
- end))
- ManualWeld53.Name = "MonsterSpawn-to-MonsterSpawn Strong Joint"
- ManualWeld53.Parent = Part50
- ManualWeld53.C0 = CFrame.new(3, -0.100000001, 3, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- ManualWeld53.C1 = CFrame.new(-3, -0.100000001, 3, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- ManualWeld53.Part0 = Part50
- Model54.Parent = mas
- Model55.Name = "Zombie"
- Model55.Parent = Model54
- Script56.Name = "Ragdoller"
- Script56.Parent = Model55
- table.insert(cors,sandbox(Script56,function()
- print("Ragdoll script activated")
- Gibs = game.Workspace
- function getKillerOfHumanoidIfStillInGame(humanoid)
- local tag = humanoid:findFirstChild("creator")
- if tag ~= nil then
- local killer = tag.Value
- if killer.Parent ~= nil then
- return killer
- end
- end
- return nil
- end
- function OnDeath(Character)
- local svch = Character
- local hum = Character:findFirstChild("Humanoid")
- local getkiller = getKillerOfHumanoidIfStillInGame(hum)
- Character.Archivable = true
- local chrclone = Character:clone()
- Character.Archivable = false
- local ch = chrclone:GetChildren()
- local i
- for i = 1,#ch do
- if ch[i].Name == "THandle1" or ch[i].Name == "THandle2" or ch[i].ClassName == "Script" then
- ch[i]:remove()
- end
- end
- local function Scan(ch)
- local e
- for e = 1,#ch do
- Scan(ch[e]:GetChildren())
- if ch[e].ClassName == "Weld" or ch[e].ClassName == "Motor6D" then
- ch[e]:remove()
- end
- end
- end
- Scan(chrclone:GetChildren())
- local hum2 = chrclone:findFirstChild("Humanoid")
- if hum2 ~= nil then
- hum2.Name = "Humanoid2"
- hum2.PlatformStand = true
- hum2.Sit = true
- hum2.MaxHealth = 0
- hum2.Health = 0
- end
- local ch = Character:GetChildren()
- local i
- for i = 1,#ch do
- if ch[i].Name == "THandle1" or ch[i].Name == "THandle2" then
- ch[i]:remove()
- end
- end
- wait(0.2)
- local ch = Character:GetChildren()
- local i
- for i = 1,#ch do
- if ch[i].ClassName == "Part" or ch[i].ClassName == "Hat" or ch[i].Name == "THandle1" or ch[i].Name == "THandle2" then
- ch[i]:remove()
- end
- end
- Character = chrclone
- local Torso = Character.Torso
- local movevector = Vector3.new()
- if Torso then
- if getkiller ~= nil then
- if getkiller.Character ~= nil then
- local killtors = getkiller.Character:findFirstChild("Torso")
- if killtors ~= nil then
- movevector = CFrame.new(killtors.Position,Torso.Position).lookVector
- end
- end
- end
- local Head = Character:FindFirstChild("Head")
- if Head then
- local Neck = Instance.new("Weld")
- Neck.Name = "Neck"
- Neck.Part0 = Torso
- Neck.Part1 = Head
- Neck.C0 = CFrame.new(0, 1.5, 0)
- Neck.C1 = CFrame.new()
- Neck.Parent = Torso
- local nsc = script.CamAttach:clone()
- nsc.CamPart.Value = hum2.Parent.Head
- nsc.Disabled = false
- nsc.Parent = svch
- end
- local Limb = Character:FindFirstChild("Right Arm")
- if Limb then
- Limb.CFrame = Torso.CFrame * CFrame.new(1.5, 0, 0)
- local Joint = Instance.new("Glue")
- Joint.Name = "RightShoulder"
- Joint.Part0 = Torso
- Joint.Part1 = Limb
- Joint.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- Joint.C1 = CFrame.new(-0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- Joint.Parent = Torso
- local B = Instance.new("Part")
- B.TopSurface = 0
- B.BottomSurface = 0
- B.formFactor = "Symmetric"
- B.Size = Vector3.new(1, 1, 1)
- B.Transparency = 1
- B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
- B.Parent = Character
- local W = Instance.new("Weld")
- W.Part0 = Limb
- W.Part1 = B
- W.C0 = CFrame.new(0, -0.5, 0)
- W.Parent = Limb
- end
- local Limb = Character:FindFirstChild("Left Arm")
- if Limb then
- Limb.CFrame = Torso.CFrame * CFrame.new(-1.5, 0, 0)
- local Joint = Instance.new("Glue")
- Joint.Name = "LeftShoulder"
- Joint.Part0 = Torso
- Joint.Part1 = Limb
- Joint.C0 = CFrame.new(-1.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- Joint.C1 = CFrame.new(0, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- Joint.Parent = Torso
- local B = Instance.new("Part")
- B.TopSurface = 0
- B.BottomSurface = 0
- B.formFactor = "Symmetric"
- B.Size = Vector3.new(1, 1, 1)
- B.Transparency = 1
- B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
- B.Parent = Character
- local W = Instance.new("Weld")
- W.Part0 = Limb
- W.Part1 = B
- W.C0 = CFrame.new(0, -0.5, 0)
- W.Parent = Limb
- end
- local Limb = Character:FindFirstChild("Right Leg")
- if Limb then
- Limb.CFrame = Torso.CFrame * CFrame.new(0.5, -2, 0)
- local Joint = Instance.new("Glue")
- Joint.Name = "RightHip"
- Joint.Part0 = Torso
- Joint.Part1 = Limb
- Joint.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- Joint.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- Joint.Parent = Torso
- local B = Instance.new("Part")
- B.TopSurface = 0
- B.BottomSurface = 0
- B.formFactor = "Symmetric"
- B.Size = Vector3.new(1, 1, 1)
- B.Transparency = 1
- B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
- B.Parent = Character
- local W = Instance.new("Weld")
- W.Part0 = Limb
- W.Part1 = B
- W.C0 = CFrame.new(0, -0.5, 0)
- W.Parent = Limb
- end
- local Limb = Character:FindFirstChild("Left Leg")
- if Limb then
- Limb.CFrame = Torso.CFrame * CFrame.new(-0.5, -2, 0)
- local Joint = Instance.new("Glue")
- Joint.Name = "LeftHip"
- Joint.Part0 = Torso
- Joint.Part1 = Limb
- Joint.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- Joint.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- Joint.Parent = Torso
- local B = Instance.new("Part")
- B.TopSurface = 0
- B.BottomSurface = 0
- B.formFactor = "Symmetric"
- B.Size = Vector3.new(1, 1, 1)
- B.Transparency = 1
- B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
- B.Parent = Character
- local W = Instance.new("Weld")
- W.Part0 = Limb
- W.Part1 = B
- W.C0 = CFrame.new(0, -0.5, 0)
- W.Parent = Limb
- end
- --[
- local Bar = Instance.new("Part")
- Bar.TopSurface = 0
- Bar.BottomSurface = 0
- Bar.formFactor = "Symmetric"
- Bar.Size = Vector3.new(1, 1, 1)
- Bar.Transparency = 1
- Bar.CFrame = Torso.CFrame * CFrame.new(0, 0.5, 0)
- Bar.Parent = Character
- local Weld = Instance.new("Weld")
- Weld.Part0 = Torso
- Weld.Part1 = Bar
- Weld.C0 = CFrame.new(0, 0.5, 0)
- Weld.Parent = Torso
- --]]
- end
- Character.Parent = Gibs
- game.Debris:AddItem(Character, 12)
- if movevector ~= Vector3.new() then
- for i = 1,10 do
- wait()
- Torso.Velocity = movevector * 30
- end
- end
- end
- script.Parent.Humanoid.Died:connect(function()
- OnDeath(script.Parent)
- end)
- end))
- LocalScript57.Name = "CamAttach"
- LocalScript57.Parent = Script56
- LocalScript57.Disabled = true
- table.insert(cors,sandbox(LocalScript57,function()
- wait()
- game.Workspace.CurrentCamera.CameraSubject = script.CamPart.Value
- end))
- ObjectValue58.Name = "CamPart"
- ObjectValue58.Parent = LocalScript57
- Script59.Name = "ZombieScript"
- Script59.Parent = Model55
- table.insert(cors,sandbox(Script59,function()
- wait()
- -- Handles damage, sounds
- local hum = script.Parent:FindFirstChild("Humanoid")
- local torso = script.Parent:FindFirstChild("HumanoidRootPart")
- local head = script.Parent:FindFirstChild("Head")
- DB = false
- local function onTouch(hit)
- if DB then return end
- if hit == nil then return end
- if hit.Parent == nil then return end
- local vhum = hit.Parent:FindFirstChild("Humanoid")
- if vhum ~= nil then
- if hum.Health <= 0 then return end
- if vhum ~= hum and not hit.Parent:FindFirstChild("ZombieScript") then -- keeps it from hurting itself/ zombies
- vhum:TakeDamage(math.random(6, 9))
- DB = true
- wait(1)
- DB = false
- end
- end
- end
- torso.Touched:connect(onTouch)
- local zombienoises = {93591696, 208668860, 179266532, 229895387, 150076506}
- local moan = head:FindFirstChild("Moan")
- while head ~= nil do
- wait(math.random(6, 13))
- moan.Pitch = math.random(8, 10)/10
- moan.SoundId = "rbxassetid://"..tostring(zombienoises[math.random(1, #zombienoises)])
- moan:Play()
- end
- end))
- Script60.Name = "Follow"
- Script60.Parent = Model55
- table.insert(cors,sandbox(Script60,function()
- wait()
- local hum = script.Parent:FindFirstChild("Humanoid")
- local torso = script.Parent:FindFirstChild("HumanoidRootPart")
- local max_dist = 200
- function findNearestTorso()
- for _, player in pairs(game.Players:GetPlayers()) do
- if player.Character ~= nil then
- local target_torso = player.Character:FindFirstChild("HumanoidRootPart")
- if target_torso ~= nil then
- if (target_torso.Position - torso.Position).magnitude < max_dist then
- return target_torso
- end
- end
- end
- end
- end
- local old_pos = torso.Position
- wait(math.random(0, 90)/100)
- while hum ~= nil do
- local target = findNearestTorso()
- if target ~= nil then
- while target ~= nil and target.Parent ~= nil and hum ~= nil do
- if (target.Position - torso.Position).magnitude < max_dist then
- hum:MoveTo(target.Position, target)
- if target.Position.Y > torso.Position.Y + 3 then
- hum.Jump = true
- end
- if (old_pos - torso.Position).magnitude < 0.5 then
- if math.random(1, 3) == 1 then
- torso.Velocity = torso.CFrame.lookVector * -40
- hum:MoveTo(torso.Position + Vector3.new(math.random(-1, 1), 0, math.random(-1, 1))*20)
- wait(1.2)
- else
- hum.Jump = true
- hum:MoveTo(target.Position, target)
- end
- end
- else break end
- old_pos = torso.Position
- wait(0.5)
- end
- end
- wait(4)
- end
- end))
- Script61.Name = "Die"
- Script61.Parent = Model55
- table.insert(cors,sandbox(Script61,function()
- human = script.Parent.Humanoid
- --tool = script.Parent.Pistol
- function Die()
- --if tool ~= nil then tool:remove() end
- game.workspace.Scripts.WaveScript.Dead_Zombies.Value = game.workspace.Scripts.WaveScript.Dead_Zombies.Value + 1
- wait(2.5)
- script.Parent:remove()
- end
- human.Died:connect(Die)
- end))
- Script62.Name = "ZombieScript"
- Script62.Parent = Model55
- table.insert(cors,sandbox(Script62,function()
- --Made by Stickmasterluke
- --Zombie artificial stupidity script
- sp=script.Parent
- lastattack=0
- nextrandom=0
- nextsound=0
- nextjump=0
- chasing=false
- variance=4
- damage=10
- attackrange=4.5
- sightrange=999--60
- runspeed=10
- wonderspeed=8
- healthregen=false
- colors={"Sand red","Dusty Rose","Medium blue","Sand blue","Lavender","Earth green","Brown","Medium stone grey","Brick yellow"}
- function raycast(spos,vec,currentdist)
- local hit2,pos2=game.Workspace:FindPartOnRay(Ray.new(spos+(vec*.01),vec*currentdist),script.Parent)
- if hit2~=nil and pos2 then
- if hit2.Parent==script.Parent and hit2.Transparency>=.8 or hit2.Name=="Handle" or string.sub(hit2.Name,1,6)=="Effect" or hit2.Parent:IsA("Hat") or hit2.Parent:IsA("Tool") or (hit2.Parent:FindFirstChild("Humanoid") and hit2.Parent:FindFirstChild("TEAM") and hit2.Parent:FindFirstChild("TEAM").Value == script.Parent.TEAM.Value) or (not hit2.Parent:FindFirstChild("Humanoid") and hit2.CanCollide==false) then
- local currentdist=currentdist-(pos2-spos).magnitude
- return raycast(pos2,vec,currentdist)
- end
- end
- return hit2,pos2
- end
- function waitForChild(parent,childName)
- local child=parent:findFirstChild(childName)
- if child then return child end
- while true do
- child=parent.ChildAdded:wait()
- if child.Name==childName then return child end
- end
- end
- -- ANIMATION
- -- declarations
- local Torso=waitForChild(sp,"Torso")
- local Head=waitForChild(sp,"Head")
- local RightShoulder=waitForChild(Torso,"Right Shoulder")
- local LeftShoulder=waitForChild(Torso,"Left Shoulder")
- local RightHip=waitForChild(Torso,"Right Hip")
- local LeftHip=waitForChild(Torso,"Left Hip")
- local Neck=waitForChild(Torso,"Neck")
- local Humanoid=waitForChild(sp,"Humanoid")
- local BodyColors=waitForChild(sp,"Body Colors")
- local pose="Standing"
- local hitsound=waitForChild(Torso,"HitSound")
- local Anim = Humanoid:LoadAnimation(sp.AttackAnim)
- --[[local sounds={
- waitForChild(Torso,"GroanSound"),
- waitForChild(Torso,"RawrSound")
- }]]
- if healthregen then
- local regenscript=waitForChild(sp,"HealthRegenerationScript")
- regenscript.Disabled=false
- end
- Humanoid.WalkSpeed=wonderspeed
- local toolAnim="None"
- local toolAnimTime=0
- --[[BodyColors.HeadColor=BrickColor.new("Grime")
- local randomcolor1=colors[math.random(1,#colors)]
- BodyColors.TorsoColor=BrickColor.new(randomcolor1)
- BodyColors.LeftArmColor=BrickColor.new(randomcolor1)
- BodyColors.RightArmColor=BrickColor.new(randomcolor1)
- local randomcolor2=colors[math.random(1,#colors)]
- BodyColors.LeftLegColor=BrickColor.new(randomcolor2)
- BodyColors.RightLegColor=BrickColor.new(randomcolor2)]]
- function onRunning(speed)
- if speed>0 then
- pose="Running"
- else
- pose="Standing"
- end
- end
- function onDied()
- pose="Dead"
- end
- function onJumping()
- pose="Jumping"
- end
- function onClimbing()
- pose="Climbing"
- end
- function onGettingUp()
- pose = "GettingUp"
- end
- function onFreeFall()
- pose = "FreeFall"
- end
- function onFallingDown()
- pose = "FallingDown"
- end
- function onSeated()
- pose = "Seated"
- end
- function onPlatformStanding()
- pose = "PlatformStanding"
- end
- function moveJump()
- RightShoulder.MaxVelocity = 0.5
- LeftShoulder.MaxVelocity = 0.5
- RightShoulder.DesiredAngle=3.14
- LeftShoulder.DesiredAngle=-3.14
- RightHip.DesiredAngle=0
- LeftHip.DesiredAngle=0
- end
- function moveFreeFall()
- RightShoulder.MaxVelocity = 0.5
- LeftShoulder.MaxVelocity =0.5
- RightShoulder.DesiredAngle=3.14
- LeftShoulder.DesiredAngle=-3.14
- RightHip.DesiredAngle=0
- LeftHip.DesiredAngle=0
- end
- function moveSit()
- RightShoulder.MaxVelocity = 0.15
- LeftShoulder.MaxVelocity = 0.15
- RightShoulder.DesiredAngle=3.14 /2
- LeftShoulder.DesiredAngle=-3.14 /2
- RightHip.DesiredAngle=3.14 /2
- LeftHip.DesiredAngle=-3.14 /2
- end
- function animate(time)
- local amplitude
- local frequency
- if (pose == "Jumping") then
- moveJump()
- return
- end
- if (pose == "FreeFall") then
- moveFreeFall()
- return
- end
- if (pose == "Seated") then
- moveSit()
- return
- end
- local climbFudge = 0
- if (pose == "Running") then
- RightShoulder.MaxVelocity = 0.15
- LeftShoulder.MaxVelocity = 0.15
- amplitude = 1
- frequency = 9
- elseif (pose == "Climbing") then
- RightShoulder.MaxVelocity = 0.5
- LeftShoulder.MaxVelocity = 0.5
- amplitude = 1
- frequency = 9
- climbFudge = 3.14
- else
- amplitude = 0.1
- frequency = 1
- end
- desiredAngle = amplitude * math.sin(time*frequency)
- if not chasing and frequency==9 then
- frequency=4
- end
- if chasing then
- --[[RightShoulder.DesiredAngle=math.pi/2
- LeftShoulder.DesiredAngle=-math.pi/2
- RightHip.DesiredAngle=-desiredAngle*2
- LeftHip.DesiredAngle=-desiredAngle*2]]
- else
- RightShoulder.DesiredAngle=desiredAngle + climbFudge
- LeftShoulder.DesiredAngle=desiredAngle - climbFudge
- RightHip.DesiredAngle=-desiredAngle
- LeftHip.DesiredAngle=-desiredAngle
- end
- end
- function attack(time,attackpos)
- if time-lastattack>=0.25 then
- local hit,pos=raycast(Torso.Position,(attackpos-Torso.Position).unit,attackrange)
- if hit and hit.Parent~=nil then
- local h=hit.Parent:FindFirstChild("Humanoid")
- local TEAM=hit.Parent:FindFirstChild("TEAM")
- if h and TEAM and TEAM.Value~=sp.TEAM.Value then
- local creator=sp:FindFirstChild("creator")
- if creator then
- if creator.Value~=nil then
- if creator.Value~=game.Players:GetPlayerFromCharacter(h.Parent) then
- for i,oldtag in ipairs(h:GetChildren()) do
- if oldtag.Name=="creator" then
- oldtag:remove()
- end
- end
- creator:clone().Parent=h
- else
- return
- end
- end
- end
- if Anim then Anim:Play(nil,nil,1.5) end
- h:TakeDamage(damage)
- hitsound.Volume=1
- hitsound.Pitch=.75+(math.random()*.5)
- hitsound:Play()
- --[[if RightShoulder and LeftShoulder then
- RightShoulder.CurrentAngle=0
- LeftShoulder.CurrentAngle=0
- end]]
- end
- end
- lastattack=time
- end
- end
- Humanoid.Died:connect(onDied)
- Humanoid.Running:connect(onRunning)
- Humanoid.Jumping:connect(onJumping)
- Humanoid.Climbing:connect(onClimbing)
- Humanoid.GettingUp:connect(onGettingUp)
- Humanoid.FreeFalling:connect(onFreeFall)
- Humanoid.FallingDown:connect(onFallingDown)
- Humanoid.Seated:connect(onSeated)
- Humanoid.PlatformStanding:connect(onPlatformStanding)
- function populatehumanoids(mdl)
- if mdl.ClassName=="Humanoid" then
- if mdl.Parent:FindFirstChild("TEAM") and mdl.Parent:FindFirstChild("TEAM").Value~=sp.TEAM.Value then
- table.insert(humanoids,mdl)
- end
- end
- for i2,mdl2 in ipairs(mdl:GetChildren()) do
- populatehumanoids(mdl2)
- end
- end
- --[[function playsound(time)
- nextsound=time+5+(math.random()*5)
- local randomsound=sounds[math.random(1,#sounds)]
- randomsound.Volume=.5+(.5*math.random())
- randomsound.Pitch=.5+(.5*math.random())
- randomsound:Play()
- end]]
- while sp.Parent~=nil and Humanoid and Humanoid.Parent~=nil and Humanoid.Health>0 and Torso and Head and Torso~=nil and Torso.Parent~=nil do
- local _,time=wait(0.25)--wait(1/3)
- humanoids={}
- populatehumanoids(game.Workspace)
- closesttarget=nil
- closestdist=sightrange
- local creator=sp:FindFirstChild("creator")
- for i,h in ipairs(humanoids) do
- if h and h.Parent~=nil then
- if h.Health>0 and h.Parent~=sp then
- local plr=game.Players:GetPlayerFromCharacter(h.Parent)
- if creator==nil or plr==nil or creator.Value~=plr then
- local t=h.Parent:FindFirstChild("Torso")
- if t~=nil then
- local dist=(t.Position-Torso.Position).magnitude
- if dist<closestdist then
- closestdist=dist
- closesttarget=t
- end
- end
- end
- end
- end
- end
- if closesttarget~=nil then
- if not chasing then
- --playsound(time)
- chasing=true
- Humanoid.WalkSpeed=runspeed
- end
- Humanoid:MoveTo(closesttarget.Position+(Vector3.new(1,1,1)*(variance*((math.random()*2)-1))),closesttarget)
- if math.random()<.5 then
- attack(time,closesttarget.Position)
- end
- else
- if chasing then
- chasing=false
- Humanoid.WalkSpeed=wonderspeed
- end
- if time>nextrandom then
- nextrandom=time+3+(math.random()*5)
- local randompos=Torso.Position+((Vector3.new(1,1,1)*math.random()-Vector3.new(.5,.5,.5))*40)
- Humanoid:MoveTo(randompos,game.Workspace.Terrain)
- end
- end
- if time>nextsound then
- --playsound(time)
- end
- if time>nextjump then
- nextjump=time+7+(math.random()*5)
- Humanoid.Jump=true
- end
- animate(time)
- end
- wait(4)
- sp:remove() --Rest In Pizza
- end))
- Animation63.Name = "AttackAnim"
- Animation63.Parent = Model55
- Animation63.AnimationId = "http://www.roblox.com/Asset?ID=105211514"
- BodyColors64.Parent = Model55
- BodyColors64.HeadColor = BrickColor.new("Medium green")
- BodyColors64.LeftArmColor = BrickColor.new("Medium green")
- BodyColors64.LeftLegColor = BrickColor.new("Reddish brown")
- BodyColors64.RightArmColor = BrickColor.new("Medium green")
- BodyColors64.RightLegColor = BrickColor.new("Reddish brown")
- BodyColors64.TorsoColor = BrickColor.new("Reddish brown")
- BrickColorValue65.Name = "TEAM"
- BrickColorValue65.Parent = Model55
- BrickColorValue65.Value = BrickColor.new("Bright green")
- Script66.Name = "Sound"
- Script66.Parent = Model55
- table.insert(cors,sandbox(Script66,function()
- -- util
- function waitForChild(parent, childName)
- local child = parent:findFirstChild(childName)
- if child then return child end
- while true do
- child = parent.ChildAdded:wait()
- if child.Name==childName then return child end
- end
- end
- function newSound(id)
- local sound = Instance.new("Sound")
- sound.SoundId = id
- sound.archivable = false
- sound.Parent = script.Parent.Head
- return sound
- end
- -- declarations
- local sDied = newSound("rbxasset://sounds/uuhhh.wav")
- sDied.Pitch = 0.75
- local sFallingDown = newSound("rbxasset://sounds/splat.wav")
- local sFreeFalling = newSound("rbxasset://sounds/swoosh.wav")
- local sGettingUp = newSound("rbxasset://sounds/hit.wav")
- local sJumping = newSound("rbxasset://sounds/button.wav")
- local sRunning = newSound("rbxasset://sounds/bfsl-minifigfoots1.mp3")
- sRunning.Looped = true
- local Figure = script.Parent
- local Head = waitForChild(Figure, "Head")
- local Humanoid = waitForChild(Figure, "Humanoid")
- -- functions
- function onDied()
- sDied:Play()
- wait(2.5)
- script.Parent:Destroy()
- end
- function onState(state, sound)
- if state then
- sound:Play()
- else
- sound:Pause()
- end
- end
- function onRunning(speed)
- if speed>0 then
- sRunning:Play()
- else
- sRunning:Pause()
- end
- end
- -- connect up
- Humanoid.Died:connect(onDied)
- Humanoid.Running:connect(onRunning)
- Humanoid.Jumping:connect(function(state) onState(state, sJumping) end)
- Humanoid.GettingUp:connect(function(state) onState(state, sGettingUp) end)
- Humanoid.FreeFalling:connect(function(state) onState(state, sFreeFalling) end)
- Humanoid.FallingDown:connect(function(state) onState(state, sFallingDown) end)
- end))
- Humanoid67.Parent = Model55
- Humanoid67.RightLeg = Part92
- Humanoid67.LeftLeg = Part93
- Humanoid67.Torso = Part101
- Script68.Name = "HealthRegenerationScript"
- Script68.Parent = Model55
- Script68.Disabled = true
- table.insert(cors,sandbox(Script68,function()
- -- Renegeration Script for the bot
- -- Renegerates about 1% of max hp per second until it reaches max health
- bot = script.Parent
- Humanoid = bot:FindFirstChild("Humanoid")
- local regen = false
- function regenerate()
- if regen then return end
- -- Lock this function until the regeneration to max health is complete by using a boolean toggle
- regen = true
- while Humanoid.Health < Humanoid.MaxHealth do
- local delta = wait(1)
- local health = Humanoid.Health
- if health > 0 and health < Humanoid.MaxHealth then
- -- This delta is for regenerating 1% of max hp per second instead of 1 hp per second
- delta = 0.01 * delta * Humanoid.MaxHealth
- health = health + delta
- Humanoid.Health = math.min(health, Humanoid.MaxHealth)
- end
- end
- -- release the lock, since the health is at max now, and if the character loses health again
- -- it needs to start regenerating
- regen = false
- end
- if Humanoid then
- -- Better than a while true do loop since it only fires when the health actually changes
- Humanoid.HealthChanged:connect(regenerate)
- end
- end))
- Script69.Name = "Animate"
- Script69.Parent = Model55
- table.insert(cors,sandbox(Script69,function()
- function waitForChild(parent, childName)
- local child = parent:findFirstChild(childName)
- if child then return child end
- while true do
- child = parent.ChildAdded:wait()
- if child.Name==childName then return child end
- end
- end
- local Figure = script.Parent
- local Torso = waitForChild(Figure, "Torso")
- local RightShoulder = waitForChild(Torso, "Right Shoulder")
- local LeftShoulder = waitForChild(Torso, "Left Shoulder")
- local RightHip = waitForChild(Torso, "Right Hip")
- local LeftHip = waitForChild(Torso, "Left Hip")
- local Neck = waitForChild(Torso, "Neck")
- local Humanoid = waitForChild(Figure, "Humanoid")
- local pose = "Standing"
- local currentAnim = ""
- local currentAnimTrack = nil
- local currentAnimKeyframeHandler = nil
- local currentAnimSpeed = 1.0
- local animTable = {}
- local animNames = {
- idle = {
- { id = "http://www.roblox.com/asset/?id=125750544", weight = 9 },
- { id = "http://www.roblox.com/asset/?id=125750618", weight = 1 }
- },
- walk = {
- { id = "http://www.roblox.com/asset/?id=125749145", weight = 10 }
- },
- run = {
- { id = "run.xml", weight = 10 }
- },
- jump = {
- { id = "http://www.roblox.com/asset/?id=125750702", weight = 10 }
- },
- fall = {
- { id = "http://www.roblox.com/asset/?id=125750759", weight = 10 }
- },
- climb = {
- { id = "http://www.roblox.com/asset/?id=125750800", weight = 10 }
- },
- toolnone = {
- { id = "http://www.roblox.com/asset/?id=125750867", weight = 10 }
- },
- toolslash = {
- { id = "http://www.roblox.com/asset/?id=129967390", weight = 10 }
- -- { id = "slash.xml", weight = 10 }
- },
- toollunge = {
- { id = "http://www.roblox.com/asset/?id=129967478", weight = 10 }
- },
- wave = {
- { id = "http://www.roblox.com/asset/?id=128777973", weight = 10 }
- },
- point = {
- { id = "http://www.roblox.com/asset/?id=128853357", weight = 10 }
- },
- dance = {
- { id = "http://www.roblox.com/asset/?id=130018893", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=132546839", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=132546884", weight = 10 }
- },
- dance2 = {
- { id = "http://www.roblox.com/asset/?id=160934142", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=160934298", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=160934376", weight = 10 }
- },
- dance3 = {
- { id = "http://www.roblox.com/asset/?id=160934458", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=160934530", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=160934593", weight = 10 }
- },
- laugh = {
- { id = "http://www.roblox.com/asset/?id=129423131", weight = 10 }
- },
- cheer = {
- { id = "http://www.roblox.com/asset/?id=129423030", weight = 10 }
- },
- }
- -- Existance in this list signifies that it is an emote, the value indicates if it is a looping emote
- local emoteNames = { wave = false, point = false, dance = true, dance2 = true, dance3 = true, laugh = false, cheer = false}
- math.randomseed(tick())
- function configureAnimationSet(name, fileList)
- if (animTable[name] ~= nil) then
- for _, connection in pairs(animTable[name].connections) do
- connection:disconnect()
- end
- end
- animTable[name] = {}
- animTable[name].count = 0
- animTable[name].totalWeight = 0
- animTable[name].connections = {}
- -- check for config values
- local config = script:FindFirstChild(name)
- if (config ~= nil) then
- -- print("Loading anims " .. name)
- table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end))
- table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end))
- local idx = 1
- for _, childPart in pairs(config:GetChildren()) do
- if (childPart:IsA("Animation")) then
- table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end))
- animTable[name][idx] = {}
- animTable[name][idx].anim = childPart
- local weightObject = childPart:FindFirstChild("Weight")
- if (weightObject == nil) then
- animTable[name][idx].weight = 1
- else
- animTable[name][idx].weight = weightObject.Value
- end
- animTable[name].count = animTable[name].count + 1
- animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
- -- print(name .. " [" .. idx .. "] " .. animTable[name][idx].anim.AnimationId .. " (" .. animTable[name][idx].weight .. ")")
- idx = idx + 1
- end
- end
- end
- -- fallback to defaults
- if (animTable[name].count <= 0) then
- for idx, anim in pairs(fileList) do
- animTable[name][idx] = {}
- animTable[name][idx].anim = Instance.new("Animation")
- animTable[name][idx].anim.Name = name
- animTable[name][idx].anim.AnimationId = anim.id
- animTable[name][idx].weight = anim.weight
- animTable[name].count = animTable[name].count + 1
- animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
- -- print(name .. " [" .. idx .. "] " .. anim.id .. " (" .. anim.weight .. ")")
- end
- end
- end
- -- Setup animation objects
- function scriptChildModified(child)
- local fileList = animNames[child.Name]
- if (fileList ~= nil) then
- configureAnimationSet(child.Name, fileList)
- end
- end
- script.ChildAdded:connect(scriptChildModified)
- script.ChildRemoved:connect(scriptChildModified)
- for name, fileList in pairs(animNames) do
- configureAnimationSet(name, fileList)
- end
- -- ANIMATION
- -- declarations
- local toolAnim = "None"
- local toolAnimTime = 0
- local jumpAnimTime = 0
- local jumpAnimDuration = 0.3
- local toolTransitionTime = 0.1
- local fallTransitionTime = 0.3
- local jumpMaxLimbVelocity = 0.75
- -- functions
- function stopAllAnimations()
- local oldAnim = currentAnim
- -- return to idle if finishing an emote
- if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
- oldAnim = "idle"
- end
- currentAnim = ""
- if (currentAnimKeyframeHandler ~= nil) then
- currentAnimKeyframeHandler:disconnect()
- end
- if (currentAnimTrack ~= nil) then
- currentAnimTrack:Stop()
- currentAnimTrack:Destroy()
- currentAnimTrack = nil
- end
- return oldAnim
- end
- function setAnimationSpeed(speed)
- if speed ~= currentAnimSpeed then
- currentAnimSpeed = speed
- currentAnimTrack:AdjustSpeed(currentAnimSpeed)
- end
- end
- function keyFrameReachedFunc(frameName)
- if (frameName == "End") then
- -- print("Keyframe : ".. frameName)
- local repeatAnim = stopAllAnimations()
- local animSpeed = currentAnimSpeed
- playAnimation(repeatAnim, 0.0, Humanoid)
- setAnimationSpeed(animSpeed)
- end
- end
- -- Preload animations
- function playAnimation(animName, transitionTime, humanoid)
- local idleFromEmote = (animName == "idle" and emoteNames[currentAnim] ~= nil)
- if (animName ~= currentAnim and not idleFromEmote) then
- if (currentAnimTrack ~= nil) then
- currentAnimTrack:Stop(transitionTime)
- currentAnimTrack:Destroy()
- end
- currentAnimSpeed = 1.0
- local roll = math.random(1, animTable[animName].totalWeight)
- local origRoll = roll
- local idx = 1
- while (roll > animTable[animName][idx].weight) do
- roll = roll - animTable[animName][idx].weight
- idx = idx + 1
- end
- -- print(animName .. " " .. idx .. " [" .. origRoll .. "]")
- local anim = animTable[animName][idx].anim
- -- load it to the humanoid; get AnimationTrack
- currentAnimTrack = humanoid:LoadAnimation(anim)
- -- play the animation
- currentAnimTrack:Play(transitionTime)
- currentAnim = animName
- -- set up keyframe name triggers
- if (currentAnimKeyframeHandler ~= nil) then
- currentAnimKeyframeHandler:disconnect()
- end
- currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
- end
- end
- -------------------------------------------------------------------------------------------
- -------------------------------------------------------------------------------------------
- local toolAnimName = ""
- local toolAnimTrack = nil
- local currentToolAnimKeyframeHandler = nil
- function toolKeyFrameReachedFunc(frameName)
- if (frameName == "End") then
- -- print("Keyframe : ".. frameName)
- local repeatAnim = stopToolAnimations()
- playToolAnimation(repeatAnim, 0.0, Humanoid)
- end
- end
- function playToolAnimation(animName, transitionTime, humanoid)
- if (animName ~= toolAnimName) then
- if (toolAnimTrack ~= nil) then
- toolAnimTrack:Stop()
- toolAnimTrack:Destroy()
- transitionTime = 0
- end
- local roll = math.random(1, animTable[animName].totalWeight)
- local origRoll = roll
- local idx = 1
- while (roll > animTable[animName][idx].weight) do
- roll = roll - animTable[animName][idx].weight
- idx = idx + 1
- end
- -- print(animName .. " * " .. idx .. " [" .. origRoll .. "]")
- local anim = animTable[animName][idx].anim
- -- load it to the humanoid; get AnimationTrack
- toolAnimTrack = humanoid:LoadAnimation(anim)
- -- play the animation
- toolAnimTrack:Play(transitionTime)
- toolAnimName = animName
- currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc)
- end
- end
- function stopToolAnimations()
- local oldAnim = toolAnimName
- if (currentToolAnimKeyframeHandler ~= nil) then
- currentToolAnimKeyframeHandler:disconnect()
- end
- toolAnimName = ""
- if (toolAnimTrack ~= nil) then
- toolAnimTrack:Stop()
- toolAnimTrack:Destroy()
- toolAnimTrack = nil
- end
- return oldAnim
- end
- -------------------------------------------------------------------------------------------
- -------------------------------------------------------------------------------------------
- function onRunning(speed)
- if speed>0.01 then
- playAnimation("walk", 0.1, Humanoid)
- pose = "Running"
- else
- playAnimation("idle", 0.1, Humanoid)
- pose = "Standing"
- end
- end
- function onDied()
- pose = "Dead"
- end
- function onJumping()
- playAnimation("jump", 0.1, Humanoid)
- jumpAnimTime = jumpAnimDuration
- pose = "Jumping"
- end
- function onClimbing(speed)
- playAnimation("climb", 0.1, Humanoid)
- setAnimationSpeed(speed / 12.0)
- pose = "Climbing"
- end
- function onGettingUp()
- pose = "GettingUp"
- end
- function onFreeFall()
- if (jumpAnimTime <= 0) then
- playAnimation("fall", fallTransitionTime, Humanoid)
- end
- pose = "FreeFall"
- end
- function onFallingDown()
- pose = "FallingDown"
- end
- function onSeated()
- pose = "Seated"
- end
- function onPlatformStanding()
- pose = "PlatformStanding"
- end
- function onSwimming(speed)
- if speed>0 then
- pose = "Running"
- else
- pose = "Standing"
- end
- end
- function getTool()
- for _, kid in ipairs(Figure:GetChildren()) do
- if kid.className == "Tool" then return kid end
- end
- return nil
- end
- function getToolAnim(tool)
- for _, c in ipairs(tool:GetChildren()) do
- if c.Name == "toolanim" and c.className == "StringValue" then
- return c
- end
- end
- return nil
- end
- function animateTool()
- if (toolAnim == "None") then
- playToolAnimation("toolnone", toolTransitionTime, Humanoid)
- return
- end
- if (toolAnim == "Slash") then
- playToolAnimation("toolslash", 0, Humanoid)
- return
- end
- if (toolAnim == "Lunge") then
- playToolAnimation("toollunge", 0, Humanoid)
- return
- end
- end
- function moveSit()
- RightShoulder.MaxVelocity = 0.15
- LeftShoulder.MaxVelocity = 0.15
- RightShoulder:SetDesiredAngle(3.14 /2)
- LeftShoulder:SetDesiredAngle(-3.14 /2)
- RightHip:SetDesiredAngle(3.14 /2)
- LeftHip:SetDesiredAngle(-3.14 /2)
- end
- local lastTick = 0
- function move(time)
- local amplitude = 1
- local frequency = 1
- local deltaTime = time - lastTick
- lastTick = time
- local climbFudge = 0
- local setAngles = false
- if (jumpAnimTime > 0) then
- jumpAnimTime = jumpAnimTime - deltaTime
- end
- if (pose == "FreeFall" and jumpAnimTime <= 0) then
- playAnimation("fall", fallTransitionTime, Humanoid)
- elseif (pose == "Seated") then
- stopAllAnimations()
- moveSit()
- return
- elseif (pose == "Running") then
- playAnimation("walk", 0.1, Humanoid)
- elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
- -- print("Wha " .. pose)
- amplitude = 0.1
- frequency = 1
- setAngles = true
- end
- if (setAngles) then
- desiredAngle = amplitude * math.sin(time * frequency)
- RightShoulder:SetDesiredAngle(desiredAngle + climbFudge)
- LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge)
- RightHip:SetDesiredAngle(-desiredAngle)
- LeftHip:SetDesiredAngle(-desiredAngle)
- end
- -- Tool Animation handling
- local tool = getTool()
- if tool then
- animStringValueObject = getToolAnim(tool)
- if animStringValueObject then
- toolAnim = animStringValueObject.Value
- -- message recieved, delete StringValue
- animStringValueObject.Parent = nil
- toolAnimTime = time + .3
- end
- if time > toolAnimTime then
- toolAnimTime = 0
- toolAnim = "None"
- end
- animateTool()
- else
- stopToolAnimations()
- toolAnim = "None"
- toolAnimTime = 0
- end
- end
- -- connect events
- Humanoid.Died:connect(onDied)
- Humanoid.Running:connect(onRunning)
- Humanoid.Jumping:connect(onJumping)
- Humanoid.Climbing:connect(onClimbing)
- Humanoid.GettingUp:connect(onGettingUp)
- Humanoid.FreeFalling:connect(onFreeFall)
- Humanoid.FallingDown:connect(onFallingDown)
- Humanoid.Seated:connect(onSeated)
- Humanoid.PlatformStanding:connect(onPlatformStanding)
- Humanoid.Swimming:connect(onSwimming)
- -- setup emote chat hook
- -- main program
- local runService = game:service("RunService");
- -- initialize to idle
- playAnimation("idle", 0.1, Humanoid)
- pose = "Standing"
- while Figure.Parent~=nil do
- local _, time = wait(0.1)
- move(time)
- end
- end))
- StringValue70.Name = "climb"
- StringValue70.Parent = Script69
- Animation71.Name = "ClimbAnim"
- Animation71.Parent = StringValue70
- Animation71.AnimationId = "http://www.roblox.com/asset/?id=125750800"
- StringValue72.Name = "fall"
- StringValue72.Parent = Script69
- Animation73.Name = "FallAnim"
- Animation73.Parent = StringValue72
- Animation73.AnimationId = "http://www.roblox.com/asset/?id=125750759"
- StringValue74.Name = "idle"
- StringValue74.Parent = Script69
- Animation75.Name = "Animation1"
- Animation75.Parent = StringValue74
- Animation75.AnimationId = "http://www.roblox.com/asset/?id=125750544"
- NumberValue76.Name = "Weight"
- NumberValue76.Parent = Animation75
- NumberValue76.Value = 9
- Animation77.Name = "Animation2"
- Animation77.Parent = StringValue74
- Animation77.AnimationId = "http://www.roblox.com/asset/?id=125750618"
- NumberValue78.Name = "Weight"
- NumberValue78.Parent = Animation77
- NumberValue78.Value = 1
- StringValue79.Name = "jump"
- StringValue79.Parent = Script69
- Animation80.Name = "JumpAnim"
- Animation80.Parent = StringValue79
- Animation80.AnimationId = "http://www.roblox.com/asset/?id=125750702"
- StringValue81.Name = "run"
- StringValue81.Parent = Script69
- Animation82.Name = "RunAnim"
- Animation82.Parent = StringValue81
- Animation82.AnimationId = "http://www.roblox.com/asset/?id=125749145"
- StringValue83.Name = "toolnone"
- StringValue83.Parent = Script69
- Animation84.Name = "ToolNoneAnim"
- Animation84.Parent = StringValue83
- Animation84.AnimationId = "http://www.roblox.com/asset/?id=125750867"
- StringValue85.Name = "walk"
- StringValue85.Parent = Script69
- Animation86.Name = "WalkAnim"
- Animation86.Parent = StringValue85
- Animation86.AnimationId = "http://www.roblox.com/asset/?id=125749145"
- Part87.Name = "Head"
- Part87.Parent = Model55
- Part87.BrickColor = BrickColor.new("Cool yellow")
- Part87.Rotation = Vector3.new(0, 90, 0)
- Part87.FormFactor = Enum.FormFactor.Symmetric
- Part87.Size = Vector3.new(2, 1, 1)
- Part87.CFrame = CFrame.new(8.79734039, 4.45095634, -13.1970339, 0.000532949809, -0.000846050854, 1.00000048, 7.0162085e-09, 0.999999642, 0.000846053765, -1.00000155, -4.46565792e-07, 0.000533248123)
- Part87.BottomSurface = Enum.SurfaceType.Smooth
- Part87.TopSurface = Enum.SurfaceType.Smooth
- Part87.Color = Color3.new(0.992157, 0.917647, 0.552941)
- Part87.Position = Vector3.new(8.79734039, 4.45095634, -13.1970339)
- Part87.Orientation = Vector3.new(-0.049999997, 89.9700012, 0)
- Part87.Color = Color3.new(0.992157, 0.917647, 0.552941)
- SpecialMesh88.Parent = Part87
- SpecialMesh88.Scale = Vector3.new(1.25, 1.25, 1.25)
- SpecialMesh88.Scale = Vector3.new(1.25, 1.25, 1.25)
- Decal89.Parent = Part87
- Decal89.Texture = "http://www.roblox.com/asset/?id=134724710"
- Part90.Name = "Right Arm"
- Part90.Parent = Model55
- Part90.BrickColor = BrickColor.new("Cool yellow")
- Part90.Rotation = Vector3.new(0, 90, 0)
- Part90.CanCollide = false
- Part90.FormFactor = Enum.FormFactor.Symmetric
- Part90.Size = Vector3.new(1, 2, 1)
- Part90.CFrame = CFrame.new(8.79940891, 2.95095706, -14.6970348, 0.000532949809, -0.000846050738, 1.00000048, 7.0162085e-09, 0.999999523, 0.000846053765, -1.00000155, -4.46565736e-07, 0.000533248123)
- Part90.BottomSurface = Enum.SurfaceType.Smooth
- Part90.TopSurface = Enum.SurfaceType.Smooth
- Part90.Color = Color3.new(0.992157, 0.917647, 0.552941)
- Part90.Position = Vector3.new(8.79940891, 2.95095706, -14.6970348)
- Part90.Orientation = Vector3.new(-0.049999997, 89.9700012, 0)
- Part90.Color = Color3.new(0.992157, 0.917647, 0.552941)
- Part91.Name = "Left Arm"
- Part91.Parent = Model55
- Part91.BrickColor = BrickColor.new("Cool yellow")
- Part91.Rotation = Vector3.new(0, 90, 0)
- Part91.CanCollide = false
- Part91.FormFactor = Enum.FormFactor.Symmetric
- Part91.Size = Vector3.new(1, 2, 1)
- Part91.CFrame = CFrame.new(8.79781055, 2.95095706, -11.697031, 0.000532949809, -0.000846050738, 1.00000048, 7.0162085e-09, 0.999999523, 0.000846053765, -1.00000155, -4.46565736e-07, 0.000533248123)
- Part91.BottomSurface = Enum.SurfaceType.Smooth
- Part91.TopSurface = Enum.SurfaceType.Smooth
- Part91.Color = Color3.new(0.992157, 0.917647, 0.552941)
- Part91.Position = Vector3.new(8.79781055, 2.95095706, -11.697031)
- Part91.Orientation = Vector3.new(-0.049999997, 89.9700012, 0)
- Part91.Color = Color3.new(0.992157, 0.917647, 0.552941)
- Part92.Name = "Right Leg"
- Part92.Parent = Model55
- Part92.BrickColor = BrickColor.new("Bright blue")
- Part92.Rotation = Vector3.new(0, 90, 0)
- Part92.CanCollide = false
- Part92.FormFactor = Enum.FormFactor.Symmetric
- Part92.Size = Vector3.new(1, 2, 1)
- Part92.CFrame = CFrame.new(8.80056858, 0.950957894, -13.6970329, 0.000532949809, -0.000846050738, 1.00000048, 7.0162085e-09, 0.999999523, 0.000846053765, -1.00000155, -4.46565736e-07, 0.000533248123)
- Part92.BottomSurface = Enum.SurfaceType.Smooth
- Part92.TopSurface = Enum.SurfaceType.Smooth
- Part92.Color = Color3.new(0.0509804, 0.411765, 0.67451)
- Part92.Position = Vector3.new(8.80056858, 0.950957894, -13.6970329)
- Part92.Orientation = Vector3.new(-0.049999997, 89.9700012, 0)
- Part92.Color = Color3.new(0.0509804, 0.411765, 0.67451)
- Part93.Name = "Left Leg"
- Part93.Parent = Model55
- Part93.BrickColor = BrickColor.new("Bright blue")
- Part93.Rotation = Vector3.new(0, 90, 0)
- Part93.CanCollide = false
- Part93.FormFactor = Enum.FormFactor.Symmetric
- Part93.Size = Vector3.new(1, 2, 1)
- Part93.CFrame = CFrame.new(8.80003548, 0.950957894, -12.697031, 0.000532949809, -0.000846050738, 1.00000048, 7.0162085e-09, 0.999999523, 0.000846053765, -1.00000155, -4.46565736e-07, 0.000533248123)
- Part93.BottomSurface = Enum.SurfaceType.Smooth
- Part93.TopSurface = Enum.SurfaceType.Smooth
- Part93.Color = Color3.new(0.0509804, 0.411765, 0.67451)
- Part93.Position = Vector3.new(8.80003548, 0.950957894, -12.697031)
- Part93.Orientation = Vector3.new(-0.049999997, 89.9700012, 0)
- Part93.Color = Color3.new(0.0509804, 0.411765, 0.67451)
- Part94.Name = "Torso"
- Part94.Parent = Model55
- Part94.BrickColor = BrickColor.new("Dark green")
- Part94.Rotation = Vector3.new(0, 90, 0)
- Part94.CanCollide = false
- Part94.FormFactor = Enum.FormFactor.Symmetric
- Part94.Size = Vector3.new(2, 2, 1)
- Part94.CFrame = CFrame.new(8.79860973, 2.95095706, -13.1970329, 0.000532949809, -0.000846050854, 1.00000048, 7.0162085e-09, 0.999999642, 0.000846053765, -1.00000155, -4.46565792e-07, 0.000533248123)
- Part94.BottomSurface = Enum.SurfaceType.Smooth
- Part94.TopSurface = Enum.SurfaceType.Smooth
- Part94.Color = Color3.new(0.156863, 0.498039, 0.278431)
- Part94.Position = Vector3.new(8.79860973, 2.95095706, -13.1970329)
- Part94.Orientation = Vector3.new(-0.049999997, 89.9700012, 0)
- Part94.Color = Color3.new(0.156863, 0.498039, 0.278431)
- Sound95.Name = "HitSound"
- Sound95.Parent = Part94
- Sound95.SoundId = "http://www.roblox.com/asset/?id=93591808"
- Motor6D96.Name = "Left Hip"
- Motor6D96.Parent = Part94
- Motor6D96.C0 = CFrame.new(-1, -1, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08)
- Motor6D96.C1 = CFrame.new(-0.5, 1, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08)
- Motor6D96.Part0 = Part94
- Motor6D96.Part1 = Part93
- Motor6D96.MaxVelocity = 0.10000000149012
- Motor6D97.Name = "Right Hip"
- Motor6D97.Parent = Part94
- Motor6D97.C0 = CFrame.new(1, -1, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08)
- Motor6D97.C1 = CFrame.new(0.5, 1, 0, -4.37113883e-08, 0, 1, 0, 0.99999994, 0, -1, 0, -4.37113883e-08)
- Motor6D97.Part0 = Part94
- Motor6D97.Part1 = Part92
- Motor6D97.MaxVelocity = 0.10000000149012
- Motor6D98.Name = "Left Shoulder"
- Motor6D98.Parent = Part94
- Motor6D98.C0 = CFrame.new(-1, 0.5, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08)
- Motor6D98.C1 = CFrame.new(0.5, 0.5, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08)
- Motor6D98.Part0 = Part94
- Motor6D98.Part1 = Part91
- Motor6D98.MaxVelocity = 0.10000000149012
- Motor6D99.Name = "Right Shoulder"
- Motor6D99.Parent = Part94
- Motor6D99.C0 = CFrame.new(1, 0.5, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08)
- Motor6D99.C1 = CFrame.new(-0.5, 0.5, 0, -4.37113883e-08, 0, 1, 0, 0.99999994, 0, -1, 0, -4.37113883e-08)
- Motor6D99.Part0 = Part94
- Motor6D99.Part1 = Part90
- Motor6D99.MaxVelocity = 0.10000000149012
- Motor6D100.Name = "Neck"
- Motor6D100.Parent = Part94
- Motor6D100.C0 = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Motor6D100.C1 = CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Motor6D100.Part0 = Part94
- Motor6D100.Part1 = Part87
- Motor6D100.MaxVelocity = 0.10000000149012
- Part101.Name = "HumanoidRootPart"
- Part101.Parent = Model55
- Part101.Transparency = 1
- Part101.Rotation = Vector3.new(0, 90, 0)
- Part101.FormFactor = Enum.FormFactor.Symmetric
- Part101.Size = Vector3.new(2, 2, 1)
- Part101.CFrame = CFrame.new(8.79860973, 2.95095706, -13.1970329, 0.000532949809, -0.000846050854, 1.00000048, 7.0162085e-09, 0.999999642, 0.000846053765, -1.00000155, -4.46565792e-07, 0.000533248123)
- Part101.BottomSurface = Enum.SurfaceType.Smooth
- Part101.TopSurface = Enum.SurfaceType.Smooth
- Part101.Position = Vector3.new(8.79860973, 2.95095706, -13.1970329)
- Part101.Orientation = Vector3.new(-0.049999997, 89.9700012, 0)
- Motor6D102.Name = "Root Hip"
- Motor6D102.Parent = Part101
- Motor6D102.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Motor6D102.C1 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Motor6D102.Part0 = Part101
- Motor6D102.Part1 = Part94
- Motor6D102.MaxVelocity = 0.10000000149012
- Script103.Name = "READ ME"
- Script103.Parent = Model55
- table.insert(cors,sandbox(Script103,function()
- --- Please support and like and fav. Zombie wars for more updates.
- ---THANK YOU
- --YUANRAVIEH190
- end))
- Part104.Name = "MonsterSpawn"
- Part104.Parent = Model54
- Part104.Material = Enum.Material.Neon
- Part104.BrickColor = BrickColor.new("Reddish brown")
- Part104.Rotation = Vector3.new(0, 90, 0)
- Part104.Anchored = true
- Part104.CanCollide = false
- Part104.FormFactor = Enum.FormFactor.Custom
- Part104.Size = Vector3.new(6, 0.200000003, 6)
- Part104.CFrame = CFrame.new(8.40017128, -0.149426997, -13.2067986, -1.94256427e-06, 2.03144737e-08, 1.00000048, 1.57338604e-08, 0.999990463, -3.37604433e-09, -1.00000083, 1.46186778e-08, -1.79343624e-06)
- Part104.BottomSurface = Enum.SurfaceType.Smooth
- Part104.TopSurface = Enum.SurfaceType.Smooth
- Part104.Color = Color3.new(0.411765, 0.25098, 0.156863)
- Part104.Position = Vector3.new(8.40017128, -0.149426997, -13.2067986)
- Part104.Orientation = Vector3.new(0, 90, 0)
- Part104.Color = Color3.new(0.411765, 0.25098, 0.156863)
- Decal105.Parent = Part104
- Decal105.Texture = "http://www.roblox.com/asset/?id=134724710"
- Decal105.Face = Enum.NormalId.Top
- Script106.Parent = Part104
- table.insert(cors,sandbox(Script106,function()
- zombie = script.Parent.Parent.Zombie
- zombiebackup = zombie:Clone()
- zombie:remove()
- while true do
- wait(5)
- local newzombie = zombiebackup:Clone()
- newzombie.Parent = game.Workspace
- newzombie:MakeJoints()
- newzombie.Torso.CFrame = script.Parent.CFrame + Vector3.new(0, 5, 0)
- newzombie:MakeJoints()
- zombie = newzombie
- zombiebackup = zombie:Clone()
- end
- end))
- ManualWeld107.Name = "MonsterSpawn-to-MonsterSpawn Strong Joint"
- ManualWeld107.Parent = Part104
- ManualWeld107.C0 = CFrame.new(3, -0.100000001, 3, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- ManualWeld107.C1 = CFrame.new(-3, -0.100000001, 3, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- ManualWeld107.Part0 = Part104
- Model108.Parent = mas
- Model109.Name = "Zombie"
- Model109.Parent = Model108
- Script110.Name = "Ragdoller"
- Script110.Parent = Model109
- table.insert(cors,sandbox(Script110,function()
- print("Ragdoll script activated")
- Gibs = game.Workspace
- function getKillerOfHumanoidIfStillInGame(humanoid)
- local tag = humanoid:findFirstChild("creator")
- if tag ~= nil then
- local killer = tag.Value
- if killer.Parent ~= nil then
- return killer
- end
- end
- return nil
- end
- function OnDeath(Character)
- local svch = Character
- local hum = Character:findFirstChild("Humanoid")
- local getkiller = getKillerOfHumanoidIfStillInGame(hum)
- Character.Archivable = true
- local chrclone = Character:clone()
- Character.Archivable = false
- local ch = chrclone:GetChildren()
- local i
- for i = 1,#ch do
- if ch[i].Name == "THandle1" or ch[i].Name == "THandle2" or ch[i].ClassName == "Script" then
- ch[i]:remove()
- end
- end
- local function Scan(ch)
- local e
- for e = 1,#ch do
- Scan(ch[e]:GetChildren())
- if ch[e].ClassName == "Weld" or ch[e].ClassName == "Motor6D" then
- ch[e]:remove()
- end
- end
- end
- Scan(chrclone:GetChildren())
- local hum2 = chrclone:findFirstChild("Humanoid")
- if hum2 ~= nil then
- hum2.Name = "Humanoid2"
- hum2.PlatformStand = true
- hum2.Sit = true
- hum2.MaxHealth = 0
- hum2.Health = 0
- end
- local ch = Character:GetChildren()
- local i
- for i = 1,#ch do
- if ch[i].Name == "THandle1" or ch[i].Name == "THandle2" then
- ch[i]:remove()
- end
- end
- wait(0.2)
- local ch = Character:GetChildren()
- local i
- for i = 1,#ch do
- if ch[i].ClassName == "Part" or ch[i].ClassName == "Hat" or ch[i].Name == "THandle1" or ch[i].Name == "THandle2" then
- ch[i]:remove()
- end
- end
- Character = chrclone
- local Torso = Character.Torso
- local movevector = Vector3.new()
- if Torso then
- if getkiller ~= nil then
- if getkiller.Character ~= nil then
- local killtors = getkiller.Character:findFirstChild("Torso")
- if killtors ~= nil then
- movevector = CFrame.new(killtors.Position,Torso.Position).lookVector
- end
- end
- end
- local Head = Character:FindFirstChild("Head")
- if Head then
- local Neck = Instance.new("Weld")
- Neck.Name = "Neck"
- Neck.Part0 = Torso
- Neck.Part1 = Head
- Neck.C0 = CFrame.new(0, 1.5, 0)
- Neck.C1 = CFrame.new()
- Neck.Parent = Torso
- local nsc = script.CamAttach:clone()
- nsc.CamPart.Value = hum2.Parent.Head
- nsc.Disabled = false
- nsc.Parent = svch
- end
- local Limb = Character:FindFirstChild("Right Arm")
- if Limb then
- Limb.CFrame = Torso.CFrame * CFrame.new(1.5, 0, 0)
- local Joint = Instance.new("Glue")
- Joint.Name = "RightShoulder"
- Joint.Part0 = Torso
- Joint.Part1 = Limb
- Joint.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- Joint.C1 = CFrame.new(-0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- Joint.Parent = Torso
- local B = Instance.new("Part")
- B.TopSurface = 0
- B.BottomSurface = 0
- B.formFactor = "Symmetric"
- B.Size = Vector3.new(1, 1, 1)
- B.Transparency = 1
- B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
- B.Parent = Character
- local W = Instance.new("Weld")
- W.Part0 = Limb
- W.Part1 = B
- W.C0 = CFrame.new(0, -0.5, 0)
- W.Parent = Limb
- end
- local Limb = Character:FindFirstChild("Left Arm")
- if Limb then
- Limb.CFrame = Torso.CFrame * CFrame.new(-1.5, 0, 0)
- local Joint = Instance.new("Glue")
- Joint.Name = "LeftShoulder"
- Joint.Part0 = Torso
- Joint.Part1 = Limb
- Joint.C0 = CFrame.new(-1.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- Joint.C1 = CFrame.new(0, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- Joint.Parent = Torso
- local B = Instance.new("Part")
- B.TopSurface = 0
- B.BottomSurface = 0
- B.formFactor = "Symmetric"
- B.Size = Vector3.new(1, 1, 1)
- B.Transparency = 1
- B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
- B.Parent = Character
- local W = Instance.new("Weld")
- W.Part0 = Limb
- W.Part1 = B
- W.C0 = CFrame.new(0, -0.5, 0)
- W.Parent = Limb
- end
- local Limb = Character:FindFirstChild("Right Leg")
- if Limb then
- Limb.CFrame = Torso.CFrame * CFrame.new(0.5, -2, 0)
- local Joint = Instance.new("Glue")
- Joint.Name = "RightHip"
- Joint.Part0 = Torso
- Joint.Part1 = Limb
- Joint.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- Joint.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- Joint.Parent = Torso
- local B = Instance.new("Part")
- B.TopSurface = 0
- B.BottomSurface = 0
- B.formFactor = "Symmetric"
- B.Size = Vector3.new(1, 1, 1)
- B.Transparency = 1
- B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
- B.Parent = Character
- local W = Instance.new("Weld")
- W.Part0 = Limb
- W.Part1 = B
- W.C0 = CFrame.new(0, -0.5, 0)
- W.Parent = Limb
- end
- local Limb = Character:FindFirstChild("Left Leg")
- if Limb then
- Limb.CFrame = Torso.CFrame * CFrame.new(-0.5, -2, 0)
- local Joint = Instance.new("Glue")
- Joint.Name = "LeftHip"
- Joint.Part0 = Torso
- Joint.Part1 = Limb
- Joint.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- Joint.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- Joint.Parent = Torso
- local B = Instance.new("Part")
- B.TopSurface = 0
- B.BottomSurface = 0
- B.formFactor = "Symmetric"
- B.Size = Vector3.new(1, 1, 1)
- B.Transparency = 1
- B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
- B.Parent = Character
- local W = Instance.new("Weld")
- W.Part0 = Limb
- W.Part1 = B
- W.C0 = CFrame.new(0, -0.5, 0)
- W.Parent = Limb
- end
- --[
- local Bar = Instance.new("Part")
- Bar.TopSurface = 0
- Bar.BottomSurface = 0
- Bar.formFactor = "Symmetric"
- Bar.Size = Vector3.new(1, 1, 1)
- Bar.Transparency = 1
- Bar.CFrame = Torso.CFrame * CFrame.new(0, 0.5, 0)
- Bar.Parent = Character
- local Weld = Instance.new("Weld")
- Weld.Part0 = Torso
- Weld.Part1 = Bar
- Weld.C0 = CFrame.new(0, 0.5, 0)
- Weld.Parent = Torso
- --]]
- end
- Character.Parent = Gibs
- game.Debris:AddItem(Character, 12)
- if movevector ~= Vector3.new() then
- for i = 1,10 do
- wait()
- Torso.Velocity = movevector * 30
- end
- end
- end
- script.Parent.Humanoid.Died:connect(function()
- OnDeath(script.Parent)
- end)
- end))
- LocalScript111.Name = "CamAttach"
- LocalScript111.Parent = Script110
- LocalScript111.Disabled = true
- table.insert(cors,sandbox(LocalScript111,function()
- wait()
- game.Workspace.CurrentCamera.CameraSubject = script.CamPart.Value
- end))
- ObjectValue112.Name = "CamPart"
- ObjectValue112.Parent = LocalScript111
- Script113.Name = "ZombieScript"
- Script113.Parent = Model109
- table.insert(cors,sandbox(Script113,function()
- wait()
- -- Handles damage, sounds
- local hum = script.Parent:FindFirstChild("Humanoid")
- local torso = script.Parent:FindFirstChild("HumanoidRootPart")
- local head = script.Parent:FindFirstChild("Head")
- DB = false
- local function onTouch(hit)
- if DB then return end
- if hit == nil then return end
- if hit.Parent == nil then return end
- local vhum = hit.Parent:FindFirstChild("Humanoid")
- if vhum ~= nil then
- if hum.Health <= 0 then return end
- if vhum ~= hum and not hit.Parent:FindFirstChild("ZombieScript") then -- keeps it from hurting itself/ zombies
- vhum:TakeDamage(math.random(6, 9))
- DB = true
- wait(1)
- DB = false
- end
- end
- end
- torso.Touched:connect(onTouch)
- local zombienoises = {93591696, 208668860, 179266532, 229895387, 150076506}
- local moan = head:FindFirstChild("Moan")
- while head ~= nil do
- wait(math.random(6, 13))
- moan.Pitch = math.random(8, 10)/10
- moan.SoundId = "rbxassetid://"..tostring(zombienoises[math.random(1, #zombienoises)])
- moan:Play()
- end
- end))
- Script114.Name = "Follow"
- Script114.Parent = Model109
- table.insert(cors,sandbox(Script114,function()
- wait()
- local hum = script.Parent:FindFirstChild("Humanoid")
- local torso = script.Parent:FindFirstChild("HumanoidRootPart")
- local max_dist = 200
- function findNearestTorso()
- for _, player in pairs(game.Players:GetPlayers()) do
- if player.Character ~= nil then
- local target_torso = player.Character:FindFirstChild("HumanoidRootPart")
- if target_torso ~= nil then
- if (target_torso.Position - torso.Position).magnitude < max_dist then
- return target_torso
- end
- end
- end
- end
- end
- local old_pos = torso.Position
- wait(math.random(0, 90)/100)
- while hum ~= nil do
- local target = findNearestTorso()
- if target ~= nil then
- while target ~= nil and target.Parent ~= nil and hum ~= nil do
- if (target.Position - torso.Position).magnitude < max_dist then
- hum:MoveTo(target.Position, target)
- if target.Position.Y > torso.Position.Y + 3 then
- hum.Jump = true
- end
- if (old_pos - torso.Position).magnitude < 0.5 then
- if math.random(1, 3) == 1 then
- torso.Velocity = torso.CFrame.lookVector * -40
- hum:MoveTo(torso.Position + Vector3.new(math.random(-1, 1), 0, math.random(-1, 1))*20)
- wait(1.2)
- else
- hum.Jump = true
- hum:MoveTo(target.Position, target)
- end
- end
- else break end
- old_pos = torso.Position
- wait(0.5)
- end
- end
- wait(4)
- end
- end))
- Script115.Name = "Die"
- Script115.Parent = Model109
- table.insert(cors,sandbox(Script115,function()
- human = script.Parent.Humanoid
- --tool = script.Parent.Pistol
- function Die()
- --if tool ~= nil then tool:remove() end
- game.workspace.Scripts.WaveScript.Dead_Zombies.Value = game.workspace.Scripts.WaveScript.Dead_Zombies.Value + 1
- wait(2.5)
- script.Parent:remove()
- end
- human.Died:connect(Die)
- end))
- Script116.Name = "ZombieScript"
- Script116.Parent = Model109
- table.insert(cors,sandbox(Script116,function()
- --Made by Stickmasterluke
- --Zombie artificial stupidity script
- sp=script.Parent
- lastattack=0
- nextrandom=0
- nextsound=0
- nextjump=0
- chasing=false
- variance=4
- damage=10
- attackrange=4.5
- sightrange=999--60
- runspeed=10
- wonderspeed=8
- healthregen=false
- colors={"Sand red","Dusty Rose","Medium blue","Sand blue","Lavender","Earth green","Brown","Medium stone grey","Brick yellow"}
- function raycast(spos,vec,currentdist)
- local hit2,pos2=game.Workspace:FindPartOnRay(Ray.new(spos+(vec*.01),vec*currentdist),script.Parent)
- if hit2~=nil and pos2 then
- if hit2.Parent==script.Parent and hit2.Transparency>=.8 or hit2.Name=="Handle" or string.sub(hit2.Name,1,6)=="Effect" or hit2.Parent:IsA("Hat") or hit2.Parent:IsA("Tool") or (hit2.Parent:FindFirstChild("Humanoid") and hit2.Parent:FindFirstChild("TEAM") and hit2.Parent:FindFirstChild("TEAM").Value == script.Parent.TEAM.Value) or (not hit2.Parent:FindFirstChild("Humanoid") and hit2.CanCollide==false) then
- local currentdist=currentdist-(pos2-spos).magnitude
- return raycast(pos2,vec,currentdist)
- end
- end
- return hit2,pos2
- end
- function waitForChild(parent,childName)
- local child=parent:findFirstChild(childName)
- if child then return child end
- while true do
- child=parent.ChildAdded:wait()
- if child.Name==childName then return child end
- end
- end
- -- ANIMATION
- -- declarations
- local Torso=waitForChild(sp,"Torso")
- local Head=waitForChild(sp,"Head")
- local RightShoulder=waitForChild(Torso,"Right Shoulder")
- local LeftShoulder=waitForChild(Torso,"Left Shoulder")
- local RightHip=waitForChild(Torso,"Right Hip")
- local LeftHip=waitForChild(Torso,"Left Hip")
- local Neck=waitForChild(Torso,"Neck")
- local Humanoid=waitForChild(sp,"Humanoid")
- local BodyColors=waitForChild(sp,"Body Colors")
- local pose="Standing"
- local hitsound=waitForChild(Torso,"HitSound")
- local Anim = Humanoid:LoadAnimation(sp.AttackAnim)
- --[[local sounds={
- waitForChild(Torso,"GroanSound"),
- waitForChild(Torso,"RawrSound")
- }]]
- if healthregen then
- local regenscript=waitForChild(sp,"HealthRegenerationScript")
- regenscript.Disabled=false
- end
- Humanoid.WalkSpeed=wonderspeed
- local toolAnim="None"
- local toolAnimTime=0
- --[[BodyColors.HeadColor=BrickColor.new("Grime")
- local randomcolor1=colors[math.random(1,#colors)]
- BodyColors.TorsoColor=BrickColor.new(randomcolor1)
- BodyColors.LeftArmColor=BrickColor.new(randomcolor1)
- BodyColors.RightArmColor=BrickColor.new(randomcolor1)
- local randomcolor2=colors[math.random(1,#colors)]
- BodyColors.LeftLegColor=BrickColor.new(randomcolor2)
- BodyColors.RightLegColor=BrickColor.new(randomcolor2)]]
- function onRunning(speed)
- if speed>0 then
- pose="Running"
- else
- pose="Standing"
- end
- end
- function onDied()
- pose="Dead"
- end
- function onJumping()
- pose="Jumping"
- end
- function onClimbing()
- pose="Climbing"
- end
- function onGettingUp()
- pose = "GettingUp"
- end
- function onFreeFall()
- pose = "FreeFall"
- end
- function onFallingDown()
- pose = "FallingDown"
- end
- function onSeated()
- pose = "Seated"
- end
- function onPlatformStanding()
- pose = "PlatformStanding"
- end
- function moveJump()
- RightShoulder.MaxVelocity = 0.5
- LeftShoulder.MaxVelocity = 0.5
- RightShoulder.DesiredAngle=3.14
- LeftShoulder.DesiredAngle=-3.14
- RightHip.DesiredAngle=0
- LeftHip.DesiredAngle=0
- end
- function moveFreeFall()
- RightShoulder.MaxVelocity = 0.5
- LeftShoulder.MaxVelocity =0.5
- RightShoulder.DesiredAngle=3.14
- LeftShoulder.DesiredAngle=-3.14
- RightHip.DesiredAngle=0
- LeftHip.DesiredAngle=0
- end
- function moveSit()
- RightShoulder.MaxVelocity = 0.15
- LeftShoulder.MaxVelocity = 0.15
- RightShoulder.DesiredAngle=3.14 /2
- LeftShoulder.DesiredAngle=-3.14 /2
- RightHip.DesiredAngle=3.14 /2
- LeftHip.DesiredAngle=-3.14 /2
- end
- function animate(time)
- local amplitude
- local frequency
- if (pose == "Jumping") then
- moveJump()
- return
- end
- if (pose == "FreeFall") then
- moveFreeFall()
- return
- end
- if (pose == "Seated") then
- moveSit()
- return
- end
- local climbFudge = 0
- if (pose == "Running") then
- RightShoulder.MaxVelocity = 0.15
- LeftShoulder.MaxVelocity = 0.15
- amplitude = 1
- frequency = 9
- elseif (pose == "Climbing") then
- RightShoulder.MaxVelocity = 0.5
- LeftShoulder.MaxVelocity = 0.5
- amplitude = 1
- frequency = 9
- climbFudge = 3.14
- else
- amplitude = 0.1
- frequency = 1
- end
- desiredAngle = amplitude * math.sin(time*frequency)
- if not chasing and frequency==9 then
- frequency=4
- end
- if chasing then
- --[[RightShoulder.DesiredAngle=math.pi/2
- LeftShoulder.DesiredAngle=-math.pi/2
- RightHip.DesiredAngle=-desiredAngle*2
- LeftHip.DesiredAngle=-desiredAngle*2]]
- else
- RightShoulder.DesiredAngle=desiredAngle + climbFudge
- LeftShoulder.DesiredAngle=desiredAngle - climbFudge
- RightHip.DesiredAngle=-desiredAngle
- LeftHip.DesiredAngle=-desiredAngle
- end
- end
- function attack(time,attackpos)
- if time-lastattack>=0.25 then
- local hit,pos=raycast(Torso.Position,(attackpos-Torso.Position).unit,attackrange)
- if hit and hit.Parent~=nil then
- local h=hit.Parent:FindFirstChild("Humanoid")
- local TEAM=hit.Parent:FindFirstChild("TEAM")
- if h and TEAM and TEAM.Value~=sp.TEAM.Value then
- local creator=sp:FindFirstChild("creator")
- if creator then
- if creator.Value~=nil then
- if creator.Value~=game.Players:GetPlayerFromCharacter(h.Parent) then
- for i,oldtag in ipairs(h:GetChildren()) do
- if oldtag.Name=="creator" then
- oldtag:remove()
- end
- end
- creator:clone().Parent=h
- else
- return
- end
- end
- end
- if Anim then Anim:Play(nil,nil,1.5) end
- h:TakeDamage(damage)
- hitsound.Volume=1
- hitsound.Pitch=.75+(math.random()*.5)
- hitsound:Play()
- --[[if RightShoulder and LeftShoulder then
- RightShoulder.CurrentAngle=0
- LeftShoulder.CurrentAngle=0
- end]]
- end
- end
- lastattack=time
- end
- end
- Humanoid.Died:connect(onDied)
- Humanoid.Running:connect(onRunning)
- Humanoid.Jumping:connect(onJumping)
- Humanoid.Climbing:connect(onClimbing)
- Humanoid.GettingUp:connect(onGettingUp)
- Humanoid.FreeFalling:connect(onFreeFall)
- Humanoid.FallingDown:connect(onFallingDown)
- Humanoid.Seated:connect(onSeated)
- Humanoid.PlatformStanding:connect(onPlatformStanding)
- function populatehumanoids(mdl)
- if mdl.ClassName=="Humanoid" then
- if mdl.Parent:FindFirstChild("TEAM") and mdl.Parent:FindFirstChild("TEAM").Value~=sp.TEAM.Value then
- table.insert(humanoids,mdl)
- end
- end
- for i2,mdl2 in ipairs(mdl:GetChildren()) do
- populatehumanoids(mdl2)
- end
- end
- --[[function playsound(time)
- nextsound=time+5+(math.random()*5)
- local randomsound=sounds[math.random(1,#sounds)]
- randomsound.Volume=.5+(.5*math.random())
- randomsound.Pitch=.5+(.5*math.random())
- randomsound:Play()
- end]]
- while sp.Parent~=nil and Humanoid and Humanoid.Parent~=nil and Humanoid.Health>0 and Torso and Head and Torso~=nil and Torso.Parent~=nil do
- local _,time=wait(0.25)--wait(1/3)
- humanoids={}
- populatehumanoids(game.Workspace)
- closesttarget=nil
- closestdist=sightrange
- local creator=sp:FindFirstChild("creator")
- for i,h in ipairs(humanoids) do
- if h and h.Parent~=nil then
- if h.Health>0 and h.Parent~=sp then
- local plr=game.Players:GetPlayerFromCharacter(h.Parent)
- if creator==nil or plr==nil or creator.Value~=plr then
- local t=h.Parent:FindFirstChild("Torso")
- if t~=nil then
- local dist=(t.Position-Torso.Position).magnitude
- if dist<closestdist then
- closestdist=dist
- closesttarget=t
- end
- end
- end
- end
- end
- end
- if closesttarget~=nil then
- if not chasing then
- --playsound(time)
- chasing=true
- Humanoid.WalkSpeed=runspeed
- end
- Humanoid:MoveTo(closesttarget.Position+(Vector3.new(1,1,1)*(variance*((math.random()*2)-1))),closesttarget)
- if math.random()<.5 then
- attack(time,closesttarget.Position)
- end
- else
- if chasing then
- chasing=false
- Humanoid.WalkSpeed=wonderspeed
- end
- if time>nextrandom then
- nextrandom=time+3+(math.random()*5)
- local randompos=Torso.Position+((Vector3.new(1,1,1)*math.random()-Vector3.new(.5,.5,.5))*40)
- Humanoid:MoveTo(randompos,game.Workspace.Terrain)
- end
- end
- if time>nextsound then
- --playsound(time)
- end
- if time>nextjump then
- nextjump=time+7+(math.random()*5)
- Humanoid.Jump=true
- end
- animate(time)
- end
- wait(4)
- sp:remove() --Rest In Pizza
- end))
- Animation117.Name = "AttackAnim"
- Animation117.Parent = Model109
- Animation117.AnimationId = "http://www.roblox.com/Asset?ID=105211514"
- BodyColors118.Parent = Model109
- BodyColors118.HeadColor = BrickColor.new("Medium green")
- BodyColors118.LeftArmColor = BrickColor.new("Medium green")
- BodyColors118.LeftLegColor = BrickColor.new("Reddish brown")
- BodyColors118.RightArmColor = BrickColor.new("Medium green")
- BodyColors118.RightLegColor = BrickColor.new("Reddish brown")
- BodyColors118.TorsoColor = BrickColor.new("Reddish brown")
- BrickColorValue119.Name = "TEAM"
- BrickColorValue119.Parent = Model109
- BrickColorValue119.Value = BrickColor.new("Bright green")
- Script120.Name = "Sound"
- Script120.Parent = Model109
- table.insert(cors,sandbox(Script120,function()
- -- util
- function waitForChild(parent, childName)
- local child = parent:findFirstChild(childName)
- if child then return child end
- while true do
- child = parent.ChildAdded:wait()
- if child.Name==childName then return child end
- end
- end
- function newSound(id)
- local sound = Instance.new("Sound")
- sound.SoundId = id
- sound.archivable = false
- sound.Parent = script.Parent.Head
- return sound
- end
- -- declarations
- local sDied = newSound("rbxasset://sounds/uuhhh.wav")
- sDied.Pitch = 0.75
- local sFallingDown = newSound("rbxasset://sounds/splat.wav")
- local sFreeFalling = newSound("rbxasset://sounds/swoosh.wav")
- local sGettingUp = newSound("rbxasset://sounds/hit.wav")
- local sJumping = newSound("rbxasset://sounds/button.wav")
- local sRunning = newSound("rbxasset://sounds/bfsl-minifigfoots1.mp3")
- sRunning.Looped = true
- local Figure = script.Parent
- local Head = waitForChild(Figure, "Head")
- local Humanoid = waitForChild(Figure, "Humanoid")
- -- functions
- function onDied()
- sDied:Play()
- wait(2.5)
- script.Parent:Destroy()
- end
- function onState(state, sound)
- if state then
- sound:Play()
- else
- sound:Pause()
- end
- end
- function onRunning(speed)
- if speed>0 then
- sRunning:Play()
- else
- sRunning:Pause()
- end
- end
- -- connect up
- Humanoid.Died:connect(onDied)
- Humanoid.Running:connect(onRunning)
- Humanoid.Jumping:connect(function(state) onState(state, sJumping) end)
- Humanoid.GettingUp:connect(function(state) onState(state, sGettingUp) end)
- Humanoid.FreeFalling:connect(function(state) onState(state, sFreeFalling) end)
- Humanoid.FallingDown:connect(function(state) onState(state, sFallingDown) end)
- end))
- Humanoid121.Parent = Model109
- Humanoid121.RightLeg = Part146
- Humanoid121.LeftLeg = Part147
- Humanoid121.Torso = Part155
- Script122.Name = "HealthRegenerationScript"
- Script122.Parent = Model109
- Script122.Disabled = true
- table.insert(cors,sandbox(Script122,function()
- -- Renegeration Script for the bot
- -- Renegerates about 1% of max hp per second until it reaches max health
- bot = script.Parent
- Humanoid = bot:FindFirstChild("Humanoid")
- local regen = false
- function regenerate()
- if regen then return end
- -- Lock this function until the regeneration to max health is complete by using a boolean toggle
- regen = true
- while Humanoid.Health < Humanoid.MaxHealth do
- local delta = wait(1)
- local health = Humanoid.Health
- if health > 0 and health < Humanoid.MaxHealth then
- -- This delta is for regenerating 1% of max hp per second instead of 1 hp per second
- delta = 0.01 * delta * Humanoid.MaxHealth
- health = health + delta
- Humanoid.Health = math.min(health, Humanoid.MaxHealth)
- end
- end
- -- release the lock, since the health is at max now, and if the character loses health again
- -- it needs to start regenerating
- regen = false
- end
- if Humanoid then
- -- Better than a while true do loop since it only fires when the health actually changes
- Humanoid.HealthChanged:connect(regenerate)
- end
- end))
- Script123.Name = "Animate"
- Script123.Parent = Model109
- table.insert(cors,sandbox(Script123,function()
- function waitForChild(parent, childName)
- local child = parent:findFirstChild(childName)
- if child then return child end
- while true do
- child = parent.ChildAdded:wait()
- if child.Name==childName then return child end
- end
- end
- local Figure = script.Parent
- local Torso = waitForChild(Figure, "Torso")
- local RightShoulder = waitForChild(Torso, "Right Shoulder")
- local LeftShoulder = waitForChild(Torso, "Left Shoulder")
- local RightHip = waitForChild(Torso, "Right Hip")
- local LeftHip = waitForChild(Torso, "Left Hip")
- local Neck = waitForChild(Torso, "Neck")
- local Humanoid = waitForChild(Figure, "Humanoid")
- local pose = "Standing"
- local currentAnim = ""
- local currentAnimTrack = nil
- local currentAnimKeyframeHandler = nil
- local currentAnimSpeed = 1.0
- local animTable = {}
- local animNames = {
- idle = {
- { id = "http://www.roblox.com/asset/?id=125750544", weight = 9 },
- { id = "http://www.roblox.com/asset/?id=125750618", weight = 1 }
- },
- walk = {
- { id = "http://www.roblox.com/asset/?id=125749145", weight = 10 }
- },
- run = {
- { id = "run.xml", weight = 10 }
- },
- jump = {
- { id = "http://www.roblox.com/asset/?id=125750702", weight = 10 }
- },
- fall = {
- { id = "http://www.roblox.com/asset/?id=125750759", weight = 10 }
- },
- climb = {
- { id = "http://www.roblox.com/asset/?id=125750800", weight = 10 }
- },
- toolnone = {
- { id = "http://www.roblox.com/asset/?id=125750867", weight = 10 }
- },
- toolslash = {
- { id = "http://www.roblox.com/asset/?id=129967390", weight = 10 }
- -- { id = "slash.xml", weight = 10 }
- },
- toollunge = {
- { id = "http://www.roblox.com/asset/?id=129967478", weight = 10 }
- },
- wave = {
- { id = "http://www.roblox.com/asset/?id=128777973", weight = 10 }
- },
- point = {
- { id = "http://www.roblox.com/asset/?id=128853357", weight = 10 }
- },
- dance = {
- { id = "http://www.roblox.com/asset/?id=130018893", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=132546839", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=132546884", weight = 10 }
- },
- dance2 = {
- { id = "http://www.roblox.com/asset/?id=160934142", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=160934298", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=160934376", weight = 10 }
- },
- dance3 = {
- { id = "http://www.roblox.com/asset/?id=160934458", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=160934530", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=160934593", weight = 10 }
- },
- laugh = {
- { id = "http://www.roblox.com/asset/?id=129423131", weight = 10 }
- },
- cheer = {
- { id = "http://www.roblox.com/asset/?id=129423030", weight = 10 }
- },
- }
- -- Existance in this list signifies that it is an emote, the value indicates if it is a looping emote
- local emoteNames = { wave = false, point = false, dance = true, dance2 = true, dance3 = true, laugh = false, cheer = false}
- math.randomseed(tick())
- function configureAnimationSet(name, fileList)
- if (animTable[name] ~= nil) then
- for _, connection in pairs(animTable[name].connections) do
- connection:disconnect()
- end
- end
- animTable[name] = {}
- animTable[name].count = 0
- animTable[name].totalWeight = 0
- animTable[name].connections = {}
- -- check for config values
- local config = script:FindFirstChild(name)
- if (config ~= nil) then
- -- print("Loading anims " .. name)
- table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end))
- table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end))
- local idx = 1
- for _, childPart in pairs(config:GetChildren()) do
- if (childPart:IsA("Animation")) then
- table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end))
- animTable[name][idx] = {}
- animTable[name][idx].anim = childPart
- local weightObject = childPart:FindFirstChild("Weight")
- if (weightObject == nil) then
- animTable[name][idx].weight = 1
- else
- animTable[name][idx].weight = weightObject.Value
- end
- animTable[name].count = animTable[name].count + 1
- animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
- -- print(name .. " [" .. idx .. "] " .. animTable[name][idx].anim.AnimationId .. " (" .. animTable[name][idx].weight .. ")")
- idx = idx + 1
- end
- end
- end
- -- fallback to defaults
- if (animTable[name].count <= 0) then
- for idx, anim in pairs(fileList) do
- animTable[name][idx] = {}
- animTable[name][idx].anim = Instance.new("Animation")
- animTable[name][idx].anim.Name = name
- animTable[name][idx].anim.AnimationId = anim.id
- animTable[name][idx].weight = anim.weight
- animTable[name].count = animTable[name].count + 1
- animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
- -- print(name .. " [" .. idx .. "] " .. anim.id .. " (" .. anim.weight .. ")")
- end
- end
- end
- -- Setup animation objects
- function scriptChildModified(child)
- local fileList = animNames[child.Name]
- if (fileList ~= nil) then
- configureAnimationSet(child.Name, fileList)
- end
- end
- script.ChildAdded:connect(scriptChildModified)
- script.ChildRemoved:connect(scriptChildModified)
- for name, fileList in pairs(animNames) do
- configureAnimationSet(name, fileList)
- end
- -- ANIMATION
- -- declarations
- local toolAnim = "None"
- local toolAnimTime = 0
- local jumpAnimTime = 0
- local jumpAnimDuration = 0.3
- local toolTransitionTime = 0.1
- local fallTransitionTime = 0.3
- local jumpMaxLimbVelocity = 0.75
- -- functions
- function stopAllAnimations()
- local oldAnim = currentAnim
- -- return to idle if finishing an emote
- if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
- oldAnim = "idle"
- end
- currentAnim = ""
- if (currentAnimKeyframeHandler ~= nil) then
- currentAnimKeyframeHandler:disconnect()
- end
- if (currentAnimTrack ~= nil) then
- currentAnimTrack:Stop()
- currentAnimTrack:Destroy()
- currentAnimTrack = nil
- end
- return oldAnim
- end
- function setAnimationSpeed(speed)
- if speed ~= currentAnimSpeed then
- currentAnimSpeed = speed
- currentAnimTrack:AdjustSpeed(currentAnimSpeed)
- end
- end
- function keyFrameReachedFunc(frameName)
- if (frameName == "End") then
- -- print("Keyframe : ".. frameName)
- local repeatAnim = stopAllAnimations()
- local animSpeed = currentAnimSpeed
- playAnimation(repeatAnim, 0.0, Humanoid)
- setAnimationSpeed(animSpeed)
- end
- end
- -- Preload animations
- function playAnimation(animName, transitionTime, humanoid)
- local idleFromEmote = (animName == "idle" and emoteNames[currentAnim] ~= nil)
- if (animName ~= currentAnim and not idleFromEmote) then
- if (currentAnimTrack ~= nil) then
- currentAnimTrack:Stop(transitionTime)
- currentAnimTrack:Destroy()
- end
- currentAnimSpeed = 1.0
- local roll = math.random(1, animTable[animName].totalWeight)
- local origRoll = roll
- local idx = 1
- while (roll > animTable[animName][idx].weight) do
- roll = roll - animTable[animName][idx].weight
- idx = idx + 1
- end
- -- print(animName .. " " .. idx .. " [" .. origRoll .. "]")
- local anim = animTable[animName][idx].anim
- -- load it to the humanoid; get AnimationTrack
- currentAnimTrack = humanoid:LoadAnimation(anim)
- -- play the animation
- currentAnimTrack:Play(transitionTime)
- currentAnim = animName
- -- set up keyframe name triggers
- if (currentAnimKeyframeHandler ~= nil) then
- currentAnimKeyframeHandler:disconnect()
- end
- currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
- end
- end
- -------------------------------------------------------------------------------------------
- -------------------------------------------------------------------------------------------
- local toolAnimName = ""
- local toolAnimTrack = nil
- local currentToolAnimKeyframeHandler = nil
- function toolKeyFrameReachedFunc(frameName)
- if (frameName == "End") then
- -- print("Keyframe : ".. frameName)
- local repeatAnim = stopToolAnimations()
- playToolAnimation(repeatAnim, 0.0, Humanoid)
- end
- end
- function playToolAnimation(animName, transitionTime, humanoid)
- if (animName ~= toolAnimName) then
- if (toolAnimTrack ~= nil) then
- toolAnimTrack:Stop()
- toolAnimTrack:Destroy()
- transitionTime = 0
- end
- local roll = math.random(1, animTable[animName].totalWeight)
- local origRoll = roll
- local idx = 1
- while (roll > animTable[animName][idx].weight) do
- roll = roll - animTable[animName][idx].weight
- idx = idx + 1
- end
- -- print(animName .. " * " .. idx .. " [" .. origRoll .. "]")
- local anim = animTable[animName][idx].anim
- -- load it to the humanoid; get AnimationTrack
- toolAnimTrack = humanoid:LoadAnimation(anim)
- -- play the animation
- toolAnimTrack:Play(transitionTime)
- toolAnimName = animName
- currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc)
- end
- end
- function stopToolAnimations()
- local oldAnim = toolAnimName
- if (currentToolAnimKeyframeHandler ~= nil) then
- currentToolAnimKeyframeHandler:disconnect()
- end
- toolAnimName = ""
- if (toolAnimTrack ~= nil) then
- toolAnimTrack:Stop()
- toolAnimTrack:Destroy()
- toolAnimTrack = nil
- end
- return oldAnim
- end
- -------------------------------------------------------------------------------------------
- -------------------------------------------------------------------------------------------
- function onRunning(speed)
- if speed>0.01 then
- playAnimation("walk", 0.1, Humanoid)
- pose = "Running"
- else
- playAnimation("idle", 0.1, Humanoid)
- pose = "Standing"
- end
- end
- function onDied()
- pose = "Dead"
- end
- function onJumping()
- playAnimation("jump", 0.1, Humanoid)
- jumpAnimTime = jumpAnimDuration
- pose = "Jumping"
- end
- function onClimbing(speed)
- playAnimation("climb", 0.1, Humanoid)
- setAnimationSpeed(speed / 12.0)
- pose = "Climbing"
- end
- function onGettingUp()
- pose = "GettingUp"
- end
- function onFreeFall()
- if (jumpAnimTime <= 0) then
- playAnimation("fall", fallTransitionTime, Humanoid)
- end
- pose = "FreeFall"
- end
- function onFallingDown()
- pose = "FallingDown"
- end
- function onSeated()
- pose = "Seated"
- end
- function onPlatformStanding()
- pose = "PlatformStanding"
- end
- function onSwimming(speed)
- if speed>0 then
- pose = "Running"
- else
- pose = "Standing"
- end
- end
- function getTool()
- for _, kid in ipairs(Figure:GetChildren()) do
- if kid.className == "Tool" then return kid end
- end
- return nil
- end
- function getToolAnim(tool)
- for _, c in ipairs(tool:GetChildren()) do
- if c.Name == "toolanim" and c.className == "StringValue" then
- return c
- end
- end
- return nil
- end
- function animateTool()
- if (toolAnim == "None") then
- playToolAnimation("toolnone", toolTransitionTime, Humanoid)
- return
- end
- if (toolAnim == "Slash") then
- playToolAnimation("toolslash", 0, Humanoid)
- return
- end
- if (toolAnim == "Lunge") then
- playToolAnimation("toollunge", 0, Humanoid)
- return
- end
- end
- function moveSit()
- RightShoulder.MaxVelocity = 0.15
- LeftShoulder.MaxVelocity = 0.15
- RightShoulder:SetDesiredAngle(3.14 /2)
- LeftShoulder:SetDesiredAngle(-3.14 /2)
- RightHip:SetDesiredAngle(3.14 /2)
- LeftHip:SetDesiredAngle(-3.14 /2)
- end
- local lastTick = 0
- function move(time)
- local amplitude = 1
- local frequency = 1
- local deltaTime = time - lastTick
- lastTick = time
- local climbFudge = 0
- local setAngles = false
- if (jumpAnimTime > 0) then
- jumpAnimTime = jumpAnimTime - deltaTime
- end
- if (pose == "FreeFall" and jumpAnimTime <= 0) then
- playAnimation("fall", fallTransitionTime, Humanoid)
- elseif (pose == "Seated") then
- stopAllAnimations()
- moveSit()
- return
- elseif (pose == "Running") then
- playAnimation("walk", 0.1, Humanoid)
- elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
- -- print("Wha " .. pose)
- amplitude = 0.1
- frequency = 1
- setAngles = true
- end
- if (setAngles) then
- desiredAngle = amplitude * math.sin(time * frequency)
- RightShoulder:SetDesiredAngle(desiredAngle + climbFudge)
- LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge)
- RightHip:SetDesiredAngle(-desiredAngle)
- LeftHip:SetDesiredAngle(-desiredAngle)
- end
- -- Tool Animation handling
- local tool = getTool()
- if tool then
- animStringValueObject = getToolAnim(tool)
- if animStringValueObject then
- toolAnim = animStringValueObject.Value
- -- message recieved, delete StringValue
- animStringValueObject.Parent = nil
- toolAnimTime = time + .3
- end
- if time > toolAnimTime then
- toolAnimTime = 0
- toolAnim = "None"
- end
- animateTool()
- else
- stopToolAnimations()
- toolAnim = "None"
- toolAnimTime = 0
- end
- end
- -- connect events
- Humanoid.Died:connect(onDied)
- Humanoid.Running:connect(onRunning)
- Humanoid.Jumping:connect(onJumping)
- Humanoid.Climbing:connect(onClimbing)
- Humanoid.GettingUp:connect(onGettingUp)
- Humanoid.FreeFalling:connect(onFreeFall)
- Humanoid.FallingDown:connect(onFallingDown)
- Humanoid.Seated:connect(onSeated)
- Humanoid.PlatformStanding:connect(onPlatformStanding)
- Humanoid.Swimming:connect(onSwimming)
- -- setup emote chat hook
- -- main program
- local runService = game:service("RunService");
- -- initialize to idle
- playAnimation("idle", 0.1, Humanoid)
- pose = "Standing"
- while Figure.Parent~=nil do
- local _, time = wait(0.1)
- move(time)
- end
- end))
- StringValue124.Name = "climb"
- StringValue124.Parent = Script123
- Animation125.Name = "ClimbAnim"
- Animation125.Parent = StringValue124
- Animation125.AnimationId = "http://www.roblox.com/asset/?id=125750800"
- StringValue126.Name = "fall"
- StringValue126.Parent = Script123
- Animation127.Name = "FallAnim"
- Animation127.Parent = StringValue126
- Animation127.AnimationId = "http://www.roblox.com/asset/?id=125750759"
- StringValue128.Name = "idle"
- StringValue128.Parent = Script123
- Animation129.Name = "Animation1"
- Animation129.Parent = StringValue128
- Animation129.AnimationId = "http://www.roblox.com/asset/?id=125750544"
- NumberValue130.Name = "Weight"
- NumberValue130.Parent = Animation129
- NumberValue130.Value = 9
- Animation131.Name = "Animation2"
- Animation131.Parent = StringValue128
- Animation131.AnimationId = "http://www.roblox.com/asset/?id=125750618"
- NumberValue132.Name = "Weight"
- NumberValue132.Parent = Animation131
- NumberValue132.Value = 1
- StringValue133.Name = "jump"
- StringValue133.Parent = Script123
- Animation134.Name = "JumpAnim"
- Animation134.Parent = StringValue133
- Animation134.AnimationId = "http://www.roblox.com/asset/?id=125750702"
- StringValue135.Name = "run"
- StringValue135.Parent = Script123
- Animation136.Name = "RunAnim"
- Animation136.Parent = StringValue135
- Animation136.AnimationId = "http://www.roblox.com/asset/?id=125749145"
- StringValue137.Name = "toolnone"
- StringValue137.Parent = Script123
- Animation138.Name = "ToolNoneAnim"
- Animation138.Parent = StringValue137
- Animation138.AnimationId = "http://www.roblox.com/asset/?id=125750867"
- StringValue139.Name = "walk"
- StringValue139.Parent = Script123
- Animation140.Name = "WalkAnim"
- Animation140.Parent = StringValue139
- Animation140.AnimationId = "http://www.roblox.com/asset/?id=125749145"
- Part141.Name = "Head"
- Part141.Parent = Model109
- Part141.BrickColor = BrickColor.new("Cool yellow")
- Part141.Rotation = Vector3.new(0, 90, 0)
- Part141.FormFactor = Enum.FormFactor.Symmetric
- Part141.Size = Vector3.new(2, 1, 1)
- Part141.CFrame = CFrame.new(8.79733276, 4.45095634, -17.2153912, 0.000532949809, -0.000846050854, 1.00000048, 7.0162085e-09, 0.999999642, 0.000846053765, -1.00000155, -4.46565792e-07, 0.000533248123)
- Part141.BottomSurface = Enum.SurfaceType.Smooth
- Part141.TopSurface = Enum.SurfaceType.Smooth
- Part141.Color = Color3.new(0.992157, 0.917647, 0.552941)
- Part141.Position = Vector3.new(8.79733276, 4.45095634, -17.2153912)
- Part141.Orientation = Vector3.new(-0.049999997, 89.9700012, 0)
- Part141.Color = Color3.new(0.992157, 0.917647, 0.552941)
- SpecialMesh142.Parent = Part141
- SpecialMesh142.Scale = Vector3.new(1.25, 1.25, 1.25)
- SpecialMesh142.Scale = Vector3.new(1.25, 1.25, 1.25)
- Decal143.Parent = Part141
- Decal143.Texture = "http://www.roblox.com/asset/?id=134724710"
- Part144.Name = "Right Arm"
- Part144.Parent = Model109
- Part144.BrickColor = BrickColor.new("Cool yellow")
- Part144.Rotation = Vector3.new(0, 90, 0)
- Part144.CanCollide = false
- Part144.FormFactor = Enum.FormFactor.Symmetric
- Part144.Size = Vector3.new(1, 2, 1)
- Part144.CFrame = CFrame.new(8.79940128, 2.95095706, -18.7153931, 0.000532949809, -0.000846050738, 1.00000048, 7.0162085e-09, 0.999999523, 0.000846053765, -1.00000155, -4.46565736e-07, 0.000533248123)
- Part144.BottomSurface = Enum.SurfaceType.Smooth
- Part144.TopSurface = Enum.SurfaceType.Smooth
- Part144.Color = Color3.new(0.992157, 0.917647, 0.552941)
- Part144.Position = Vector3.new(8.79940128, 2.95095706, -18.7153931)
- Part144.Orientation = Vector3.new(-0.049999997, 89.9700012, 0)
- Part144.Color = Color3.new(0.992157, 0.917647, 0.552941)
- Part145.Name = "Left Arm"
- Part145.Parent = Model109
- Part145.BrickColor = BrickColor.new("Cool yellow")
- Part145.Rotation = Vector3.new(0, 90, 0)
- Part145.CanCollide = false
- Part145.FormFactor = Enum.FormFactor.Symmetric
- Part145.Size = Vector3.new(1, 2, 1)
- Part145.CFrame = CFrame.new(8.79780293, 2.95095706, -15.7153893, 0.000532949809, -0.000846050738, 1.00000048, 7.0162085e-09, 0.999999523, 0.000846053765, -1.00000155, -4.46565736e-07, 0.000533248123)
- Part145.BottomSurface = Enum.SurfaceType.Smooth
- Part145.TopSurface = Enum.SurfaceType.Smooth
- Part145.Color = Color3.new(0.992157, 0.917647, 0.552941)
- Part145.Position = Vector3.new(8.79780293, 2.95095706, -15.7153893)
- Part145.Orientation = Vector3.new(-0.049999997, 89.9700012, 0)
- Part145.Color = Color3.new(0.992157, 0.917647, 0.552941)
- Part146.Name = "Right Leg"
- Part146.Parent = Model109
- Part146.BrickColor = BrickColor.new("Bright blue")
- Part146.Rotation = Vector3.new(0, 90, 0)
- Part146.CanCollide = false
- Part146.FormFactor = Enum.FormFactor.Symmetric
- Part146.Size = Vector3.new(1, 2, 1)
- Part146.CFrame = CFrame.new(8.80056095, 0.950957894, -17.7153912, 0.000532949809, -0.000846050738, 1.00000048, 7.0162085e-09, 0.999999523, 0.000846053765, -1.00000155, -4.46565736e-07, 0.000533248123)
- Part146.BottomSurface = Enum.SurfaceType.Smooth
- Part146.TopSurface = Enum.SurfaceType.Smooth
- Part146.Color = Color3.new(0.0509804, 0.411765, 0.67451)
- Part146.Position = Vector3.new(8.80056095, 0.950957894, -17.7153912)
- Part146.Orientation = Vector3.new(-0.049999997, 89.9700012, 0)
- Part146.Color = Color3.new(0.0509804, 0.411765, 0.67451)
- Part147.Name = "Left Leg"
- Part147.Parent = Model109
- Part147.BrickColor = BrickColor.new("Bright blue")
- Part147.Rotation = Vector3.new(0, 90, 0)
- Part147.CanCollide = false
- Part147.FormFactor = Enum.FormFactor.Symmetric
- Part147.Size = Vector3.new(1, 2, 1)
- Part147.CFrame = CFrame.new(8.80002785, 0.950957894, -16.7153893, 0.000532949809, -0.000846050738, 1.00000048, 7.0162085e-09, 0.999999523, 0.000846053765, -1.00000155, -4.46565736e-07, 0.000533248123)
- Part147.BottomSurface = Enum.SurfaceType.Smooth
- Part147.TopSurface = Enum.SurfaceType.Smooth
- Part147.Color = Color3.new(0.0509804, 0.411765, 0.67451)
- Part147.Position = Vector3.new(8.80002785, 0.950957894, -16.7153893)
- Part147.Orientation = Vector3.new(-0.049999997, 89.9700012, 0)
- Part147.Color = Color3.new(0.0509804, 0.411765, 0.67451)
- Part148.Name = "Torso"
- Part148.Parent = Model109
- Part148.BrickColor = BrickColor.new("Dark green")
- Part148.Rotation = Vector3.new(0, 90, 0)
- Part148.CanCollide = false
- Part148.FormFactor = Enum.FormFactor.Symmetric
- Part148.Size = Vector3.new(2, 2, 1)
- Part148.CFrame = CFrame.new(8.7986021, 2.95095706, -17.2153912, 0.000532949809, -0.000846050854, 1.00000048, 7.0162085e-09, 0.999999642, 0.000846053765, -1.00000155, -4.46565792e-07, 0.000533248123)
- Part148.BottomSurface = Enum.SurfaceType.Smooth
- Part148.TopSurface = Enum.SurfaceType.Smooth
- Part148.Color = Color3.new(0.156863, 0.498039, 0.278431)
- Part148.Position = Vector3.new(8.7986021, 2.95095706, -17.2153912)
- Part148.Orientation = Vector3.new(-0.049999997, 89.9700012, 0)
- Part148.Color = Color3.new(0.156863, 0.498039, 0.278431)
- Sound149.Name = "HitSound"
- Sound149.Parent = Part148
- Sound149.SoundId = "http://www.roblox.com/asset/?id=93591808"
- Motor6D150.Name = "Left Hip"
- Motor6D150.Parent = Part148
- Motor6D150.C0 = CFrame.new(-1, -1, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08)
- Motor6D150.C1 = CFrame.new(-0.5, 1, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08)
- Motor6D150.Part0 = Part148
- Motor6D150.Part1 = Part147
- Motor6D150.MaxVelocity = 0.10000000149012
- Motor6D151.Name = "Right Hip"
- Motor6D151.Parent = Part148
- Motor6D151.C0 = CFrame.new(1, -1, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08)
- Motor6D151.C1 = CFrame.new(0.5, 1, 0, -4.37113883e-08, 0, 1, 0, 0.99999994, 0, -1, 0, -4.37113883e-08)
- Motor6D151.Part0 = Part148
- Motor6D151.Part1 = Part146
- Motor6D151.MaxVelocity = 0.10000000149012
- Motor6D152.Name = "Left Shoulder"
- Motor6D152.Parent = Part148
- Motor6D152.C0 = CFrame.new(-1, 0.5, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08)
- Motor6D152.C1 = CFrame.new(0.5, 0.5, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08)
- Motor6D152.Part0 = Part148
- Motor6D152.Part1 = Part145
- Motor6D152.MaxVelocity = 0.10000000149012
- Motor6D153.Name = "Right Shoulder"
- Motor6D153.Parent = Part148
- Motor6D153.C0 = CFrame.new(1, 0.5, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08)
- Motor6D153.C1 = CFrame.new(-0.5, 0.5, 0, -4.37113883e-08, 0, 1, 0, 0.99999994, 0, -1, 0, -4.37113883e-08)
- Motor6D153.Part0 = Part148
- Motor6D153.Part1 = Part144
- Motor6D153.MaxVelocity = 0.10000000149012
- Motor6D154.Name = "Neck"
- Motor6D154.Parent = Part148
- Motor6D154.C0 = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Motor6D154.C1 = CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Motor6D154.Part0 = Part148
- Motor6D154.Part1 = Part141
- Motor6D154.MaxVelocity = 0.10000000149012
- Part155.Name = "HumanoidRootPart"
- Part155.Parent = Model109
- Part155.Transparency = 1
- Part155.Rotation = Vector3.new(0, 90, 0)
- Part155.FormFactor = Enum.FormFactor.Symmetric
- Part155.Size = Vector3.new(2, 2, 1)
- Part155.CFrame = CFrame.new(8.7986021, 2.95095706, -17.2153912, 0.000532949809, -0.000846050854, 1.00000048, 7.0162085e-09, 0.999999642, 0.000846053765, -1.00000155, -4.46565792e-07, 0.000533248123)
- Part155.BottomSurface = Enum.SurfaceType.Smooth
- Part155.TopSurface = Enum.SurfaceType.Smooth
- Part155.Position = Vector3.new(8.7986021, 2.95095706, -17.2153912)
- Part155.Orientation = Vector3.new(-0.049999997, 89.9700012, 0)
- Motor6D156.Name = "Root Hip"
- Motor6D156.Parent = Part155
- Motor6D156.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Motor6D156.C1 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Motor6D156.Part0 = Part155
- Motor6D156.Part1 = Part148
- Motor6D156.MaxVelocity = 0.10000000149012
- Script157.Name = "READ ME"
- Script157.Parent = Model109
- table.insert(cors,sandbox(Script157,function()
- --- Please support and like and fav. Zombie wars for more updates.
- ---THANK YOU
- --YUANRAVIEH190
- end))
- Part158.Name = "MonsterSpawn"
- Part158.Parent = Model108
- Part158.Material = Enum.Material.Neon
- Part158.BrickColor = BrickColor.new("Reddish brown")
- Part158.Rotation = Vector3.new(0, 90, 0)
- Part158.Anchored = true
- Part158.CanCollide = false
- Part158.FormFactor = Enum.FormFactor.Custom
- Part158.Size = Vector3.new(6, 0.200000003, 6)
- Part158.CFrame = CFrame.new(8.40016365, -0.149426997, -17.2251568, -1.94256427e-06, 2.03144737e-08, 1.00000048, 1.57338604e-08, 0.999990463, -3.37604433e-09, -1.00000083, 1.46186778e-08, -1.79343624e-06)
- Part158.BottomSurface = Enum.SurfaceType.Smooth
- Part158.TopSurface = Enum.SurfaceType.Smooth
- Part158.Color = Color3.new(0.411765, 0.25098, 0.156863)
- Part158.Position = Vector3.new(8.40016365, -0.149426997, -17.2251568)
- Part158.Orientation = Vector3.new(0, 90, 0)
- Part158.Color = Color3.new(0.411765, 0.25098, 0.156863)
- Decal159.Parent = Part158
- Decal159.Texture = "http://www.roblox.com/asset/?id=134724710"
- Decal159.Face = Enum.NormalId.Top
- Script160.Parent = Part158
- table.insert(cors,sandbox(Script160,function()
- zombie = script.Parent.Parent.Zombie
- zombiebackup = zombie:Clone()
- zombie:remove()
- while true do
- wait(5)
- local newzombie = zombiebackup:Clone()
- newzombie.Parent = game.Workspace
- newzombie:MakeJoints()
- newzombie.Torso.CFrame = script.Parent.CFrame + Vector3.new(0, 5, 0)
- newzombie:MakeJoints()
- zombie = newzombie
- zombiebackup = zombie:Clone()
- end
- end))
- ManualWeld161.Name = "MonsterSpawn-to-MonsterSpawn Strong Joint"
- ManualWeld161.Parent = Part158
- ManualWeld161.C0 = CFrame.new(3, -0.100000001, 3, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- ManualWeld161.C1 = CFrame.new(-3, -0.100000001, 3, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- ManualWeld161.Part0 = Part158
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = workspace
- pcall(function() v:MakeJoints() end)
- end
- mas:Destroy()
- for i,v in pairs(cors) do
- spawn(function()
- pcall(v)
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement