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")
- Part2 = Instance.new("Part")
- Part3 = Instance.new("Part")
- BlockMesh4 = Instance.new("BlockMesh")
- Weld5 = Instance.new("Weld")
- Weld6 = Instance.new("Weld")
- Weld7 = Instance.new("Weld")
- Weld8 = Instance.new("Weld")
- Weld9 = Instance.new("Weld")
- Weld10 = Instance.new("Weld")
- Weld11 = Instance.new("Weld")
- Weld12 = Instance.new("Weld")
- Weld13 = Instance.new("Weld")
- Part14 = Instance.new("Part")
- Part15 = Instance.new("Part")
- Part16 = Instance.new("Part")
- Script17 = Instance.new("Script")
- Humanoid18 = Instance.new("Humanoid")
- IntValue19 = Instance.new("IntValue")
- Script20 = Instance.new("Script")
- Script21 = Instance.new("Script")
- Script22 = Instance.new("Script")
- Script23 = Instance.new("Script")
- Model0.Name = "Kactus Man"
- Model0.Parent = mas
- Part1.Name = "Right Arm"
- Part1.Parent = Model0
- Part1.CFrame = CFrame.new(18.9544754, 3.00000501, -72.0903015, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- Part1.Orientation = Vector3.new(0, 90, 0)
- Part1.Position = Vector3.new(18.9544754, 3.00000501, -72.0903015)
- Part1.Rotation = Vector3.new(0, 90, 0)
- Part1.Color = Color3.new(0.294118, 0.592157, 0.294118)
- Part1.Size = Vector3.new(1, 2, 1)
- Part1.Anchored = true
- Part1.BottomSurface = Enum.SurfaceType.Smooth
- Part1.BrickColor = BrickColor.new("Bright green")
- Part1.TopSurface = Enum.SurfaceType.Smooth
- Part1.brickColor = BrickColor.new("Bright green")
- Part1.FormFactor = Enum.FormFactor.Custom
- Part1.formFactor = Enum.FormFactor.Custom
- Part2.Name = "Left Arm"
- Part2.Parent = Model0
- Part2.CFrame = CFrame.new(21.9544754, 3.00000501, -72.0903015, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- Part2.Orientation = Vector3.new(0, 90, 0)
- Part2.Position = Vector3.new(21.9544754, 3.00000501, -72.0903015)
- Part2.Rotation = Vector3.new(0, 90, 0)
- Part2.Color = Color3.new(0.294118, 0.592157, 0.294118)
- Part2.Size = Vector3.new(1, 2, 1)
- Part2.Anchored = true
- Part2.BottomSurface = Enum.SurfaceType.Smooth
- Part2.BrickColor = BrickColor.new("Bright green")
- Part2.TopSurface = Enum.SurfaceType.Smooth
- Part2.brickColor = BrickColor.new("Bright green")
- Part2.FormFactor = Enum.FormFactor.Custom
- Part2.formFactor = Enum.FormFactor.Custom
- Part3.Name = "Head"
- Part3.Parent = Model0
- Part3.CFrame = CFrame.new(20.4544754, 4.49999714, -72.0903015, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part3.Position = Vector3.new(20.4544754, 4.49999714, -72.0903015)
- Part3.Color = Color3.new(0.294118, 0.592157, 0.294118)
- Part3.Size = Vector3.new(2, 1, 1)
- Part3.Anchored = true
- Part3.BottomSurface = Enum.SurfaceType.Smooth
- Part3.BrickColor = BrickColor.new("Bright green")
- Part3.TopSurface = Enum.SurfaceType.Smooth
- Part3.brickColor = BrickColor.new("Bright green")
- Part3.FormFactor = Enum.FormFactor.Custom
- Part3.formFactor = Enum.FormFactor.Custom
- BlockMesh4.Parent = Part3
- BlockMesh4.Offset = Vector3.new(0, 0.0500000007, 0)
- BlockMesh4.Scale = Vector3.new(0.560000002, 1.10000002, 1.10000002)
- Weld5.Name = "HeadWeld"
- Weld5.Parent = Part3
- Weld5.C0 = CFrame.new(0, 0.5, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Weld5.C1 = CFrame.new(0, 0.400000006, 0.25, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Weld6.Name = "HeadWeld"
- Weld6.Parent = Part3
- Weld6.C0 = CFrame.new(0, 0.5, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Weld6.C1 = CFrame.new(-1, -1, 1, 0.707106769, -0.707106769, 0, -0.707106769, -0.707106769, 0, 0, -0, -1)
- Weld7.Name = "HeadWeld"
- Weld7.Parent = Part3
- Weld7.C0 = CFrame.new(0, 0.5, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Weld7.C1 = CFrame.new(1.5, -0.5, 0.699999988, 0.0163912401, 0.999865651, 0, -0.999865651, 0.0163912401, 0, 0, 0, 1)
- Weld8.Name = "HeadWeld"
- Weld8.Parent = Part3
- Weld8.C0 = CFrame.new(0, 0.5, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Weld8.C1 = CFrame.new(2, -0.5, 0.699999988, 0, 1, 0, 1, 0, 0, 0, 0, -1)
- Weld9.Name = "HeadWeld"
- Weld9.Parent = Part3
- Weld9.C0 = CFrame.new(0, 0.5, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Weld9.C1 = CFrame.new(0, 0.5, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Weld10.Name = "HeadWeld"
- Weld10.Parent = Part3
- Weld10.C0 = CFrame.new(0, 0.5, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Weld10.C1 = CFrame.new(1.5, 0.800000012, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Weld11.Name = "HeadWeld"
- Weld11.Parent = Part3
- Weld11.C0 = CFrame.new(0, 0.5, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Weld11.C1 = CFrame.new(-1.5, -0.600000024, 0.699999988, 0.0163912401, -0.999865651, 0, 0.999865651, 0.0163912401, -0, 0, 0, 1)
- Weld12.Name = "HeadWeld"
- Weld12.Parent = Part3
- Weld12.C0 = CFrame.new(0, 0.5, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Weld12.C1 = CFrame.new(-1.5, 0.800000012, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Weld13.Name = "HeadWeld"
- Weld13.Parent = Part3
- Weld13.C0 = CFrame.new(0, 0.5, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Weld13.C1 = CFrame.new(0, 0.0500000007, 0.100000001, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part14.Name = "Left Leg"
- Part14.Parent = Model0
- Part14.CFrame = CFrame.new(20.9544754, 1.00000405, -72.0903015, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- Part14.Orientation = Vector3.new(0, 90, 0)
- Part14.Position = Vector3.new(20.9544754, 1.00000405, -72.0903015)
- Part14.Rotation = Vector3.new(0, 90, 0)
- Part14.Color = Color3.new(0.294118, 0.592157, 0.294118)
- Part14.Size = Vector3.new(1, 2, 1)
- Part14.Anchored = true
- Part14.BottomSurface = Enum.SurfaceType.Smooth
- Part14.BrickColor = BrickColor.new("Bright green")
- Part14.TopSurface = Enum.SurfaceType.Smooth
- Part14.brickColor = BrickColor.new("Bright green")
- Part14.FormFactor = Enum.FormFactor.Custom
- Part14.formFactor = Enum.FormFactor.Custom
- Part15.Name = "Right Leg"
- Part15.Parent = Model0
- Part15.CFrame = CFrame.new(19.9544754, 1.00000405, -72.0903015, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- Part15.Orientation = Vector3.new(0, 90, 0)
- Part15.Position = Vector3.new(19.9544754, 1.00000405, -72.0903015)
- Part15.Rotation = Vector3.new(0, 90, 0)
- Part15.Color = Color3.new(0.294118, 0.592157, 0.294118)
- Part15.Size = Vector3.new(1, 2, 1)
- Part15.Anchored = true
- Part15.BottomSurface = Enum.SurfaceType.Smooth
- Part15.BrickColor = BrickColor.new("Bright green")
- Part15.TopSurface = Enum.SurfaceType.Smooth
- Part15.brickColor = BrickColor.new("Bright green")
- Part15.FormFactor = Enum.FormFactor.Custom
- Part15.formFactor = Enum.FormFactor.Custom
- Part16.Parent = Model0
- Part16.CFrame = CFrame.new(20.4544754, 3.00000501, -72.0903015, -1, 0, 0, 0, 1, 0, 0, 0, -1)
- Part16.Orientation = Vector3.new(0, 180, 0)
- Part16.Position = Vector3.new(20.4544754, 3.00000501, -72.0903015)
- Part16.Rotation = Vector3.new(-180, 0, -180)
- Part16.Color = Color3.new(0.294118, 0.592157, 0.294118)
- Part16.Size = Vector3.new(2, 2, 1)
- Part16.Anchored = true
- Part16.BottomSurface = Enum.SurfaceType.Smooth
- Part16.BrickColor = BrickColor.new("Bright green")
- Part16.TopSurface = Enum.SurfaceType.Smooth
- Part16.brickColor = BrickColor.new("Bright green")
- Part16.FormFactor = Enum.FormFactor.Custom
- Part16.formFactor = Enum.FormFactor.Custom
- Script17.Name = "Health"
- Script17.Parent = Model0
- table.insert(cors,sandbox(Script17,function()
- function waitForChild(parent, childName)
- while true do
- local child = parent:findFirstChild(childName)
- if child then
- return child
- end
- parent.ChildAdded:wait()
- end
- end
- -- declarations
- local Figure = script.Parent
- local Head = waitForChild(Figure, "Head")
- local Humanoid = waitForChild(Figure, "Humanoid")
- Humanoid.Health=500
- -- regeneration
- --[[
- while true do
- local s = wait(4)
- local health = Humanoid.Health
- if health > 0 and health < Humanoid.MaxHealth then
- health = health + 0.08 * s * Humanoid.MaxHealth
- if health * 1.05 < Humanoid.MaxHealth then
- Humanoid.Health = health
- else
- Humanoid.Health = Humanoid.MaxHealth
- end
- end
- end
- --]]
- end))
- Humanoid18.Parent = Model0
- Humanoid18.LeftLeg = Part14
- Humanoid18.RightLeg = Part15
- IntValue19.Name = "Mode"
- IntValue19.Parent = Model0
- Script20.Name = "Respawn"
- Script20.Parent = Model0
- table.insert(cors,sandbox(Script20,function()
- name="Humanoid"
- robo=script.Parent:clone()
- while true do
- wait(1)
- if script.Parent.Humanoid.Health<1 then
- robot=robo:clone()
- robot.Parent=script.Parent.Parent
- robot:makeJoints()
- script.Parent:remove()
- end
- end
- end))
- Script21.Name = "Robot"
- Script21.Parent = Model0
- table.insert(cors,sandbox(Script21,function()
- ------------------
- --SPAWNING--
- ------------------
- miked=script.Parent
- itlh=miked.Torso:findFirstChild("Left Hip")
- itlh.Part0=miked.Torso
- itlh.Part1=miked:findFirstChild("Left Leg")
- itlh.C0=CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- itrh=miked.Torso:findFirstChild("Right Hip")
- itrh.Part0=miked.Torso
- itrh.Part1=miked:findFirstChild("Right Leg")
- itrh.C0=CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
- itls=miked.Torso:findFirstChild("Left Shoulder")
- itls.Part1=miked.Torso
- itls.C0=CFrame.new(2, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- itls.Part0=miked:findFirstChild("Left Arm")
- itrs=miked.Torso:findFirstChild("Right Shoulder")
- itrs.Part1=miked.Torso
- itrs.C0=CFrame.new(-2, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
- itrs.Part0=miked:findFirstChild("Right Arm")
- miked.Head:makeJoints()
- ------------------
- ------------------
- function waitForChild(parent, childName)
- while true do
- local child = parent:findFirstChild(childName)
- if child then
- return child
- end
- parent.ChildAdded:wait()
- 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 toolAnim = "None"
- local toolAnimTime = 0
- local isSeated = false
- function onRunning(speed)
- if isSeated then return end
- if speed>0 then
- pose = "Running"
- else
- pose = "Standing"
- end
- end
- function onDied()
- pose = "Dead"
- local parts = Figure:GetChildren()
- for i=1,#parts do
- if parts.className == "Part" then
- Debris.AddItem(parts[i], 60)
- end
- end
- end
- function onJumping()
- isSeated = false
- pose = "Jumping"
- end
- function onClimbing()
- pose = "Climbing"
- end
- function onGettingUp()
- pose = "GettingUp"
- end
- function onFreeFall()
- pose = "FreeFall"
- end
- function onDancing()
- pose = "Dancing"
- end
- function onFallingDown()
- pose = "FallingDown"
- end
- function onSeated()
- isSeated = true
- pose = "Seated"
- 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 = -1
- LeftShoulder.DesiredAngle = -1
- RightHip.DesiredAngle = 0
- LeftHip.DesiredAngle = 0
- end
- function moveFloat()
- RightShoulder.MaxVelocity = 0.5
- LeftShoulder.MaxVelocity = 0.5
- RightShoulder.DesiredAngle = -1.57
- LeftShoulder.DesiredAngle = 1.57
- RightHip.DesiredAngle = 1.57
- LeftHip.DesiredAngle = -1.57
- end
- function moveBoogy()
- while pose=="Boogy" do
- wait(.5)
- RightShoulder.MaxVelocity = 1
- LeftShoulder.MaxVelocity = 1
- RightShoulder.DesiredAngle = -3.14
- LeftShoulder.DesiredAngle = 0
- RightHip.DesiredAngle = 1.57
- LeftHip.DesiredAngle = 0
- wait(.5)
- RightShoulder.MaxVelocity = 1
- LeftShoulder.MaxVelocity = 1
- RightShoulder.DesiredAngle = 0
- LeftShoulder.DesiredAngle = -3.14
- RightHip.DesiredAngle = 0
- LeftHip.DesiredAngle = 1.57
- end
- end
- function moveZombie()
- RightShoulder.MaxVelocity = 0.5
- LeftShoulder.MaxVelocity = 0.5
- RightShoulder.DesiredAngle = -1.57
- LeftShoulder.DesiredAngle = 1.57
- RightHip.DesiredAngle = 0
- LeftHip.DesiredAngle = 0
- end
- function movePunch()
- script.Parent.Torso.Anchored=true
- RightShoulder.MaxVelocity = 60
- LeftShoulder.MaxVelocity = 0.5
- RightShoulder.DesiredAngle = -1.57
- LeftShoulder.DesiredAngle = 0
- RightHip.DesiredAngle = 0
- LeftHip.DesiredAngle = 0
- wait(1)
- script.Parent.Torso.Anchored=false
- pose="Standing"
- end
- function moveKick()
- RightShoulder.MaxVelocity = 0.5
- LeftShoulder.MaxVelocity = 0.5
- RightShoulder.DesiredAngle = 0
- LeftShoulder.DesiredAngle = 0
- RightHip.MaxVelocity = 40
- RightHip.DesiredAngle = 1.57
- LeftHip.DesiredAngle = 0
- wait(1)
- pose="Standing"
- end
- function moveFly()
- RightShoulder.MaxVelocity = 0.5
- LeftShoulder.MaxVelocity = 0.5
- RightShoulder.DesiredAngle = 0
- LeftShoulder.DesiredAngle = 0
- RightHip.MaxVelocity = 40
- RightHip.DesiredAngle = 1.57
- LeftHip.DesiredAngle = 0
- wait(1)
- pose="Standing"
- end
- function moveClimb()
- 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 getTool()
- kidTable = Figure:children()
- if (kidTable ~= nil) then
- numKids = #kidTable
- for i=1,numKids do
- if (kidTable[i].className == "Tool") then return kidTable[i] end
- end
- end
- return nil
- end
- function getToolAnim(tool)
- c = tool:children()
- for i=1,#c do
- if (c[i].Name == "toolanim" and c[i].className == "StringValue") then
- return c[i]
- end
- end
- return nil
- end
- function animateTool()
- if (toolAnim == "None") then
- RightShoulder.DesiredAngle = -1.57
- return
- end
- if (toolAnim == "Slash") then
- RightShoulder.MaxVelocity = 0.5
- RightShoulder.DesiredAngle = 0
- return
- end
- if (toolAnim == "Lunge") then
- RightShoulder.MaxVelocity = 0.5
- LeftShoulder.MaxVelocity = 0.5
- RightHip.MaxVelocity = 0.5
- LeftHip.MaxVelocity = 0.5
- RightShoulder.DesiredAngle = -1.57
- LeftShoulder.DesiredAngle = 1.0
- RightHip.DesiredAngle = 1.57
- LeftHip.DesiredAngle = 1.0
- return
- end
- end
- function move(time)
- local amplitude
- local frequency
- if (pose == "Jumping") then
- moveJump()
- return
- end
- if (pose == "Zombie") then
- moveZombie()
- return
- end
- if (pose == "Boogy") then
- moveBoogy()
- return
- end
- if (pose == "Float") then
- moveFloat()
- return
- end
- if (pose == "Punch") then
- movePunch()
- return
- end
- if (pose == "Kick") then
- moveKick()
- return
- end
- if (pose == "Fly") then
- moveFly()
- return
- end
- if (pose == "FreeFall") then
- moveFreeFall()
- return
- end
- if (pose == "Climbing") then
- moveClimb()
- return
- end
- if (pose == "Seated") then
- moveSit()
- return
- end
- amplitude = 0.1
- frequency = 1
- RightShoulder.MaxVelocity = 0.15
- LeftShoulder.MaxVelocity = 0.15
- if (pose == "Running") then
- amplitude = 1
- frequency = 9
- elseif (pose == "Dancing") then
- amplitude = 2
- frequency = 16
- end
- desiredAngle = amplitude * math.sin(time*frequency)
- if pose~="Dancing" then
- RightShoulder.DesiredAngle = -desiredAngle
- LeftShoulder.DesiredAngle = desiredAngle
- RightHip.DesiredAngle = -desiredAngle
- LeftHip.DesiredAngle = -desiredAngle
- else
- RightShoulder.DesiredAngle = -desiredAngle
- LeftShoulder.DesiredAngle = desiredAngle
- RightHip.DesiredAngle = -desiredAngle
- LeftHip.DesiredAngle = -desiredAngle
- end
- local tool = getTool()
- if tool ~= nil then
- animStringValueObject = getToolAnim(tool)
- if animStringValueObject ~= nil 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
- toolAnim = "None"
- toolAnimTime = 0
- end
- end
- -- connect events
- -----------------------------------------------------------------------------------------------------------------------
- function unequip()
- local items=script.Parent:children()
- for i=1, #items do
- if items[i].className=="Tool" then items[i]:remove() end
- end
- end
- -----------------------------------------------------------------------------------------------------------------------
- -----------------------------------------------------------------------------------------------------------------------
- -----------------------------------------------------------------------------------------------------------------------
- -----------------------------------------------------------------------------------------------------------------------
- -----------------------------------------------------------------------------------------------------------------------
- -----------------------------------------------------------------------------------------------------------------------
- -----------------------------------------------------------------------------------------------------------------------
- -----------------------------------------------------------------------------------------------------------------------
- -----------------------------------------------------------------------------------------------------------------------
- -----------------------------------------------------------------------------------------------------------------------
- -----------------------------------------------------------------------------------------------------------------------
- -----------------------------------------------------------------------------------------------------------------------
- dist=20
- function followany()
- following=true
- while following==true do
- local ch=game.Players:children()
- for i=1, #ch do
- local l=game.Workspace:findFirstChild(ch[i].Name)
- if l~=nil then
- local s=l.Torso
- local p=l.Torso.Position
- local q=script.Parent.Torso.Position
- local d=math.sqrt( ((p.x-q.x)^2)+((p.y-q.y)^2)+((p.z-q.z)^2) )
- if smallest==nil then
- smallest=d
- target=s
- elseif d<smallest then
- smallest=d
- target=s
- end
- end
- end
- if smallest==nil then stopmoving() return end
- if smallest>6*dist then return end
- script.Parent.Humanoid:MoveTo(target.Position, target)
- wait(0.5)
- for i=1, 6 do
- if target.Parent.Humanoid.Health<1 then stopmoving() else wait(0.5) end
- end
- end
- end
- function gohome()
- script.Parent.Humanoid:MoveTo(Vector3.new(0,0,0), game.Workspace.Bases.Base)
- end
- function stopmoving()
- script.Parent.Humanoid:MoveTo(script.Parent.Torso.Position, script.Parent.Torso)
- end
- function follow(name)
- following=true
- local p=game.Workspace:findFirstChild(name)
- if p==nil then return end
- while following==true do
- script.Parent.Humanoid:MoveTo(p.Torso.Position, p.Torso)
- wait(0.5)
- for i=1, 3 do
- if p.Humanoid.Health<1 then following=false; stopmoving() return end
- wait(0.5)
- end
- 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)
- --[[
- function newSound(id)
- local sound = Instance.new("Sound")
- sound.SoundId = id
- sound.Parent = script.Parent.Head
- return sound
- end
- local sDied = newSound("rbxasset://sounds/uuhhh.wav")
- 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")
- function onDied()
- sDied:play()
- 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
- 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)
- --]]
- local nextTime = 0
- local runService = game:service("RunService");
- while Figure.Parent~=nil do
- time = runService.Stepped:wait()
- if time > nextTime then
- move(time)
- nextTime = time + 0.1
- end
- end
- end))
- Script22.Parent = Model0
- table.insert(cors,sandbox(Script22,function()
- local larm = script.Parent:FindFirstChild("Left Arm")
- local rarm = script.Parent:FindFirstChild("Right Arm")
- function findNearestTorso(pos)
- local list = game.Workspace:children()
- local torso = nil
- local dist = 1000
- local temp = nil
- local human = nil
- local temp2 = nil
- for x = 1, #list do
- temp2 = list[x]
- if (temp2.className == "Model") and (temp2 ~= script.Parent) then
- temp = temp2:findFirstChild("Torso")
- human = temp2:findFirstChild("Humanoid")
- if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
- if (temp.Position - pos).magnitude < dist then
- torso = temp
- dist = (temp.Position - pos).magnitude
- end
- end
- end
- end
- return torso
- end
- while true do
- wait(math.random(1,5))
- --local target = findNearestTorso(script.Parent.Torso.Position)
- --if target ~= nil then
- -- script.Parent.Zombie:MoveTo(target.Position, target)
- --end
- script.Parent.Humanoid:MoveTo(Vector3.new(math.random(-100,100),0,math.random(-100,100)), game.Workspace.Base)
- end
- end))
- Script23.Name = "Sound"
- Script23.Parent = Model0
- table.insert(cors,sandbox(Script23,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")
- 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()
- 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))
- 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