Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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")
- Decal3 = Instance.new("Decal")
- Part4 = Instance.new("Part")
- Decal5 = Instance.new("Decal")
- Motor6D6 = Instance.new("Motor6D")
- Motor6D7 = Instance.new("Motor6D")
- Motor6D8 = Instance.new("Motor6D")
- Motor6D9 = Instance.new("Motor6D")
- Motor6D10 = Instance.new("Motor6D")
- Fire11 = Instance.new("Fire")
- Script12 = Instance.new("Script")
- Part13 = Instance.new("Part")
- Part14 = Instance.new("Part")
- Part15 = Instance.new("Part")
- Fire16 = Instance.new("Fire")
- Script17 = Instance.new("Script")
- Part18 = Instance.new("Part")
- Fire19 = Instance.new("Fire")
- Script20 = Instance.new("Script")
- Humanoid21 = Instance.new("Humanoid")
- IntValue22 = Instance.new("IntValue")
- Script23 = Instance.new("Script")
- Script24 = Instance.new("Script")
- Script25 = Instance.new("Script")
- Script26 = Instance.new("Script")
- Model0.Name = "Noob Dummy"
- Model0.Parent = mas
- Model0.PrimaryPart = Part1
- Part1.Name = "Head"
- Part1.Parent = Model0
- Part1.BrickColor = BrickColor.new("New Yeller")
- Part1.Rotation = Vector3.new(0, -0.819999993, 0)
- Part1.FormFactor = Enum.FormFactor.Symmetric
- Part1.Size = Vector3.new(2, 1, 1)
- Part1.CFrame = CFrame.new(-60.4040413, 4.5000329, 85.1289978, 0.999896824, -4.08622753e-07, -0.0143436985, 4.07144455e-07, 1, -1.05978017e-07, 0.0143436985, 1.00128666e-07, 0.999896824)
- Part1.TopSurface = Enum.SurfaceType.Smooth
- Part1.Color = Color3.new(1, 1, 0)
- Part1.Position = Vector3.new(-60.4040413, 4.5000329, 85.1289978)
- Part1.Orientation = Vector3.new(0, -0.819999993, 0)
- Part1.Color = Color3.new(1, 1, 0)
- SpecialMesh2.Parent = Part1
- SpecialMesh2.Scale = Vector3.new(1.25, 1.25, 1.25)
- SpecialMesh2.Scale = Vector3.new(1.25, 1.25, 1.25)
- Decal3.Parent = Part1
- Decal3.Texture = "rbxassetid://143939169"
- Part4.Name = "Torso"
- Part4.Parent = Model0
- Part4.BrickColor = BrickColor.new("Really blue")
- Part4.Rotation = Vector3.new(0, -0.819999993, 0)
- Part4.FormFactor = Enum.FormFactor.Symmetric
- Part4.Size = Vector3.new(2, 2, 1)
- Part4.CFrame = CFrame.new(-60.4040413, 3.0000329, 85.1289978, 0.999896824, -4.08622753e-07, -0.0143436985, 4.07144455e-07, 1, -1.05978017e-07, 0.0143436985, 1.00128666e-07, 0.999896824)
- Part4.LeftSurface = Enum.SurfaceType.Weld
- Part4.RightSurface = Enum.SurfaceType.Weld
- Part4.Color = Color3.new(0, 0, 1)
- Part4.Position = Vector3.new(-60.4040413, 3.0000329, 85.1289978)
- Part4.Orientation = Vector3.new(0, -0.819999993, 0)
- Part4.Color = Color3.new(0, 0, 1)
- Decal5.Name = "roblox"
- Decal5.Parent = Part4
- Motor6D6.Name = "Right Shoulder"
- Motor6D6.Parent = Part4
- Motor6D6.C0 = CFrame.new(-2, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- Motor6D6.C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- Motor6D6.Part0 = Part14
- Motor6D6.Part1 = Part4
- Motor6D6.MaxVelocity = 0.15000000596046
- Motor6D7.Name = "Left Shoulder"
- Motor6D7.Parent = Part4
- Motor6D7.C0 = CFrame.new(2, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- Motor6D7.C1 = CFrame.new(0.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- Motor6D7.Part0 = Part13
- Motor6D7.Part1 = Part4
- Motor6D7.MaxVelocity = 0.15000000596046
- Motor6D8.Name = "Right Hip"
- Motor6D8.Parent = Part4
- Motor6D8.C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- Motor6D8.C1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- Motor6D8.Part0 = Part4
- Motor6D8.Part1 = Part18
- Motor6D8.MaxVelocity = 0.10000000149012
- Motor6D9.Name = "Left Hip"
- Motor6D9.Parent = Part4
- Motor6D9.C0 = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- Motor6D9.C1 = CFrame.new(-0.5, 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- Motor6D9.Part0 = Part4
- Motor6D9.Part1 = Part15
- Motor6D9.MaxVelocity = 0.10000000149012
- Motor6D10.Name = "Neck"
- Motor6D10.Parent = Part4
- Motor6D10.C0 = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Motor6D10.C1 = CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Motor6D10.Part0 = Part4
- Motor6D10.Part1 = Part1
- Motor6D10.MaxVelocity = 0.10000000149012
- Fire11.Parent = Part4
- Fire11.Size = 30
- Fire11.Color = Color3.new(1, 0.678431, 0)
- Fire11.Enabled = false
- Fire11.Heat = 25
- Fire11.SecondaryColor = Color3.new(1, 0, 0)
- Fire11.Color = Color3.new(1, 0.678431, 0)
- Script12.Name = "Spread"
- Script12.Parent = Fire11
- table.insert(cors,sandbox(Script12,function()
- function Spread(part)
- check = part:findFirstChild("Fire")
- if check == nil then
- script.Parent:Clone().Parent = part
- elseif check ~= nil then
- check.Size = check.Size + 1000000
- check.Heat = check.Heat +1000000
- end
- end
- script.Parent.Parent.Touched:connect(Spread)
- end))
- Part13.Name = "Left Arm"
- Part13.Parent = Model0
- Part13.BrickColor = BrickColor.new("New Yeller")
- Part13.Rotation = Vector3.new(0, -0.819999993, 0)
- Part13.CanCollide = false
- Part13.FormFactor = Enum.FormFactor.Symmetric
- Part13.Size = Vector3.new(1, 2, 1)
- Part13.CFrame = CFrame.new(-61.9038849, 3.00003219, 85.1074829, 0.999896824, -4.08622753e-07, -0.0143436985, 4.07144455e-07, 1, -1.05978017e-07, 0.0143436985, 1.00128666e-07, 0.999896824)
- Part13.Color = Color3.new(1, 1, 0)
- Part13.Position = Vector3.new(-61.9038849, 3.00003219, 85.1074829)
- Part13.Orientation = Vector3.new(0, -0.819999993, 0)
- Part13.Color = Color3.new(1, 1, 0)
- Part14.Name = "Right Arm"
- Part14.Parent = Model0
- Part14.BrickColor = BrickColor.new("New Yeller")
- Part14.Rotation = Vector3.new(0, -0.819999993, 0)
- Part14.CanCollide = false
- Part14.FormFactor = Enum.FormFactor.Symmetric
- Part14.Size = Vector3.new(1, 2, 1)
- Part14.CFrame = CFrame.new(-58.9041977, 3.00003362, 85.1505127, 0.999896824, -4.08622753e-07, -0.0143436985, 4.07144455e-07, 1, -1.05978017e-07, 0.0143436985, 1.00128666e-07, 0.999896824)
- Part14.Color = Color3.new(1, 1, 0)
- Part14.Position = Vector3.new(-58.9041977, 3.00003362, 85.1505127)
- Part14.Orientation = Vector3.new(0, -0.819999993, 0)
- Part14.Color = Color3.new(1, 1, 0)
- Part15.Name = "Left Leg"
- Part15.Parent = Model0
- Part15.BrickColor = BrickColor.new("Lime green")
- Part15.Rotation = Vector3.new(0, -0.819999993, 0)
- Part15.CanCollide = false
- Part15.FormFactor = Enum.FormFactor.Symmetric
- Part15.Size = Vector3.new(1, 2, 1)
- Part15.CFrame = CFrame.new(-60.9039879, 1.00003266, 85.1218262, 0.999896824, -4.08622753e-07, -0.0143436985, 4.07144455e-07, 1, -1.05978017e-07, 0.0143436985, 1.00128666e-07, 0.999896824)
- Part15.BottomSurface = Enum.SurfaceType.Smooth
- Part15.Color = Color3.new(0, 1, 0)
- Part15.Position = Vector3.new(-60.9039879, 1.00003266, 85.1218262)
- Part15.Orientation = Vector3.new(0, -0.819999993, 0)
- Part15.Color = Color3.new(0, 1, 0)
- Fire16.Parent = Part15
- Fire16.Size = 30
- Fire16.Color = Color3.new(1, 0.678431, 0)
- Fire16.Enabled = false
- Fire16.Heat = 25
- Fire16.SecondaryColor = Color3.new(1, 0, 0)
- Fire16.Color = Color3.new(1, 0.678431, 0)
- Script17.Name = "Spread"
- Script17.Parent = Fire16
- table.insert(cors,sandbox(Script17,function()
- function Spread(part)
- check = part:findFirstChild("Fire")
- if check == nil then
- script.Parent:Clone().Parent = part
- elseif check ~= nil then
- check.Size = check.Size + 1000000
- check.Heat = check.Heat +1000000
- end
- end
- script.Parent.Parent.Touched:connect(Spread)
- end))
- Part18.Name = "Right Leg"
- Part18.Parent = Model0
- Part18.BrickColor = BrickColor.new("Lime green")
- Part18.Rotation = Vector3.new(0, -0.819999993, 0)
- Part18.CanCollide = false
- Part18.FormFactor = Enum.FormFactor.Symmetric
- Part18.Size = Vector3.new(1, 2, 1)
- Part18.CFrame = CFrame.new(-59.9040909, 1.00003314, 85.1361694, 0.999896824, -4.08622753e-07, -0.0143436985, 4.07144455e-07, 1, -1.05978017e-07, 0.0143436985, 1.00128666e-07, 0.999896824)
- Part18.BottomSurface = Enum.SurfaceType.Smooth
- Part18.Color = Color3.new(0, 1, 0)
- Part18.Position = Vector3.new(-59.9040909, 1.00003314, 85.1361694)
- Part18.Orientation = Vector3.new(0, -0.819999993, 0)
- Part18.Color = Color3.new(0, 1, 0)
- Fire19.Parent = Part18
- Fire19.Size = 30
- Fire19.Color = Color3.new(1, 0.678431, 0)
- Fire19.Enabled = false
- Fire19.Heat = 25
- Fire19.SecondaryColor = Color3.new(1, 0, 0)
- Fire19.Color = Color3.new(1, 0.678431, 0)
- Script20.Name = "Spread"
- Script20.Parent = Fire19
- table.insert(cors,sandbox(Script20,function()
- function Spread(part)
- check = part:findFirstChild("Fire")
- if check == nil then
- script.Parent:Clone().Parent = part
- elseif check ~= nil then
- check.Size = check.Size + 1000000
- check.Heat = check.Heat +1000000
- end
- end
- script.Parent.Parent.Touched:connect(Spread)
- end))
- Humanoid21.Parent = Model0
- Humanoid21.RightLeg = Part18
- Humanoid21.LeftLeg = Part15
- Humanoid21.Torso = Part4
- IntValue22.Name = "Mode"
- IntValue22.Parent = Model0
- Script23.Name = "Move"
- Script23.Parent = Model0
- table.insert(cors,sandbox(Script23,function()
- local CurrentPart = nil
- local MaxInc = 16
- function onTouched(hit)
- if hit.Parent == nil then
- return
- end
- local humanoid = hit.Parent:findFirstChild("Humanoid")
- if humanoid == nil then
- CurrentPart = hit
- end
- end
- function waitForChild(parent, childName)
- local child = parent:findFirstChild(childName)
- if child then
- return child
- end
- while true do
- print(childName)
- child = parent.ChildAdded:wait()
- if child.Name==childName then
- return child
- end
- end
- end
- local Figure = script.Parent
- local Humanoid = waitForChild(Figure, "Humanoid")
- local Torso = waitForChild(Figure, "Torso")
- local Left = waitForChild(Figure, "Left Leg")
- local Right = waitForChild(Figure, "Right Leg")
- Humanoid.Jump = true
- Left.Touched:connect(onTouched)
- Right.Touched:connect(onTouched)
- while true do
- wait(math.random(2, 6))
- if CurrentPart ~= nil then
- if math.random(1, 2) == 1 then
- Humanoid.Jump = false
- end
- Humanoid:MoveTo(Torso.Position + Vector3.new(math.random(-MaxInc, MaxInc), 0, math.random(-MaxInc, MaxInc)), CurrentPart)
- end
- end
- end))
- Script24.Name = "Animation"
- Script24.Parent = Model0
- table.insert(cors,sandbox(Script24,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.1
- LeftShoulder.DesiredAngle = -3.1
- RightHip.DesiredAngle = 0
- LeftHip.DesiredAngle = 0
- end
- function moveFreeFall()
- RightShoulder.MaxVelocity = 0.5
- LeftShoulder.MaxVelocity = 0.5
- RightShoulder.DesiredAngle = 3.1
- LeftShoulder.DesiredAngle = -3.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 - 4.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))
- Script25.Name = "Respawn"
- Script25.Parent = Model0
- table.insert(cors,sandbox(Script25,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))
- Script26.Parent = Model0
- table.insert(cors,sandbox(Script26,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))
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = game:GetService("Players").LocalPlayer.Character
- 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