Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print('E = toggle movement [Based on mouse]')
- print('https://pastebin.com/jQLs3j8X')
- print('execute again if first time doesnt work')
- local ochar = owner.Character
- local players = game:GetService("Players")
- local pfs = game:GetService("PathfindingService")
- local deb = game:GetService("Debris")
- local is_on = false
- local function poof(ob)
- for _,v in pairs(ob:GetDescendants())do
- if v:IsA'BasePart'then
- v.Transparency = 1
- end
- if v.Name=='HumanoidRootPart'then
- v.CFrame = CFrame.new(0,100,5)
- v.Anchored = true
- end
- end
- end
- poof(ochar)
- owner.CharacterAdded:Connect(function(ch)
- poof(ch)
- end)
- 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.Died:Connect(function()
- dummy_mod:Destroy()
- end)
- return dummy_mod,{Anim_Stand,
- Anim_Sit,
- Anim_Walkstep_LL_Forward,
- Anim_Walkstep_RL_Forward,
- Anim_Jump_Force_Up},tool
- end
- local dummy,anims,tool = Make_R6_Rig()
- dummy.Parent = ochar
- local function Get_Components_Of_Mouse(player)
- --[[
- Just skip to the bottom. Also note: No UserInputService
- --]]
- local pchar = player.Character
- if pchar then
- local Remote = pchar:FindFirstChild('RE_Mouse')
- if not Remote then
- Remote = Instance.new("RemoteEvent",pchar)
- Remote.Name = 'RE_Mouse'
- end
- Remote.Parent = NLS(
- [[
- local lp = game:GetService'Players'.LocalPlayer
- local mouse = lp:GetMouse()
- local runs = game:GetService'RunService'
- local cam = workspace.CurrentCamera
- wait(1)
- local re = script.Parent:WaitForChild('RE_Mouse')
- if re then
- mouse.KeyDown:Connect(function(k)
- re:FireServer('KeyDown',k)
- end)
- mouse.KeyUp:Connect(function(k)
- re:FireServer('KeyUp',k)
- end)
- mouse.Button1Down:Connect(function()
- re:FireServer('Button1Down')
- end)
- mouse.Button1Up:Connect(function()
- re:FireServer('Button1Up')
- end)
- mouse.Button2Down:Connect(function()
- re:FireServer('Button2Down')
- end)
- mouse.Button2Up:Connect(function()
- re:FireServer('Button2Up')
- end)
- runs.Heartbeat:Connect(function()
- local mh = mouse.Hit
- local mt = mouse.Target
- if mh and mt then
- re:FireServer('MouseInfo',mh,mt)
- end
- end)
- re.OnClientEvent:Connect(function(arg1,arg2)
- if arg1=='ChangeMouseIcon'then
- mouse.Icon = arg2
- elseif arg1=='Dummy'then
- local hum = arg2:FindFirstChildWhichIsA'Humanoid'
- local head = arg2:FindFirstChild'Head'
- if hum and head then
- cam.CameraSubject = hum
- cam.Focus = head.CFrame
- end
- end
- end)
- else
- print('Fat try again.')
- end
- ]]
- ,pchar)
- Remote:FireClient(player,'Dummy',dummy)
- return Remote
- else
- error('Best to actually put your character in the game.')
- end
- end
- local RE = Get_Components_Of_Mouse(owner)
- if RE then
- RE.OnServerEvent:Connect(function(pl,arg1,arg2,arg3)
- if pl==owner then
- if arg1=='KeyDown'then
- if arg2=='e'then
- is_on = not is_on
- end
- elseif is_on and arg1=='MouseInfo' then
- local hum = dummy:FindFirstChildWhichIsA('Humanoid')
- if hum then
- hum:MoveTo(arg2.Position)
- end
- end
- end
- end)
- end
- --[[
- .OSE() Arguments:
- 'KeyDown', <string: Key pressed down>
- 'KeyUp', <string: Key pressed up>
- 'Button1Down'
- 'Button1Up'
- 'Button2Down'
- 'Button2Up'
- 'MouseInfo', <CFrame: Mouse.Hit> , <Instance: Mouse.Target>
- :FireClient Goods:
- owner,'ChangeMouseIcon', <string: new mouse.Icon asset id>
- --]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement