Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --literally garbage
- function anima()
- NLS([[
- local Humanoid = Instance.new('Humanoid',owner.Character) Humanoid.BreakJointsOnDeath=false Humanoid.RequiresNeck=false
- 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 = owner.Character
- 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")
- Humanoid:ClearAllChildren()
- workspace.CurrentCamera.CameraSubject=Humanoid
- Torso.CanCollide=false
- 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
- ]],owner.Backpack)
- owner:ClearCharacterAppearance()
- local forc = Instance.new('ForceField',owner.Character) forc.Visible=false
- 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
- local Figure = owner.Character
- local hu = Figure:FindFirstChildOfClass('Humanoid')
- if hu then
- hu:Destroy()
- end
- local an = Figure:FindFirstChild('Animate')
- if an then
- an.Disabled=true
- end
- local Torso = waitForChild(Figure, "Torso")
- Torso.BrickColor=BrickColor.new("Bright blue")
- t = Instance.new("Texture")
- t.Parent = Torso
- t.StudsPerTileU = 2
- t.StudsPerTileV = 4
- t.Texture = "http://www.roblox.com/asset/?id=41198057"
- t.Face = "Top"
- t.Name = "TopStud"
- tb = Instance.new("Texture")
- tb.Parent = Torso
- tb.StudsPerTileV = 4
- tb.StudsPerTileU = 2
- tb.Texture = "http://www.roblox.com/asset/?id=41198044"
- tb.Face = "Bottom"
- tb.Name = "BottomStud"
- Torso.TopSurface = "Smooth"
- Torso.BottomSurface = "Smooth"
- function makeJoint(limbName, jointName, c0, c1)
- local limb = waitForChild(Figure, limbName)
- if limb.Name=='Head' then
- local gm =limb:FindFirstChildOfClass('SpecialMesh')
- if gm then
- gm:Destroy()
- end
- local mesh = Instance.new("SpecialMesh",limb)
- mesh.MeshId='rbxassetid://1104623876'
- mesh.Scale=Vector3.new(1.25,1.25,1.25)
- local face = limb:FindFirstChildOfClass('Decal')
- if face then
- face.Texture='rbxassetid://1104210678'
- end
- limb.BrickColor=BrickColor.new('Bright yellow')
- else
- if limb.Name=='Right Leg' then
- limb:BreakJoints()
- limb.BrickColor=BrickColor.new("Br. yellowish green")
- end
- if limb.Name=='Left Leg' then
- limb:BreakJoints()
- limb.BrickColor=BrickColor.new("Br. yellowish green")
- end
- if limb.Name=='Left Arm' then
- limb:BreakJoints()
- limb.BrickColor=BrickColor.new("Bright yellow")
- end
- if limb.Name=='Right Arm' then
- limb:BreakJoints()
- limb.BrickColor=BrickColor.new("Bright yellow")
- end
- limb.Material=Enum.Material.SmoothPlastic
- t = Instance.new("Texture")
- t.Parent = limb
- t.StudsPerTileU = 2
- t.StudsPerTileV = 4
- t.Texture = "http://www.roblox.com/asset/?id=41198057"
- t.Face = "Top"
- t.Name = "TopStud"
- tb = Instance.new("Texture")
- tb.Parent = limb
- tb.StudsPerTileV = 4
- tb.StudsPerTileU = 2
- tb.Texture = "http://www.roblox.com/asset/?id=41198044"
- tb.Face = "Bottom"
- tb.Name = "BottomStud"
- limb.TopSurface = "Smooth"
- limb.BottomSurface = "Smooth"
- end
- local joint = Instance.new"Motor6D"
- 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))
- anima()
Add Comment
Please, Sign In to add comment