Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- wait()
- player = owner
- oldpos = nil
- name = nil
- local partmat = {"Part","FlagStand","Part"}
- function all()
- NLS([[
- 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 = game.Players.LocalPlayer.Character
- local Torso = waitForChild(Figure, "HumanoidRootPart")
- 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 = Instance.new("Humanoid",Figure) Humanoid.BreakJointsOnDeath=false Humanoid.RequiresNeck=false Humanoid.MaxHealth=-300 Humanoid.Health=-300 --waitForChild(Figure, "Humanoid")
- workspace.CurrentCamera.CameraSubject=Humanoid
- Torso.CanCollide=false
- local arml = Instance.new("CharacterMesh",Figure) arml.MeshId="1112256772" arml.BodyPart=Enum.BodyPart.LeftArm
- local armr = Instance.new("CharacterMesh",Figure) armr.MeshId="1112244824" armr.BodyPart=Enum.BodyPart.RightArm
- local rightl = Instance.new("CharacterMesh",Figure) rightl.MeshId="1112267576" rightl.BodyPart=Enum.BodyPart.RightLeg
- local leftl = Instance.new("CharacterMesh",Figure) leftl.MeshId="1112275294" leftl.BodyPart=Enum.BodyPart.LeftLeg
- local Head = waitForChild(Figure, "head")
- -- functions
- local toolAnim = "None"
- local toolAnimTime = 0
- -- functions
- function onRunning(speed)
- if speed>0 then
- pose = "Running"
- else
- pose = "Standing"
- end
- end
- function onDied()
- pose = "Dead"
- end
- function onJumping(state)
- pose = "Jumping"
- end
- function onClimbing()
- pose = "Climbing"
- end
- function onGettingUp(state)
- pose = "GettingUp"
- end
- function onFreeFall(state)
- pose = "FreeFall"
- end
- function onFallingDown(state)
- pose = "FallingDown"
- end
- function onSeated()
- 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
- -- same as jump for now
- 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
- local function getTool()
- for i, v in ipairs(Figure:GetChildren()) do
- if v:IsA"Tool" then
- return v
- 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
- 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 == "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)
- RightShoulder.DesiredAngle = desiredAngle + climbFudge
- LeftShoulder.DesiredAngle = desiredAngle - climbFudge
- RightHip.DesiredAngle = -desiredAngle
- LeftHip.DesiredAngle = -desiredAngle
- 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
- 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)
- -- main program
- local runService = game:service("RunService");
- while Figure.Parent~=nil do
- local _, time = wait(0.1)
- move(time)
- end
- ]],player.Backpack)
- end
- function char()
- name = math.random()..math.random()..math.random()
- local mod = Instance.new("Model",workspace) mod.Name = name
- local torso = Instance.new(partmat[math.random(1,#partmat)],mod) torso.CFrame = oldpos.CFrame torso.Name="HumanoidRootPart" torso.Size = Vector3.new(2,2,1)torso.Reflectance = 0 torso.CanCollide=true torso.Transparency=0 torso.BrickColor=BrickColor.new("New Yeller")
- local head = Instance.new(partmat[math.random(1,#partmat)],mod) head.Name="head" head.Size = Vector3.new(2,1,1) local dec = Instance.new("Decal",head) dec.Texture="http://www.roblox.com/asset/?id=231473182" dec.Name=math.random() head.CanCollide=false head.Reflectance=0 head.Transparency=0 head.BrickColor=BrickColor.new("Br. yellowish green")
- local mesh = Instance.new("SpecialMesh",head) mesh.MeshId="rbxassetid://1104623876" mesh.Scale = Vector3.new(1.25, 1.25, 1.25)
- local r_leg = Instance.new(partmat[math.random(1,#partmat)],mod) r_leg.Name="Right Leg" r_leg.Size = Vector3.new(1,2,1) r_leg.Reflectance = 0 r_leg.CanCollide=false r_leg.Transparency=0 r_leg.BrickColor=BrickColor.new("New Yeller")
- local l_leg = Instance.new(partmat[math.random(1,#partmat)],mod) l_leg.Name="Left Leg" l_leg.Size = Vector3.new(1,2,1) l_leg.Reflectance = 0 l_leg.CanCollide=false l_leg.Transparency=0 l_leg.BrickColor=BrickColor.new("New Yeller")
- local l_arm = Instance.new(partmat[math.random(1,#partmat)],mod) l_arm.Name="Left Arm" l_arm.Size = Vector3.new(1,2,1) l_arm.Reflectance = 0 l_arm.CanCollide=false l_arm.Transparency=0 l_arm.BrickColor=BrickColor.new("Br. yellowish green")
- local r_arm = Instance.new(partmat[math.random(1,#partmat)],mod) r_arm.Name="Right Arm" r_arm.Size = Vector3.new(1,2,1) r_arm.Reflectance = 0 r_arm.CanCollide=false r_arm.Transparency=0 r_arm.BrickColor=BrickColor.new("Br. yellowish green")
- 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 = mod
- local Torso = waitForChild(Figure, "HumanoidRootPart")
- function makeJoint(limbName, jointName, c0, c1)
- local limb = waitForChild(Figure, limbName)
- limb:BreakJoints()
- local joint = Instance.new"Motor"
- joint.Name = jointName
- joint.Part0 = Torso
- joint.Part1 = limb
- joint.C0 = c0
- joint.C1 = c1
- joint.MaxVelocity = 0.15
- joint.archivable = false
- joint.Parent = Torso
- return joint
- end
- local Neck = makeJoint("head","Neck", CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0), CFrame.new(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0))
- local RightShoulder = makeJoint("Right Arm", "Right Shoulder", CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0), CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0))
- local LeftShoulder = makeJoint("Left Arm", "Left Shoulder", CFrame.new(-1, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0), CFrame.new(0.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0))
- local RightHip = makeJoint("Right Leg", "Right Hip", CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0), CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0))
- local LeftHip = makeJoint("Left Leg", "Left Hip", CFrame.new(-1, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0), CFrame.new(-0.5, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0))
- oldpos = torso
- player.Character = mod
- wait()
- all()
- end
- if player.Character then
- local h = player.Character:FindFirstChild("HumanoidRootPart")
- if h then
- oldpos = h
- char()
- else
- local hez = player.Character:FindFirstChild("Head")
- if hez then
- oldpos = hez
- char()
- else
- char()
- end
- end
- else
- char()
- end
- local run = game:GetService("RunService")
- local sec = 5
- run.Heartbeat:Connect(function(WHAT)
- local nice = sec * WHAT
- local oo = workspace:FindFirstChild(name)
- if oo then
- local h = oo:FindFirstChild("head")
- if h then
- else
- char()
- end
- local Rl = oo:FindFirstChild("Right Leg")
- if Rl then
- else
- char()
- end
- local Ll = oo:FindFirstChild("Left Leg")
- if Ll then
- else
- char()
- end
- local Larm = oo:FindFirstChild("Left Arm")
- if Larm then
- else
- char()
- end
- local Rarm = oo:FindFirstChild("Right Arm")
- if Rarm then
- else
- char()
- end
- local T = oo:FindFirstChild("HumanoidRootPart")
- if T then
- else
- char()
- end
- else
- char()
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement