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")
- Part1 = Instance.new("Part")
- SpecialMesh2 = Instance.new("SpecialMesh")
- Motor6D3 = Instance.new("Motor6D")
- Weld4 = Instance.new("Weld")
- Motor6D5 = Instance.new("Motor6D")
- Motor6D6 = Instance.new("Motor6D")
- Motor6D7 = Instance.new("Motor6D")
- Motor6D8 = Instance.new("Motor6D")
- ParticleEmitter9 = Instance.new("ParticleEmitter")
- ParticleEmitter10 = Instance.new("ParticleEmitter")
- ParticleEmitter11 = Instance.new("ParticleEmitter")
- ParticleEmitter12 = Instance.new("ParticleEmitter")
- Part13 = Instance.new("Part")
- SpecialMesh14 = Instance.new("SpecialMesh")
- Sound15 = Instance.new("Sound")
- Sound16 = Instance.new("Sound")
- Part17 = Instance.new("Part")
- SpecialMesh18 = Instance.new("SpecialMesh")
- Part19 = Instance.new("Part")
- SpecialMesh20 = Instance.new("SpecialMesh")
- Part21 = Instance.new("Part")
- SpecialMesh22 = Instance.new("SpecialMesh")
- Part23 = Instance.new("Part")
- SpecialMesh24 = Instance.new("SpecialMesh")
- Part25 = Instance.new("Part")
- SpecialMesh26 = Instance.new("SpecialMesh")
- Humanoid27 = Instance.new("Humanoid")
- Hat28 = Instance.new("Hat")
- Script29 = Instance.new("Script")
- BodyColors30 = Instance.new("BodyColors")
- Script31 = Instance.new("Script")
- StringValue32 = Instance.new("StringValue")
- Animation33 = Instance.new("Animation")
- StringValue34 = Instance.new("StringValue")
- Animation35 = Instance.new("Animation")
- StringValue36 = Instance.new("StringValue")
- Animation37 = Instance.new("Animation")
- NumberValue38 = Instance.new("NumberValue")
- Animation39 = Instance.new("Animation")
- NumberValue40 = Instance.new("NumberValue")
- StringValue41 = Instance.new("StringValue")
- Animation42 = Instance.new("Animation")
- StringValue43 = Instance.new("StringValue")
- Animation44 = Instance.new("Animation")
- StringValue45 = Instance.new("StringValue")
- Animation46 = Instance.new("Animation")
- StringValue47 = Instance.new("StringValue")
- Animation48 = Instance.new("Animation")
- BrickColorValue49 = Instance.new("BrickColorValue")
- Script50 = Instance.new("Script")
- Animation51 = Instance.new("Animation")
- Sound52 = Instance.new("Sound")
- Model0.Name = "Dog"
- Model0.Parent = mas
- Part1.Name = "Torso"
- Part1.Parent = Model0
- Part1.CFrame = CFrame.new(-20.9987373, 2.45000553, 49.5617905, 0, 0, 1.00000012, 6.16297582e-33, 1, 0, -1.00000012, -6.16297582e-33, 0)
- Part1.Orientation = Vector3.new(0, 90, 0)
- Part1.Position = Vector3.new(-20.9987373, 2.45000553, 49.5617905)
- Part1.Rotation = Vector3.new(0, 90, 0)
- Part1.Color = Color3.new(0.854902, 0.521569, 0.254902)
- Part1.Size = Vector3.new(1, 1.5, 3.75)
- Part1.BottomSurface = Enum.SurfaceType.Smooth
- Part1.BrickColor = BrickColor.new("Bright orange")
- Part1.TopSurface = Enum.SurfaceType.Smooth
- Part1.brickColor = BrickColor.new("Bright orange")
- Part1.FormFactor = Enum.FormFactor.Custom
- Part1.formFactor = Enum.FormFactor.Custom
- SpecialMesh2.Parent = Part1
- SpecialMesh2.MeshId = "http://www.roblox.com/asset/?id=257307222"
- SpecialMesh2.Scale = Vector3.new(1.10000002, 1, 1)
- SpecialMesh2.TextureId = "http://www.roblox.com/asset/?id=255486143"
- SpecialMesh2.MeshType = Enum.MeshType.FileMesh
- Motor6D3.Name = "Tail"
- Motor6D3.Parent = Part1
- Motor6D3.MaxVelocity = 0.15000000596046
- Motor6D3.C0 = CFrame.new(-0.0517863631, -0.0699996948, 1.72020686, 1, 0, 0, 0, -4.37113883e-08, -1, 0, 1, -4.37113883e-08)
- Motor6D3.C1 = CFrame.new(0.143782854, -0.172836304, 0.234024048, 0.965675592, -0.252551526, -0.0607320629, 0.0605338626, 0.446179628, -0.892893791, 0.25259909, 0.858569145, 0.446152657)
- Motor6D3.Part0 = Part1
- Motor6D3.Part1 = Part25
- Motor6D3.part1 = Part25
- Weld4.Name = "Neck"
- Weld4.Parent = Part1
- Weld4.C0 = CFrame.new(-5.28991222e-07, -49.9792976, -4.23192978e-06, 1, 2.50387147e-21, -1.16694232e-21, -2.50387147e-21, 1, 9.25738092e-22, 1.16694232e-21, -9.25738092e-22, 1)
- Weld4.C1 = CFrame.new(-5.28991222e-07, -50.8292961, 1.37499571, 1, 2.50387147e-21, -1.16694232e-21, -2.50387147e-21, 1, 9.25738092e-22, 1.16694232e-21, -9.25738092e-22, 1)
- Weld4.Part0 = Part1
- Weld4.Part1 = Part13
- Weld4.part1 = Part13
- Motor6D5.Name = "Left Hip"
- Motor6D5.Parent = Part1
- Motor6D5.MaxVelocity = 0.15000000596046
- Motor6D5.C0 = CFrame.new(-0.226999998, -1.01200867, 1.20399976, -4.37113883e-08, 0, -1, 0, 1, 0, 1, 0, -4.37113883e-08)
- Motor6D5.C1 = CFrame.new(0.125, 0.375, -0.199999928, -4.37113883e-08, -1.16027513e-42, -1, 0, 1, -4.22132457e-29, 1, 0, -4.37113883e-08)
- Motor6D5.Part0 = Part1
- Motor6D5.Part1 = Part19
- Motor6D5.part1 = Part19
- Motor6D6.Name = "Left Shoulder"
- Motor6D6.Parent = Part1
- Motor6D6.MaxVelocity = 0.15000000596046
- Motor6D6.C0 = CFrame.new(-0.265000015, -0.725003839, -0.654999971, -4.37113883e-08, 0, -1, 0, 1, 0, 1, 0, -4.37113883e-08)
- Motor6D6.C1 = CFrame.new(0.125, 0.775001526, 0.0249999762, -4.37113883e-08, -1.05798034e-42, -1, 0, 1, -4.20018027e-29, 1, 0, -4.37113883e-08)
- Motor6D6.Part0 = Part1
- Motor6D6.Part1 = Part17
- Motor6D6.part1 = Part17
- Motor6D7.Name = "Right Hip"
- Motor6D7.Parent = Part1
- Motor6D7.MaxVelocity = 0.15000000596046
- Motor6D7.C0 = CFrame.new(0.48300004, -1.01200867, 1.20399976, -4.37113883e-08, 0, 1, 0, 1, 0, -1, 0, -4.37113883e-08)
- Motor6D7.C1 = CFrame.new(0.125, 0.375, -0.199999928, -4.37113883e-08, -1.16027513e-42, 1, 0, 1, -4.22132457e-29, -1, 0, -4.37113883e-08)
- Motor6D7.Part0 = Part1
- Motor6D7.Part1 = Part23
- Motor6D7.part1 = Part23
- Motor6D8.Name = "Right Shoulder"
- Motor6D8.Parent = Part1
- Motor6D8.MaxVelocity = 0.15000000596046
- Motor6D8.C0 = CFrame.new(0.52500093, -0.725003839, -0.654999971, -4.37113883e-08, 0, 1, 0, 1, 0, -1, 0, -4.37113883e-08)
- Motor6D8.C1 = CFrame.new(0.12500003, 0.775001526, 0.0249999762, -4.37113883e-08, -1.05798034e-42, 1, 0, 1, -4.20018027e-29, -1, 0, -4.37113883e-08)
- Motor6D8.Part0 = Part1
- Motor6D8.Part1 = Part21
- Motor6D8.part1 = Part21
- ParticleEmitter9.Name = "Much Bricks"
- ParticleEmitter9.Parent = Part1
- ParticleEmitter9.Texture = "http://www.roblox.com/asset/?id=242973962"
- ParticleEmitter9.Size = NumberSequence.new(5,5)
- ParticleEmitter9.Lifetime = NumberRange.new(0.25, 0.5)
- ParticleEmitter9.Rate = 0.5
- ParticleEmitter10.Name = "Very Fun"
- ParticleEmitter10.Parent = Part1
- ParticleEmitter10.Texture = "http://www.roblox.com/asset/?id=242974141"
- ParticleEmitter10.Size = NumberSequence.new(5,5)
- ParticleEmitter10.Lifetime = NumberRange.new(0.25, 0.5)
- ParticleEmitter10.Rate = 0.20000000298023
- ParticleEmitter11.Name = "Wow"
- ParticleEmitter11.Parent = Part1
- ParticleEmitter11.Texture = "http://www.roblox.com/asset/?id=242835405"
- ParticleEmitter11.Size = NumberSequence.new(5,5)
- ParticleEmitter11.Lifetime = NumberRange.new(0.25, 0.5)
- ParticleEmitter11.Rate = 0.75
- ParticleEmitter12.Name = "Such Hats"
- ParticleEmitter12.Parent = Part1
- ParticleEmitter12.Texture = "http://www.roblox.com/asset/?id=242974025"
- ParticleEmitter12.Size = NumberSequence.new(5,5)
- ParticleEmitter12.Lifetime = NumberRange.new(0.25, 0.5)
- ParticleEmitter12.Rate = 0.34999999403954
- Part13.Name = "Head"
- Part13.Parent = Model0
- Part13.CFrame = CFrame.new(-22.3737373, 3.30000401, 49.5617905, 0, 0, 1.00000012, 6.16297582e-33, 1, 0, -1.00000012, -6.16297582e-33, 0)
- Part13.Orientation = Vector3.new(0, 90, 0)
- Part13.Position = Vector3.new(-22.3737373, 3.30000401, 49.5617905)
- Part13.Rotation = Vector3.new(0, 90, 0)
- Part13.Color = Color3.new(0.854902, 0.521569, 0.254902)
- Part13.Size = Vector3.new(1, 0.200000003, 1)
- Part13.BottomSurface = Enum.SurfaceType.Smooth
- Part13.BrickColor = BrickColor.new("Bright orange")
- Part13.TopSurface = Enum.SurfaceType.Smooth
- Part13.brickColor = BrickColor.new("Bright orange")
- Part13.FormFactor = Enum.FormFactor.Custom
- Part13.formFactor = Enum.FormFactor.Custom
- SpecialMesh14.Parent = Part13
- SpecialMesh14.Scale = Vector3.new(1.10000002, 1, 1)
- SpecialMesh14.MeshType = Enum.MeshType.FileMesh
- Sound15.Name = "Bite Bark"
- Sound15.Parent = Part13
- Sound15.SoundId = "http://www.roblox.com/asset/?id=144016898"
- Sound15.Volume = 1
- Sound16.Name = "Seal Barking"
- Sound16.Parent = Part13
- Sound16.Looped = true
- Sound16.Pitch = 1.3999999761581
- Sound16.PlaybackSpeed = 1.3999999761581
- Sound16.SoundId = "rbxassetid://315105938"
- Sound16.Volume = 1
- Part17.Name = "Left Arm"
- Part17.Parent = Model0
- Part17.CFrame = CFrame.new(-21.6787376, 0.950000167, 49.9517899, 0, 1.8359573e-36, 1.00000012, 6.16297582e-33, 1, 0, -1.00000012, -4.20079717e-29, 0)
- Part17.Orientation = Vector3.new(0, 90, 0)
- Part17.Position = Vector3.new(-21.6787376, 0.950000167, 49.9517899)
- Part17.Rotation = Vector3.new(0, 90, 0)
- Part17.Color = Color3.new(0.854902, 0.521569, 0.254902)
- Part17.Size = Vector3.new(0.5, 1.9000001, 0.5)
- Part17.BottomSurface = Enum.SurfaceType.Smooth
- Part17.BrickColor = BrickColor.new("Bright orange")
- Part17.CanCollide = false
- Part17.TopSurface = Enum.SurfaceType.Smooth
- Part17.brickColor = BrickColor.new("Bright orange")
- Part17.FormFactor = Enum.FormFactor.Custom
- Part17.formFactor = Enum.FormFactor.Custom
- SpecialMesh18.Parent = Part17
- SpecialMesh18.MeshId = "http://www.roblox.com/asset/?id=257307555"
- SpecialMesh18.Offset = Vector3.new(0.0250000004, 0.200000003, 0.75)
- SpecialMesh18.TextureId = "http://www.roblox.com/asset/?id=255486143"
- SpecialMesh18.MeshType = Enum.MeshType.FileMesh
- Part19.Name = "Left Leg"
- Part19.Parent = Model0
- Part19.CFrame = CFrame.new(-19.594738, 1.06299686, 49.9137917, 0, 1.84519968e-36, 1.00000012, 6.16297582e-33, 1, 0, -1.00000012, -4.22194147e-29, 0)
- Part19.Orientation = Vector3.new(0, 90, 0)
- Part19.Position = Vector3.new(-19.594738, 1.06299686, 49.9137917)
- Part19.Rotation = Vector3.new(0, 90, 0)
- Part19.Color = Color3.new(0.854902, 0.521569, 0.254902)
- Part19.Size = Vector3.new(0.5, 1.9000001, 0.5)
- Part19.BottomSurface = Enum.SurfaceType.Smooth
- Part19.BrickColor = BrickColor.new("Bright orange")
- Part19.CanCollide = false
- Part19.TopSurface = Enum.SurfaceType.Smooth
- Part19.brickColor = BrickColor.new("Bright orange")
- Part19.FormFactor = Enum.FormFactor.Custom
- Part19.formFactor = Enum.FormFactor.Custom
- SpecialMesh20.Parent = Part19
- SpecialMesh20.MeshId = "http://www.roblox.com/asset/?id=257316977"
- SpecialMesh20.Offset = Vector3.new(-0.075000003, -0.100000001, 0)
- SpecialMesh20.TextureId = "http://www.roblox.com/asset/?id=255486143"
- SpecialMesh20.MeshType = Enum.MeshType.FileMesh
- Part21.Name = "Right Arm"
- Part21.Parent = Model0
- Part21.CFrame = CFrame.new(-21.6787376, 0.950000167, 49.1617889, 0, 1.8359573e-36, 1.00000012, 6.16297582e-33, 1, 0, -1.00000012, 4.19956457e-29, 0)
- Part21.Orientation = Vector3.new(0, 90, 0)
- Part21.Position = Vector3.new(-21.6787376, 0.950000167, 49.1617889)
- Part21.Rotation = Vector3.new(0, 90, 0)
- Part21.Color = Color3.new(0.854902, 0.521569, 0.254902)
- Part21.Size = Vector3.new(0.5, 1.9000001, 0.5)
- Part21.BottomSurface = Enum.SurfaceType.Smooth
- Part21.BrickColor = BrickColor.new("Bright orange")
- Part21.CanCollide = false
- Part21.TopSurface = Enum.SurfaceType.Smooth
- Part21.brickColor = BrickColor.new("Bright orange")
- Part21.FormFactor = Enum.FormFactor.Custom
- Part21.formFactor = Enum.FormFactor.Custom
- SpecialMesh22.Parent = Part21
- SpecialMesh22.MeshId = "http://www.roblox.com/asset/?id=255485626"
- SpecialMesh22.Offset = Vector3.new(-0.0500000007, -0.0500000007, 0)
- SpecialMesh22.TextureId = "http://www.roblox.com/asset/?id=255486143"
- SpecialMesh22.MeshType = Enum.MeshType.FileMesh
- Part23.Name = "Right Leg"
- Part23.Parent = Model0
- Part23.CFrame = CFrame.new(-19.594738, 1.06299686, 49.2037888, 0, 1.84519968e-36, 1.00000012, 6.16297582e-33, 1, 0, -1.00000012, 4.22070888e-29, 0)
- Part23.Orientation = Vector3.new(0, 90, 0)
- Part23.Position = Vector3.new(-19.594738, 1.06299686, 49.2037888)
- Part23.Rotation = Vector3.new(0, 90, 0)
- Part23.Color = Color3.new(0.854902, 0.521569, 0.254902)
- Part23.Size = Vector3.new(0.5, 1.9000001, 0.5)
- Part23.BottomSurface = Enum.SurfaceType.Smooth
- Part23.BrickColor = BrickColor.new("Bright orange")
- Part23.CanCollide = false
- Part23.TopSurface = Enum.SurfaceType.Smooth
- Part23.brickColor = BrickColor.new("Bright orange")
- Part23.FormFactor = Enum.FormFactor.Custom
- Part23.formFactor = Enum.FormFactor.Custom
- SpecialMesh24.Parent = Part23
- SpecialMesh24.MeshId = "http://www.roblox.com/asset/?id=257317035"
- SpecialMesh24.Offset = Vector3.new(0.075000003, -0.100000001, 0)
- SpecialMesh24.TextureId = "http://www.roblox.com/asset/?id=255486143"
- SpecialMesh24.MeshType = Enum.MeshType.FileMesh
- Part25.Name = "Tail"
- Part25.Parent = Model0
- Part25.CFrame = CFrame.new(-19.3660278, 2.63000846, 49.801075, -0.252551556, 0.446179718, 0.858569264, 0.0607320741, 0.892893791, -0.446152687, -0.965675712, -0.06053387, -0.25259912)
- Part25.Orientation = Vector3.new(26.5, 106.389999, 3.8900001)
- Part25.Position = Vector3.new(-19.3660278, 2.63000846, 49.801075)
- Part25.Rotation = Vector3.new(119.519997, 59.1599998, -119.510002)
- Part25.Size = Vector3.new(0.75, 1, 0.75)
- Part25.BottomSurface = Enum.SurfaceType.Smooth
- Part25.TopSurface = Enum.SurfaceType.Smooth
- Part25.FormFactor = Enum.FormFactor.Custom
- Part25.formFactor = Enum.FormFactor.Custom
- SpecialMesh26.Parent = Part25
- SpecialMesh26.MeshId = "http://www.roblox.com/asset/?id=255485601"
- SpecialMesh26.TextureId = "http://www.roblox.com/asset/?id=255486143"
- SpecialMesh26.MeshType = Enum.MeshType.FileMesh
- Humanoid27.Parent = Model0
- Humanoid27.LeftLeg = Part19
- Humanoid27.NameOcclusion = Enum.NameOcclusion.NoOcclusion
- Humanoid27.RightLeg = Part23
- Humanoid27.Torso = Part1
- Hat28.Name = "NoHat"
- Hat28.Parent = Model0
- Script29.Name = "ZombieScript"
- Script29.Parent = Model0
- table.insert(cors,sandbox(Script29,function()
- --Made by Stickmasterluke
- --Zombie artificial stupidity script
- sp=script.Parent
- lastattack=0
- nextrandom=0
- nextsound=0
- nextjump=0
- chasing=false
- variance=4
- damage=50
- attackrange=4.5
- sightrange=999--60
- runspeed=40
- 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,"Tail")
- local Humanoid=waitForChild(sp,"Humanoid")
- local BodyColors=waitForChild(sp,"Body Colors")
- local pose="Standing"
- local hitsound=waitForChild(Head,"Bite Bark")
- local BARKING=waitForChild(Head,"Seal Barking")
- --[[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
- hitsound.Volume=1
- hitsound.Pitch=.75+(math.random()*.5)
- hitsound:Play()
- wait(0.15)
- h:TakeDamage(damage)
- --[[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
- BARKING:Play()
- 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
- BARKING:Stop()
- 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))
- BodyColors30.Parent = Model0
- BodyColors30.HeadColor = BrickColor.new("Bright orange")
- BodyColors30.HeadColor3 = Color3.new(0.854902, 0.521569, 0.254902)
- BodyColors30.LeftArmColor = BrickColor.new("Bright orange")
- BodyColors30.LeftArmColor3 = Color3.new(0.854902, 0.521569, 0.254902)
- BodyColors30.LeftLegColor = BrickColor.new("Bright orange")
- BodyColors30.LeftLegColor3 = Color3.new(0.854902, 0.521569, 0.254902)
- BodyColors30.RightArmColor = BrickColor.new("Bright orange")
- BodyColors30.RightArmColor3 = Color3.new(0.854902, 0.521569, 0.254902)
- BodyColors30.RightLegColor = BrickColor.new("Bright orange")
- BodyColors30.RightLegColor3 = Color3.new(0.854902, 0.521569, 0.254902)
- BodyColors30.TorsoColor = BrickColor.new("Bright orange")
- BodyColors30.TorsoColor3 = Color3.new(0.854902, 0.521569, 0.254902)
- Script31.Name = "Animate"
- Script31.Parent = Model0
- table.insert(cors,sandbox(Script31,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))
- StringValue32.Name = "climb"
- StringValue32.Parent = Script31
- Animation33.Name = "ClimbAnim"
- Animation33.Parent = StringValue32
- Animation33.AnimationId = "http://www.roblox.com/asset/?id=125750800"
- StringValue34.Name = "fall"
- StringValue34.Parent = Script31
- Animation35.Name = "FallAnim"
- Animation35.Parent = StringValue34
- Animation35.AnimationId = "http://www.roblox.com/asset/?id=125750759"
- StringValue36.Name = "idle"
- StringValue36.Parent = Script31
- Animation37.Name = "Animation1"
- Animation37.Parent = StringValue36
- Animation37.AnimationId = "http://www.roblox.com/asset/?id=125750544"
- NumberValue38.Name = "Weight"
- NumberValue38.Parent = Animation37
- NumberValue38.Value = 9
- Animation39.Name = "Animation2"
- Animation39.Parent = StringValue36
- Animation39.AnimationId = "http://www.roblox.com/asset/?id=125750618"
- NumberValue40.Name = "Weight"
- NumberValue40.Parent = Animation39
- NumberValue40.Value = 1
- StringValue41.Name = "jump"
- StringValue41.Parent = Script31
- Animation42.Name = "JumpAnim"
- Animation42.Parent = StringValue41
- Animation42.AnimationId = "http://www.roblox.com/asset/?id=125750702"
- StringValue43.Name = "run"
- StringValue43.Parent = Script31
- Animation44.Name = "RunAnim"
- Animation44.Parent = StringValue43
- Animation44.AnimationId = "http://www.roblox.com/asset/?id=125749145"
- StringValue45.Name = "toolnone"
- StringValue45.Parent = Script31
- Animation46.Name = "ToolNoneAnim"
- Animation46.Parent = StringValue45
- Animation46.AnimationId = "rbxassetid://2996823531"
- StringValue47.Name = "walk"
- StringValue47.Parent = Script31
- Animation48.Name = "WalkAnim"
- Animation48.Parent = StringValue47
- Animation48.AnimationId = "http://www.roblox.com/asset/?id=125749145"
- BrickColorValue49.Name = "TEAM"
- BrickColorValue49.Parent = Model0
- BrickColorValue49.Value = BrickColor.new("Bright red")
- Script50.Name = "Sound"
- Script50.Parent = Model0
- table.insert(cors,sandbox(Script50,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))
- Animation51.Name = "AttackAnim"
- Animation51.Parent = Model0
- Animation51.AnimationId = "http://www.roblox.com/Asset?ID=105211514"
- Sound52.Parent = Model0
- Sound52.SoundId = "rbxassetid://6395511764"
- Sound52.Volume = 10
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = script
- 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