Prephy

Another dummy

Oct 28th, 2020
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.03 KB | None | 0 0
  1. print('E = toggle movement [Based on mouse]')
  2. print('https://pastebin.com/jQLs3j8X')
  3. print('execute again if first time doesnt work')
  4.  
  5. local ochar = owner.Character
  6. local players = game:GetService("Players")
  7. local pfs = game:GetService("PathfindingService")
  8. local deb = game:GetService("Debris")
  9.  
  10. local is_on = false
  11.  
  12. local function poof(ob)
  13. for _,v in pairs(ob:GetDescendants())do
  14. if v:IsA'BasePart'then
  15. v.Transparency = 1
  16. end
  17. if v.Name=='HumanoidRootPart'then
  18. v.CFrame = CFrame.new(0,100,5)
  19. v.Anchored = true
  20. end
  21. end
  22. end
  23. poof(ochar)
  24. owner.CharacterAdded:Connect(function(ch)
  25. poof(ch)
  26. end)
  27. local function Make_R6_Rig()
  28. local runs = game:GetService("RunService")
  29.  
  30. local dum_number = 1
  31.  
  32. local is_running = false
  33. local is_jumpping = false
  34.  
  35. local dummy_mod = Instance.new("Model",workspace)
  36. for _,v in pairs(workspace:GetChildren())do
  37. local vn = v.Name
  38. if vn:sub(1,6):lower()=='dummy_'then
  39. local num = tonumber(vn:sub(7))
  40. if num then
  41. if num>dum_number then
  42. dum_number = num + 1
  43. end
  44. end
  45. end
  46. end
  47. dummy_mod.Name = 'Dummy_'.. dum_number
  48.  
  49. local humanoid = Instance.new("Humanoid",dummy_mod)
  50.  
  51. local head = Instance.new("Part",dummy_mod)
  52. head.Name = 'Head'
  53. head.Size = Vector3.new(2, 1, 1)
  54.  
  55. local sm_1 = Instance.new("SpecialMesh",head)
  56. sm_1.Scale = Vector3.new(1.25,1.25,1.25)
  57.  
  58. local face = Instance.new("Decal",head)
  59. face.Name = 'Face'
  60. face.Texture = 'rbxassetid://288072938'
  61.  
  62. local hrp = Instance.new("Part",dummy_mod)
  63. hrp.Size = Vector3.new(2, 2, 1)
  64. hrp.Name = 'HumanoidRootPart'
  65. hrp.Transparency = 1
  66.  
  67. dummy_mod.PrimaryPart = hrp
  68.  
  69. local larm = Instance.new("Part",dummy_mod)
  70. larm.Name = 'Left Arm'
  71. larm.Size = Vector3.new(1, 2, 1)
  72.  
  73. local lleg = Instance.new("Part",dummy_mod)
  74. lleg.Name = 'Left Leg'
  75. lleg.Size = Vector3.new(1, 2, 1)
  76.  
  77. local rarm = Instance.new("Part",dummy_mod)
  78. rarm.Name = 'Right Arm'
  79. rarm.Size = Vector3.new(1, 2, 1)
  80.  
  81. local rleg = Instance.new("Part",dummy_mod)
  82. rleg.Name = 'Right Leg'
  83. rleg.Size = Vector3.new(1, 2, 1)
  84.  
  85. local torso = Instance.new("Part",dummy_mod)
  86. torso.Name = 'Torso'
  87. torso.Size = Vector3.new(2, 2, 1)
  88.  
  89. local rh = Instance.new("Motor6D",hrp)
  90. rh.Name = 'Root Hip'
  91. rh.C1 = CFrame.new(0, 0, 0)
  92. rh.MaxVelocity = .1
  93. rh.Part0 = hrp
  94. rh.Part1 = torso
  95.  
  96. local neck = Instance.new("Motor6D",torso)
  97. neck.Name = 'Neck'
  98. neck.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  99. neck.C1 = CFrame.new(0, -1.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  100. neck.MaxVelocity = .1
  101. neck.Part0 = torso
  102. neck.Part1 = head
  103.  
  104. local r_s = Instance.new("Motor6D",torso)
  105. r_s.Name = 'Right Shoulder'
  106. r_s.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  107. 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)
  108. r_s.MaxVelocity = .1
  109. r_s.Part0 = torso
  110. r_s.Part1 = rarm
  111.  
  112. local l_s = Instance.new("Motor6D",torso)
  113. l_s.Name = 'Left Shoulder'
  114. l_s.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  115. l_s.C1 = CFrame.new(1.5, 0, -2.98023224e-08, -0.999999881, 0, 0, 0, 0, 1, 0, 1, 0)
  116. l_s.MaxVelocity = .1
  117. l_s.Part0 = torso
  118. l_s.Part1 = larm
  119.  
  120. local r_h = Instance.new("Motor6D",torso)
  121. r_h.Name = 'Right Hip'
  122. r_h.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  123. 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)
  124. r_h.MaxVelocity = .1
  125. r_h.Part0 = torso
  126. r_h.Part1 = rleg
  127.  
  128. local l_h = Instance.new("Motor6D",torso)
  129. l_h.Name = 'Left Hip'
  130. l_h.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  131. 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)
  132. l_h.MaxVelocity = .1
  133. l_h.Part0 = torso
  134. l_h.Part1 = lleg
  135.  
  136. local bodycolors = Instance.new("BodyColors",dummy_mod)
  137.  
  138. local function Noob_Rig()
  139. if bodycolors then
  140. bodycolors.HeadColor = BrickColor.new("New Yeller")
  141. bodycolors.LeftArmColor = BrickColor.new("New Yeller")
  142. bodycolors.RightArmColor = BrickColor.new("New Yeller")
  143.  
  144. bodycolors.LeftLegColor = BrickColor.new("Forest green")
  145. bodycolors.RightLegColor = BrickColor.new("Forest green")
  146.  
  147. bodycolors.TorsoColor = BrickColor.new("Dark blue")
  148. end
  149. end
  150. Noob_Rig()
  151.  
  152. local function Anim_Stand()
  153. rh.C1 = CFrame.new(0, 0, 0)
  154. local increment = 2.5
  155.  
  156. for i=1,increment do
  157. neck.C0 = neck.C0:Lerp( CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment )
  158. neck.C1 = neck.C1:Lerp( CFrame.new(0, -1.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment )
  159.  
  160. r_s.C0 = r_s.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment )
  161. 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 )
  162.  
  163. r_h.C0 = r_h.C0:Lerp( CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment )
  164. 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 )
  165.  
  166. l_s.C0 = l_s.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment )
  167. 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 )
  168.  
  169. l_h.C0 = l_h.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment )
  170. 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 )
  171.  
  172. wait(.0001)
  173. end
  174. end
  175. local function Anim_Sit()
  176. local rh_end_pos = CFrame.new(0, 0, 0)
  177. local increment = 2.5
  178.  
  179. rh.C1 = rh_end_pos
  180. for i=1,increment do
  181. r_s.C0 = r_s.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment )
  182. 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 )
  183.  
  184. l_s.C0 = l_s.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment )
  185. 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 )
  186.  
  187. neck.C0 = neck.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment )
  188. neck.C1 = neck.C1:Lerp(CFrame.new(0, -1.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment )
  189.  
  190. l_h.C0 = l_h.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment )
  191. 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 )
  192.  
  193. r_h.C0 = r_h.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment )
  194. 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 )
  195.  
  196. wait(.01)
  197. end
  198. end
  199. local function Anim_Walkstep_LL_Forward()
  200. local rh_end_pos = CFrame.new(0, 0, 0)
  201. local increment = 2.5
  202.  
  203. rh.C1 = rh_end_pos
  204. for i=1,increment do
  205. neck.C0 = neck.C0:Lerp( CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment )
  206. neck.C1 = neck.C1:Lerp( CFrame.new(0, -1.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment )
  207.  
  208. r_s.C0 = r_s.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment )
  209. 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 )
  210.  
  211. l_s.C0 = l_s.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment )
  212. 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 )
  213.  
  214. l_h.C0 = l_h.C0:lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment )
  215. 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 )
  216.  
  217. r_h.C0 = r_h.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment )
  218. 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 )
  219. wait(.0001)
  220. end
  221. end
  222. local function Anim_Walkstep_RL_Forward()
  223. local rh_end_pos = CFrame.new(0, 0, 0)
  224. local increment = 2.5
  225.  
  226. rh.C1 = rh_end_pos
  227. for i=1,increment do
  228. neck.C0 = neck.C0:Lerp( CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment )
  229. neck.C1 = neck.C1:Lerp( CFrame.new(0, -1.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment )
  230.  
  231. r_s.C0 = r_s.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment )
  232. 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 )
  233.  
  234. l_s.C0 = l_s.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment )
  235. 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 )
  236.  
  237. l_h.C0 = l_h.C0:lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment )
  238. 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 )
  239.  
  240. r_h.C0 = r_h.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment )
  241. 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 )
  242.  
  243. wait(.0001)
  244. end
  245. end
  246.  
  247. local function Anim_Walk_Cycle_Run_Once()
  248. Anim_Walkstep_LL_Forward()
  249. wait(.01)
  250. Anim_Stand()
  251. wait(.01)
  252. Anim_Walkstep_RL_Forward()
  253. wait(.01)
  254. Anim_Stand()
  255. wait(.01)
  256. end
  257.  
  258. local function Anim_Jump_Force_Up()
  259. local rh_end_pos = CFrame.new(0, 0, 0)
  260. local increment = 10
  261.  
  262. rh.C1 = rh_end_pos
  263. for i=1,increment do
  264. neck.C0 = neck.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment)
  265. neck.C1 = neck.C1:Lerp(CFrame.new(0, -1.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment)
  266.  
  267. r_s.C0 = r_s.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment)
  268. 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)
  269.  
  270. l_s.C0 = l_s.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment)
  271. 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)
  272.  
  273. l_h.C0 = l_h.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment)
  274. 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)
  275.  
  276. r_h.C0 = r_h.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),i/increment)
  277. 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)
  278.  
  279. wait(.0001)
  280. end
  281. end
  282.  
  283. humanoid.StateChanged:Connect(function(s)
  284. if (s==Enum.HumanoidStateType.Running or
  285. s==Enum.HumanoidStateType.RunningNoPhysics)and
  286. is_running==false then
  287. is_running = true
  288. while is_running==true do
  289. Anim_Walk_Cycle_Run_Once()
  290. if humanoid:GetState()~=Enum.HumanoidStateType.Running and
  291. humanoid:GetState()~=Enum.HumanoidStateType.RunningNoPhysics then
  292. is_running = false
  293. break
  294. end
  295. wait(.1)
  296. end
  297. elseif Enum.HumanoidStateType.Jumping==s and is_jumpping==false then
  298. Anim_Jump_Force_Up()
  299. is_jumpping = true
  300. elseif s==Enum.HumanoidStateType.Landed and is_jumpping then
  301. is_jumpping = false
  302. Anim_Stand()
  303. end
  304. end)
  305.  
  306. humanoid.Died:Connect(function()
  307. dummy_mod:Destroy()
  308. end)
  309.  
  310. return dummy_mod,{Anim_Stand,
  311. Anim_Sit,
  312. Anim_Walkstep_LL_Forward,
  313. Anim_Walkstep_RL_Forward,
  314. Anim_Jump_Force_Up},tool
  315. end
  316.  
  317. local dummy,anims,tool = Make_R6_Rig()
  318.  
  319. dummy.Parent = ochar
  320.  
  321. local function Get_Components_Of_Mouse(player)
  322. --[[
  323. Just skip to the bottom. Also note: No UserInputService
  324. --]]
  325.  
  326. local pchar = player.Character
  327.  
  328. if pchar then
  329. local Remote = pchar:FindFirstChild('RE_Mouse')
  330. if not Remote then
  331. Remote = Instance.new("RemoteEvent",pchar)
  332. Remote.Name = 'RE_Mouse'
  333. end
  334.  
  335.  
  336.  
  337. Remote.Parent = NLS(
  338. [[
  339. local lp = game:GetService'Players'.LocalPlayer
  340. local mouse = lp:GetMouse()
  341. local runs = game:GetService'RunService'
  342. local cam = workspace.CurrentCamera
  343.  
  344. wait(1)
  345.  
  346. local re = script.Parent:WaitForChild('RE_Mouse')
  347. if re then
  348. mouse.KeyDown:Connect(function(k)
  349. re:FireServer('KeyDown',k)
  350. end)
  351. mouse.KeyUp:Connect(function(k)
  352. re:FireServer('KeyUp',k)
  353. end)
  354. mouse.Button1Down:Connect(function()
  355. re:FireServer('Button1Down')
  356. end)
  357. mouse.Button1Up:Connect(function()
  358. re:FireServer('Button1Up')
  359. end)
  360. mouse.Button2Down:Connect(function()
  361. re:FireServer('Button2Down')
  362. end)
  363. mouse.Button2Up:Connect(function()
  364. re:FireServer('Button2Up')
  365. end)
  366.  
  367. runs.Heartbeat:Connect(function()
  368. local mh = mouse.Hit
  369. local mt = mouse.Target
  370. if mh and mt then
  371. re:FireServer('MouseInfo',mh,mt)
  372. end
  373. end)
  374. re.OnClientEvent:Connect(function(arg1,arg2)
  375. if arg1=='ChangeMouseIcon'then
  376. mouse.Icon = arg2
  377. elseif arg1=='Dummy'then
  378. local hum = arg2:FindFirstChildWhichIsA'Humanoid'
  379. local head = arg2:FindFirstChild'Head'
  380. if hum and head then
  381. cam.CameraSubject = hum
  382. cam.Focus = head.CFrame
  383. end
  384. end
  385. end)
  386. else
  387. print('Fat try again.')
  388. end
  389. ]]
  390. ,pchar)
  391.  
  392. Remote:FireClient(player,'Dummy',dummy)
  393.  
  394. return Remote
  395. else
  396. error('Best to actually put your character in the game.')
  397. end
  398.  
  399.  
  400. end
  401. local RE = Get_Components_Of_Mouse(owner)
  402.  
  403. if RE then
  404. RE.OnServerEvent:Connect(function(pl,arg1,arg2,arg3)
  405. if pl==owner then
  406. if arg1=='KeyDown'then
  407. if arg2=='e'then
  408. is_on = not is_on
  409. end
  410. elseif is_on and arg1=='MouseInfo' then
  411. local hum = dummy:FindFirstChildWhichIsA('Humanoid')
  412. if hum then
  413. hum:MoveTo(arg2.Position)
  414. end
  415. end
  416.  
  417. end
  418. end)
  419. end
  420.  
  421. --[[
  422. .OSE() Arguments:
  423. 'KeyDown', <string: Key pressed down>
  424. 'KeyUp', <string: Key pressed up>
  425. 'Button1Down'
  426. 'Button1Up'
  427. 'Button2Down'
  428. 'Button2Up'
  429. 'MouseInfo', <CFrame: Mouse.Hit> , <Instance: Mouse.Target>
  430.  
  431. :FireClient Goods:
  432.  
  433. owner,'ChangeMouseIcon', <string: new mouse.Icon asset id>
  434. --]]
Add Comment
Please, Sign In to add comment