Advertisement
HenloMyDude

old rooblex

Aug 30th, 2019
535
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.39 KB | None | 0 0
  1. function waitForChild(parent, childName)
  2. local child = parent:findFirstChild(childName)
  3. if child then return child end
  4. while true do
  5. child = parent.ChildAdded:wait()
  6. if child.Name==childName then return child end
  7. end
  8. end
  9.  
  10. rcf = owner.Character.HumanoidRootPart.CFrame
  11. owner:LoadCharacter()
  12. owner.Character.Humanoid.Animator:Destroy()
  13. owner.Character.Torso.CFrame = rcf
  14.  
  15. char = owner.Character
  16. if char:FindFirstChild("Head") then
  17. if char.Head:FindFirstChild("face") ~= nil then
  18. face = char.Head:FindFirstChild("face")
  19. face.Texture = "rbxassetid://3248568733"
  20. face.Parent.Mesh.MeshType = "FileMesh"
  21. face.Parent.Mesh.MeshId = "rbxassetid://1068249467"
  22. end
  23. for i,v in pairs(char:GetChildren()) do
  24. if v.ClassName == "Shirt" or v.ClassName == "Pants" or v.ClassName == "Accessory" or v.ClassName == "CharacterMesh" or v.ClassName == "ShirtGraphic" then
  25. v:Remove()
  26. end
  27. if v.ClassName == "BodyColors" then
  28. v.HeadColor = BrickColor.new("Bright yellow")
  29. v.LeftArmColor = BrickColor.new("Bright yellow")
  30. v.LeftLegColor = BrickColor.new("Br. yellowish green")
  31. v.RightArmColor = BrickColor.new("Bright yellow")
  32. v.RightLegColor = BrickColor.new("Br. yellowish green")
  33. v.TorsoColor = BrickColor.Random()
  34. local Shirt = Instance.new("Shirt",face.Parent.Parent)
  35. Shirt.ShirtTemplate = "rbxassetid://1110695025"
  36. local Pants = Instance.new("Pants",face.Parent.Parent)
  37. Pants.PantsTemplate = "rbxassetid://1110798365"
  38. local TShirt = Instance.new("ShirtGraphic",face.Parent.Parent)
  39. TShirt.Graphic = "rbxassetid://2650823790"
  40. local TorsMesh = Instance.new("CharacterMesh", face.Parent.Parent)
  41. TorsMesh.BodyPart = "Torso"
  42. TorsMesh.MeshId = 1112228624
  43. local RAMesh = Instance.new("CharacterMesh", face.Parent.Parent)
  44. RAMesh.BodyPart = "RightArm"
  45. RAMesh.MeshId = 1112244824
  46. local LAMesh = Instance.new("CharacterMesh", face.Parent.Parent)
  47. LAMesh.BodyPart = "LeftArm"
  48. LAMesh.MeshId = 1112256772
  49. local RLMesh = Instance.new("CharacterMesh", face.Parent.Parent)
  50. RLMesh.BodyPart = "RightLeg"
  51. RLMesh.MeshId = 1112267576
  52. local LLMesh = Instance.new("CharacterMesh", face.Parent.Parent)
  53. LLMesh.BodyPart = "LeftLeg"
  54. LLMesh.MeshId = 1112275294
  55. end
  56. if v.ClassName == "Part" then
  57. if v.Name == "Head" or v.Name == "FalseHead" then
  58. v.BrickColor = BrickColor.new("Bright yellow")
  59. else
  60. v.BrickColor = BrickColor.new("Bright yellow")
  61. end
  62. end
  63. end
  64. end
  65.  
  66. local Figure = owner.Character
  67. local Torso = waitForChild(Figure, "Torso")
  68. local RightShoulder = waitForChild(Torso, "Right Shoulder")
  69. local LeftShoulder = waitForChild(Torso, "Left Shoulder")
  70. local RightHip = waitForChild(Torso, "Right Hip")
  71. local LeftHip = waitForChild(Torso, "Left Hip")
  72. local Neck = waitForChild(Torso, "Neck")
  73. local Humanoid = waitForChild(Figure, "Humanoid")
  74.  
  75. for _,v in pairs (Figure:children()) do
  76. if v:IsA("Part") then v.CanCollide = true end
  77. end
  78.  
  79. --[[
  80. Figure.HumanoidRootPart.Running.SoundId = "rbxassetid://174960816"
  81. Figure.HumanoidRootPart.Running.Volume = 10
  82. Figure.HumanoidRootPart.Running.PlaybackSpeed = 1
  83. Figure.HumanoidRootPart.Climbing.SoundId = "rbxassetid://174960816"
  84. Figure.HumanoidRootPart.Climbing.Volume = 10
  85. Figure.HumanoidRootPart.Climbing.PlaybackSpeed = 1
  86. Figure.HumanoidRootPart.Jumping.SoundId = "rbxassetid://400942696"
  87. Figure.Head.Jumping.Volume = 10
  88. ]]--
  89.  
  90. function onRunning(speed)
  91. if speed>0 then
  92. pose = "Running"
  93. else
  94. pose = "Standing"
  95. end
  96. end
  97.  
  98. function onDied()
  99. pose = "Dead"
  100. Humanoid.AutoRotate = true
  101. end
  102.  
  103. function onJumping()
  104. pose = "Jumping"
  105. Humanoid.AutoRotate = false
  106. end
  107.  
  108. function onClimbing()
  109. pose = "Climbing"
  110. end
  111.  
  112. function onGettingUp()
  113. pose = "GettingUp"
  114. Humanoid.AutoRotate = true
  115. end
  116.  
  117. function onFreeFall()
  118. pose = "FreeFall"
  119. Humanoid.AutoRotate = false
  120. end
  121.  
  122. function onFallingDown()
  123. pose = "FallingDown"
  124. Humanoid.AutoRotate = true
  125. end
  126.  
  127. function onSeated()
  128. pose = "Seated"
  129. Humanoid.AutoRotate = true
  130. end
  131.  
  132. function onPlatformStanding()
  133. pose = "PlatformStanding"
  134. Humanoid.AutoRotate = true
  135. end
  136.  
  137. function moveJump()
  138. RightShoulder.MaxVelocity = 0.5
  139. LeftShoulder.MaxVelocity = 0.5
  140. RightShoulder.DesiredAngle = 3.14
  141. LeftShoulder.DesiredAngle = -3.14
  142. RightHip.DesiredAngle = 0
  143. LeftHip.DesiredAngle = 0
  144. Humanoid.AutoRotate = false
  145. end
  146.  
  147.  
  148. -- same as jump for now
  149.  
  150. function moveFreeFall()
  151. RightShoulder.MaxVelocity = 0.5
  152. LeftShoulder.MaxVelocity = 0.5
  153. RightShoulder.DesiredAngle = 3.14
  154. LeftShoulder.DesiredAngle = -3.14
  155. RightHip.DesiredAngle = 0
  156. LeftHip.DesiredAngle = 0
  157. Humanoid.AutoRotate = false
  158. end
  159.  
  160. function moveSit()
  161. RightShoulder.MaxVelocity = 0.1
  162. LeftShoulder.MaxVelocity = 0.1
  163. RightShoulder.DesiredAngle = 3.14/2
  164. LeftShoulder.DesiredAngle = -3.14/2
  165. RightHip.DesiredAngle = 3.14/2
  166. LeftHip.DesiredAngle = -3.14/2
  167. Humanoid.AutoRotate = true
  168. end
  169.  
  170. function getTool()
  171. for _, kid in ipairs(Figure:GetChildren()) do
  172. if kid.className == "Tool" then return kid end
  173. end
  174. return nil
  175. end
  176.  
  177. function getToolAnim(tool)
  178. for _, c in ipairs(tool:GetChildren()) do
  179. if c.Name == "toolanim" and c.className == "StringValue" then
  180. return c
  181. end
  182. end
  183. return nil
  184. end
  185.  
  186. toolAnim = ""
  187.  
  188. function animateTool()
  189.  
  190. if (toolAnim == "None") then
  191. RightShoulder.DesiredAngle = 1.57
  192. return
  193. end
  194.  
  195. if (toolAnim == "Slash") then
  196. RightShoulder.MaxVelocity = 0.5
  197. RightShoulder.DesiredAngle = 0
  198. return
  199. end
  200.  
  201. if (toolAnim == "Lunge") then
  202. RightShoulder.MaxVelocity = 0.5
  203. LeftShoulder.MaxVelocity = 0.5
  204. RightHip.MaxVelocity = 0.5
  205. LeftHip.MaxVelocity = 0.5
  206. RightShoulder.DesiredAngle = 1.57
  207. LeftShoulder.DesiredAngle = 0
  208. RightHip.DesiredAngle = 1.57
  209. LeftHip.DesiredAngle = 1.0
  210. return
  211. end
  212. end
  213.  
  214. function move(time)
  215. local amplitude
  216. local frequency
  217. local toolAnimTime
  218.  
  219. if (pose == "Jumping") then
  220. moveJump()
  221. return
  222. end
  223.  
  224. if (pose == "FreeFall") then
  225. moveFreeFall()
  226. return
  227. end
  228.  
  229. if (pose == "Seated") then
  230. moveSit()
  231. return
  232. end
  233.  
  234. local climbFudge = 0
  235.  
  236. if (pose == "Running") then
  237. RightShoulder.MaxVelocity = 0.1
  238. LeftShoulder.MaxVelocity = 0.1
  239. amplitude = 0.85
  240. frequency = 9
  241. Humanoid.AutoRotate = true
  242. elseif (pose == "Climbing") then
  243. RightShoulder.MaxVelocity = 0.5
  244. LeftShoulder.MaxVelocity = 0.5
  245. amplitude = 0.85
  246. frequency = 9
  247. climbFudge = 3.14
  248. Humanoid.AutoRotate = true
  249. else
  250. amplitude = 0.1
  251. frequency = 1
  252. Humanoid.AutoRotate = true
  253. end
  254.  
  255. desiredAngle = amplitude * math.sin(time*frequency)
  256.  
  257. RightShoulder.DesiredAngle = desiredAngle + climbFudge
  258. LeftShoulder.DesiredAngle = desiredAngle - climbFudge
  259. RightHip.DesiredAngle = -desiredAngle
  260. LeftHip.DesiredAngle = -desiredAngle
  261.  
  262. local tool = getTool()
  263.  
  264. if tool then
  265.  
  266. animStringValueObject = getToolAnim(tool)
  267.  
  268. if animStringValueObject then
  269. toolAnim = animStringValueObject.Value
  270. -- message recieved, delete StringValue
  271. animStringValueObject.Parent = nil
  272. toolAnimTime = time + .3
  273. end
  274.  
  275. --if time > toolAnimTime then
  276. toolAnimTime = 0
  277. toolAnim = "None"
  278. --end
  279.  
  280. animateTool()
  281.  
  282.  
  283. else
  284. toolAnim = "None"
  285. toolAnimTime = 0
  286. end
  287. end
  288.  
  289. -- connect events
  290.  
  291. Humanoid.Died:connect(onDied)
  292. Humanoid.Running:connect(onRunning)
  293. Humanoid.Jumping:connect(onJumping)
  294. Humanoid.Climbing:connect(onClimbing)
  295. Humanoid.GettingUp:connect(onGettingUp)
  296. Humanoid.FreeFalling:connect(onFreeFall)
  297. Humanoid.FallingDown:connect(onFallingDown)
  298. Humanoid.Seated:connect(onSeated)
  299. Humanoid.PlatformStanding:connect(onPlatformStanding)
  300.  
  301. -- main program
  302.  
  303. local runService = game:service("RunService");
  304.  
  305.  
  306. plr = owner
  307. char = plr.Character
  308.  
  309. clerp = function(toclerp, cf, number)
  310. local joint = toclerp
  311. joint.C0 = joint.C0:Lerp(cf, number)
  312. end
  313.  
  314. clerp2 = function(toclerp, cf)
  315. local joint = toclerp
  316. joint.C0 = cf
  317. end
  318.  
  319. clerp3 = function(toclerp, cf, number)
  320. local joint = toclerp
  321. joint.C1 = joint.C1:Lerp(cf, number)
  322. end
  323.  
  324. Swait,swait = function(number)
  325. if number == 0 or number == nil then
  326. game:GetService("RunService").Heartbeat:Wait()
  327. else
  328. for i = 1,number do
  329. game:GetService("RunService").Heartbeat:Wait()
  330. end
  331. end
  332. end
  333.  
  334. ezweld = function(p, a, b, cf)
  335. local weld = Instance.new("Weld",p)
  336. weld.Part0 = a
  337. weld.Part1 = b
  338. weld.C0 = cf
  339. return weld
  340. end
  341.  
  342. NewSound = function(p, id, pit, vol, loop)
  343. local Sound = Instance.new("Sound",p)
  344. Sound.Pitch = pit
  345. Sound.Volume = vol
  346. Sound.SoundId = "rbxassetid://" ..id
  347. Sound.Looped = loop
  348. Sound:Play()
  349. return Sound
  350. end
  351.  
  352. local jomp = NewSound(Torso, 400942696, 1, 10, false)
  353. local wolk = NewSound(Torso, 174960816, 1, 10, true)
  354.  
  355. Humanoid:GetPropertyChangedSignal("Jump"):Connect(function()
  356. if Humanoid.Jump == true and jomp.Playing == false then
  357. jomp:Play()
  358. wolk:Stop()
  359. end
  360. end)
  361.  
  362. Humanoid.Running:connect(function(speed)
  363. if speed > 0 then
  364. wolk.Playing = true
  365. else
  366. wolk:Stop()
  367. end
  368. end)
  369.  
  370. function fake(part)
  371. local fake = Instance.new("Part", part.Parent)
  372. fake.Size = part.Size
  373. fake.Color = part.Color
  374. fake.Anchored = part.Anchored
  375. fake.CFrame = part.CFrame
  376. fake.CanCollide = true
  377. fake.Transparency = 1
  378. fake.Locked = true
  379. --fake.LeftSurface = part.LeftSurface
  380. --fake.RightSurface = part.RightSurface
  381. --fake.TopSurface = part.TopSurface
  382. --fake.BottomSurface = part.BottomSurface
  383. --fake.FrontSurface = part.FrontSurface
  384. --fake.BackSurface = part.BackSurface
  385. for i,v in pairs (part:children()) do
  386. if v:IsA("SpecialMesh") or v:IsA("Decal") then
  387. v:Clone().Parent = fake
  388. end
  389. end
  390. local weld = ezweld(part.Parent, fake, part, CFrame.new())
  391. return fake
  392. end
  393.  
  394. for i,v in pairs (char:GetDescendants()) do
  395. if v:IsA("Part") or v:IsA("MeshPart") then
  396. fake(v)
  397. end
  398. end
  399.  
  400. NLS([[
  401.  
  402. plr = owner
  403. char = plr.Character
  404. hum = char.Humanoid
  405. mouse = plr:GetMouse()
  406.  
  407. local mudel = Instance.new("Model", char)
  408. mudel.Name = "AHHAHDADAHDHASDGADH"
  409.  
  410. local neon = Instance.new("Part", workspace)
  411. neon.Shape = "Cylinder"
  412. neon.Material = "Neon"
  413. neon.Transparency = 0
  414. neon.CastShadow = true
  415. neon.Color = Color3.new(0, 0.75, 0)
  416. neon.CFrame = neon.CFrame*CFrame.Angles(0, 0, math.rad(90))
  417. neon.Size = Vector3.new(0.25, 3, 3)
  418. neon.Position = mouse.Hit.p
  419. mouse.Icon = "http://www.roblox.com/asset/?id=172802980"
  420.  
  421. mouse.Button1Down:connect(function()
  422. if mudel.Parent == char then
  423. hum:MoveTo(mouse.Hit.p)
  424. local c = neon:Clone()
  425. c.Parent = mudel
  426. local ack = neon.Touched:connect(function(hit)
  427. if hit.Parent == char then
  428. Debris:AddItem(c, 0.01)
  429. end
  430. end)
  431. end
  432. end)
  433.  
  434. game:service("RunService").RenderStepped:connect(function()
  435. neon.Position = mouse.Hit.p
  436. neon.Anchored = true
  437. neon.CanCollide = true
  438. neon.Parent = mudel
  439. for i,v in pairs (char:children()) do
  440. if v:IsA("Tool") then
  441. mudel.Parent = nil
  442. else
  443. mudel.Parent = char
  444. end
  445. end
  446. end)
  447.  
  448. ]], Figure)
  449.  
  450. while game:service("RunService").Heartbeat:Wait() do
  451. local _, time = wait()
  452. move(time)
  453. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement