Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print'https://pastebin.com/8JMb5Xzv'
- local function Make_R6_Rig()
- local runs = game:GetService("RunService")
- local dum_number = 1
- local is_running = false
- local is_jumpping = false
- local dummy_mod = Instance.new("Model",workspace)
- for _,v in pairs(workspace:GetChildren())do
- local vn = v.Name
- if vn:sub(1,6):lower()=='dummy_'then
- local num = tonumber(vn:sub(7))
- if num then
- if num>dum_number then
- dum_number = num + 1
- end
- end
- end
- end
- dummy_mod.Name = 'Dummy_'.. dum_number
- local humanoid = Instance.new("Humanoid",dummy_mod)
- local head = Instance.new("Part",dummy_mod)
- head.Name = 'Head'
- head.Size = Vector3.new(2, 1, 1)
- local sm_1 = Instance.new("SpecialMesh",head)
- sm_1.Scale = Vector3.new(1.25,1.25,1.25)
- local face = Instance.new("Decal",head)
- face.Name = 'Face'
- face.Texture = 'rbxassetid://288072938'
- local hrp = Instance.new("Part",dummy_mod)
- hrp.Size = Vector3.new(2, 2, 1)
- hrp.Name = 'HumanoidRootPart'
- hrp.Transparency = 1
- dummy_mod.PrimaryPart = hrp
- local larm = Instance.new("Part",dummy_mod)
- larm.Name = 'Left Arm'
- larm.Size = Vector3.new(1, 2, 1)
- local lleg = Instance.new("Part",dummy_mod)
- lleg.Name = 'Left Leg'
- lleg.Size = Vector3.new(1, 2, 1)
- local rarm = Instance.new("Part",dummy_mod)
- rarm.Name = 'Right Arm'
- rarm.Size = Vector3.new(1, 2, 1)
- local rleg = Instance.new("Part",dummy_mod)
- rleg.Name = 'Right Leg'
- rleg.Size = Vector3.new(1, 2, 1)
- local torso = Instance.new("Part",dummy_mod)
- torso.Name = 'Torso'
- torso.Size = Vector3.new(2, 2, 1)
- local rh = Instance.new("Motor6D",hrp)
- rh.Name = 'Root Hip'
- rh.C1 = CFrame.new(0, 0, 0)
- rh.MaxVelocity = .1
- rh.Part0 = hrp
- rh.Part1 = torso
- local neck = Instance.new("Motor6D",torso)
- neck.Name = 'Neck'
- neck.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- neck.C1 = CFrame.new(0, -1.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- neck.MaxVelocity = .1
- neck.Part0 = torso
- neck.Part1 = head
- local r_s = Instance.new("Motor6D",torso)
- r_s.Name = 'Right Shoulder'
- r_s.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- r_s.C1 = CFrame.new(-1.5, 0, -2.98023224e-08, -0.999999881, 0, 0, 0, 1.78813934e-07, 1, 0, 1, -1.78813934e-07)
- r_s.MaxVelocity = .1
- r_s.Part0 = torso
- r_s.Part1 = rarm
- local l_s = Instance.new("Motor6D",torso)
- l_s.Name = 'Left Shoulder'
- l_s.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- l_s.C1 = CFrame.new(1.5, 0, -2.98023224e-08, -0.999999881, 0, 0, 0, 0, 1, 0, 1, 0)
- l_s.MaxVelocity = .1
- l_s.Part0 = torso
- l_s.Part1 = larm
- local r_h = Instance.new("Motor6D",torso)
- r_h.Name = 'Right Hip'
- r_h.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- r_h.C1 = CFrame.new(-0.5, 2, -1.1920929e-07, -0.99999994, 0, 0, 0, 5.56362707e-08, 1, 0, 1, -5.56362707e-08)
- r_h.MaxVelocity = .1
- r_h.Part0 = torso
- r_h.Part1 = rleg
- local l_h = Instance.new("Motor6D",torso)
- l_h.Name = 'Left Hip'
- l_h.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- l_h.C1 = CFrame.new(0.5, 2, -1.1920929e-07, -0.99999994, 0, 0, 0, 5.56362707e-08, 1, 0, 1, -5.56362707e-08)
- l_h.MaxVelocity = .1
- l_h.Part0 = torso
- l_h.Part1 = lleg
- local bodycolors = Instance.new("BodyColors",dummy_mod)
- local function Noob_Rig()
- if bodycolors then
- bodycolors.HeadColor = BrickColor.new("New Yeller")
- bodycolors.LeftArmColor = BrickColor.new("New Yeller")
- bodycolors.RightArmColor = BrickColor.new("New Yeller")
- bodycolors.LeftLegColor = BrickColor.new("Forest green")
- bodycolors.RightLegColor = BrickColor.new("Forest green")
- bodycolors.TorsoColor = BrickColor.new("Dark blue")
- end
- end
- Noob_Rig()
- local function Anim_Stand()
- rh.C1 = CFrame.new(0, 0, 0)
- local increment = 2.5
- for i=1,increment do
- neck.C0 = neck.C0:Lerp( CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment )
- neck.C1 = neck.C1:Lerp( CFrame.new(0, -1.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment )
- r_s.C0 = r_s.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment )
- r_s.C1 = r_s.C1:Lerp(CFrame.new(-1.5, 0, -2.98023224e-08, -0.999999881, 0, 0, 0, 1.78813934e-07, 1, 0, 1, -1.78813934e-07),i/increment )
- r_h.C0 = r_h.C0:Lerp( CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment )
- r_h.C1 = r_h.C1:Lerp( CFrame.new(-0.5, 2, -1.1920929e-07, -0.99999994, 0, 0, 0, 5.56362707e-08, 1, 0, 1, -5.56362707e-08),i/increment )
- l_s.C0 = l_s.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment )
- l_s.C1 = l_s.C1:Lerp(CFrame.new(1.5, 0, -2.98023224e-08, -0.999999881, 0, 0, 0, 0, 1, 0, 1, 0),i/increment )
- l_h.C0 = l_h.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment )
- l_h.C1 = l_h.C1:Lerp(CFrame.new(0.5, 2, -1.1920929e-07, -0.99999994, 0, 0, 0, 5.56362707e-08, 1, 0, 1, -5.56362707e-08),i/increment )
- wait(.0001)
- end
- end
- local function Anim_Sit()
- local rh_end_pos = CFrame.new(0, 0, 0)
- local increment = 2.5
- rh.C1 = rh_end_pos
- for i=1,increment do
- r_s.C0 = r_s.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment )
- r_s.C1 = r_s.C1:Lerp(CFrame.new(-1.5, 0.5, 0.5, -0.99999994, 0, 0, 0, 1, -2.2252533e-07, 0, -2.2252533e-07, -1),i/increment )
- l_s.C0 = l_s.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment )
- l_s.C1 = l_s.C1:Lerp(CFrame.new(1.50000012, 0.49999997, 0.5, -0.999999821, 0, 0, 0, 1, -4.37113883e-08, 0, -4.37113883e-08, -1),i/increment )
- neck.C0 = neck.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment )
- neck.C1 = neck.C1:Lerp(CFrame.new(0, -1.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment )
- l_h.C0 = l_h.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment )
- l_h.C1 = l_h.C1:Lerp(CFrame.new(0.5, 0.999999762, -1, -0.999999881, 0, 0, 0, 1, -9.9347659e-08, 0, -9.9347659e-08, -1),i/increment )
- r_h.C0 = r_h.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment )
- r_h.C1 = r_h.C1:Lerp(CFrame.new(-0.5, 0.999999881, -0.999999881, -0.99999994, 0, 0, 0, 0.99999994, -5.96046448e-08, 0, -5.96046448e-08, -0.99999994),i/increment )
- wait(.01)
- end
- end
- local function Anim_Walkstep_LL_Forward()
- local rh_end_pos = CFrame.new(0, 0, 0)
- local increment = 2.5
- rh.C1 = rh_end_pos
- for i=1,increment do
- neck.C0 = neck.C0:Lerp( CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment )
- neck.C1 = neck.C1:Lerp( CFrame.new(0, -1.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment )
- r_s.C0 = r_s.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment )
- r_s.C1 = r_s.C1:Lerp(CFrame.new(-1.49999809, 0.0855050758, 0.234923139, -0.999999285, 0, 0, 0, 0.342020124, 0.939692616, 0, 0.939692616, -0.342020124),i/increment )
- l_s.C0 = l_s.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment )
- l_s.C1 = l_s.C1:Lerp(CFrame.new(1.49997425, 0.0855049267, -0.234923184, -0.999997616, 0, 0, 0, -0.342019886, 0.939692676, 0, 0.939692676, 0.342019886),i/increment )
- l_h.C0 = l_h.C0:lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment )
- l_h.C1 = l_h.C1:Lerp(CFrame.new(0.49999547, 1.91449487, -0.234923124, -0.999998331, 0, 0, 0, 0.342019796, 0.939692736, 0, 0.939692736, -0.342019796),i/increment )
- r_h.C0 = r_h.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment )
- r_h.C1 = r_h.C1:Lerp(CFrame.new(-0.499967217, 1.91449142, 0.234921545, -0.999995232, 0, 0, 0, -0.342019886, 0.939692676, 0, 0.939692676, 0.342019886),i/increment )
- wait(.0001)
- end
- end
- local function Anim_Walkstep_RL_Forward()
- local rh_end_pos = CFrame.new(0, 0, 0)
- local increment = 2.5
- rh.C1 = rh_end_pos
- for i=1,increment do
- neck.C0 = neck.C0:Lerp( CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment )
- neck.C1 = neck.C1:Lerp( CFrame.new(0, -1.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment )
- r_s.C0 = r_s.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment )
- r_s.C1 = r_s.C1:Lerp(CFrame.new(-1.49997365, 0.0855049565, -0.234923184, -0.999997377, 0, 0, 0, -0.342019975, 0.939692676, 0, 0.939692676, 0.342019975),i/increment )
- l_s.C0 = l_s.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment )
- l_s.C1 = l_s.C1:Lerp(CFrame.new(1.49999738, 0.0855051354, 0.234923124, -0.999999285, 0, 0, 0, 0.342020363, 0.939692557, 0, 0.939692557, -0.342020363),i/increment )
- l_h.C0 = l_h.C0:lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment )
- l_h.C1 = l_h.C1:Lerp(CFrame.new(0.499991179, 1.91449475, 0.234923005, -0.999997616, 0, 0, 0, -0.34202069, 0.939692438, 0, 0.939692438, 0.34202069),i/increment )
- r_h.C0 = r_h.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment )
- r_h.C1 = r_h.C1:Lerp(CFrame.new(-0.499979973, 1.91449165, -0.234922379, -0.999996424, 0, 0, 0, 0.342020541, 0.939692378, 0, 0.939692378, -0.342020541),i/increment )
- wait(.0001)
- end
- end
- local function Anim_Walk_Cycle_Run_Once()
- Anim_Walkstep_LL_Forward()
- wait(.01)
- Anim_Stand()
- wait(.01)
- Anim_Walkstep_RL_Forward()
- wait(.01)
- Anim_Stand()
- wait(.01)
- end
- local function Anim_Jump_Force_Up()
- local rh_end_pos = CFrame.new(0, 0, 0)
- local increment = 10
- rh.C1 = rh_end_pos
- for i=1,increment do
- neck.C0 = neck.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment)
- neck.C1 = neck.C1:Lerp(CFrame.new(0, -1.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment)
- r_s.C0 = r_s.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment)
- r_s.C1 = r_s.C1:Lerp(CFrame.new(-1.49998295, 1.73428547, 0.205556601, -0.999998093, 0, 0, 0, 0.342020035, -0.939692676, -0, -0.939692676, -0.342020035),i/increment)
- l_s.C0 = l_s.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment)
- l_s.C1 = l_s.C1:Lerp(CFrame.new(1.49977911, 1.73428452, 0.205555528, -0.999993086, 0, 0, 0, 0.342019558, -0.939692795, -0, -0.939692795, -0.342019558),i/increment)
- l_h.C0 = l_h.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment)
- l_h.C1 = l_h.C1:Lerp(CFrame.new(0.499999523, 1.96527028, 0.196961537, -0.999999523, 0, 0, 0, -0.173648179, 0.98480773, 0, 0.98480773, 0.173648179),i/increment)
- r_h.C0 = r_h.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment)
- r_h.C1 = r_h.C1:Lerp(CFrame.new(-0.499999881, 1.9652704, 0.196961552, -0.999999762, 0, 0, 0, -0.173648179, 0.98480773, 0, 0.98480773, 0.173648179),i/increment)
- wait(.0001)
- end
- end
- humanoid.StateChanged:Connect(function(s)
- if (s==Enum.HumanoidStateType.Running or
- s==Enum.HumanoidStateType.RunningNoPhysics)and
- is_running==false then
- is_running = true
- while is_running==true do
- Anim_Walk_Cycle_Run_Once()
- if humanoid:GetState()~=Enum.HumanoidStateType.Running and
- humanoid:GetState()~=Enum.HumanoidStateType.RunningNoPhysics then
- is_running = false
- break
- end
- wait(.1)
- end
- elseif Enum.HumanoidStateType.Jumping==s and is_jumpping==false then
- Anim_Jump_Force_Up()
- is_jumpping = true
- elseif s==Enum.HumanoidStateType.Landed and is_jumpping then
- is_jumpping = false
- Anim_Stand()
- end
- end)
- humanoid:MoveTo(Vector3.new(100,0,0))
- return dummy_mod,{Anim_Stand,
- Anim_Sit,
- Anim_Walkstep_LL_Forward,
- Anim_Walkstep_RL_Forward,
- Anim_Jump_Force_Up}
- end
- Make_R6_Rig()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement