lundofett

Untitled

Mar 17th, 2020
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 43.77 KB | None | 0 0
  1. --By Rufus14
  2. --Edited by Lundo_Fett (smallest edit ive ever done lol)
  3. --Edited for my S^X friend.
  4. local NamePlayer = "NameHere" --Put roblox username here.
  5. owner = game.Players[NamePlayer]
  6. character = owner.Character
  7. NLS([[
  8. --By Rufus14
  9. owner = game:GetService("Players").LocalPlayer
  10. local ownerhead = owner.Character:WaitForChild("Head")
  11. parkietremote = owner.Character:WaitForChild("parkietremote")
  12. mouse = owner:GetMouse()
  13. local part = Instance.new("Part", owner.Character.Head)
  14. part.Size = Vector3.new(0.1,0.1,0.1)
  15. part.Transparency = 1
  16. part.CanCollide = false
  17. part.Name = "camera"
  18. part:BreakJoints()
  19. local weld = Instance.new("Weld", part)
  20. weld.Part0 = owner.Character.Head
  21. weld.Part1 = part
  22. weld.C0 = CFrame.new(0,0,-1)
  23. cananimate = true
  24. walkpressed = 0
  25. humanoid = owner.Character:findFirstChildOfClass("Humanoid")
  26. rootpart = owner.Character.HumanoidRootPart
  27. runservice = game:GetService("RunService")
  28. --
  29. canmovecamera = true
  30. wrunning = false
  31. wrunningl = false
  32. owner.Character.ChildAdded:connect(function(whatadded)
  33. if whatadded.Name == "slide" then
  34. canmovecamera = false
  35. for i = 1,60 do
  36. workspace.CurrentCamera.CFrame = workspace.CurrentCamera.CFrame * CFrame.fromEulerAnglesXYZ(math.rad(math.sin(tick()*45)/(i/6)),0,0)
  37. runservice.RenderStepped:wait()
  38. end
  39. elseif whatadded.Name == "vwallrun" then
  40. canmovecamera = false
  41. for i = 1,20 do
  42. workspace.CurrentCamera.CFrame = workspace.CurrentCamera.CFrame * CFrame.fromEulerAnglesXYZ(math.rad(2),0,0)
  43. runservice.RenderStepped:wait()
  44. end
  45. elseif whatadded.Name == "hwallrunright" then
  46. wrunning = true
  47. canmovecamera = false
  48. coroutine.wrap(function()
  49. while wrunning and runservice.RenderStepped:wait() do
  50. workspace.CurrentCamera.CFrame = workspace.CurrentCamera.CFrame:lerp(workspace.CurrentCamera.CFrame * CFrame.fromEulerAnglesXYZ(0,0,math.rad(30)),0.2)
  51. end
  52. end)()
  53. elseif whatadded.Name == "hwallrunleft" then
  54. wrunningl = true
  55. canmovecamera = false
  56. coroutine.wrap(function()
  57. while wrunningl and runservice.RenderStepped:wait() do
  58. workspace.CurrentCamera.CFrame = workspace.CurrentCamera.CFrame:lerp(workspace.CurrentCamera.CFrame * CFrame.fromEulerAnglesXYZ(0,0,math.rad(-30)),0.2)
  59. end
  60. end)()
  61. elseif whatadded.Name == "FALLING" then
  62. local screengui = Instance.new("ScreenGui", owner:findFirstChildOfClass("PlayerGui"))
  63. screengui.ResetOnSpawn = true
  64. screengui.Name = "ohgodohfuck"
  65. local vel = Instance.new("BodyVelocity", rootpart)
  66. vel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  67. vel.Velocity = Vector3.new(0,-135,0)
  68. local frame = Instance.new("ImageLabel", screengui)
  69. frame.BackgroundTransparency = 1
  70. frame.ImageTransparency = 1
  71. frame.ImageColor3 = Color3.fromRGB(0,0,0)
  72. frame.Image = "http://www.roblox.com/asset/?id=22606915"
  73. frame.Size = UDim2.new(1,0,1,0)
  74. for i = 1,20 do
  75. frame.ImageTransparency = frame.ImageTransparency - 0.05
  76. runservice.Stepped:wait()
  77. end
  78. coroutine.wrap(function()
  79. while rootpart.Velocity.y < -10 do runservice.RenderStepped:wait() end
  80. screengui:destroy()
  81. vel:destroy()
  82. owner.Character:BreakJoints()
  83. end)()
  84. end
  85. end)
  86. owner.Character.ChildRemoved:connect(function(whatremoved)
  87. if whatremoved.Name == "slide" then
  88. canmovecamera = true
  89. elseif whatremoved.Name == "vwallrun" then
  90. for i = 1,20 do
  91. workspace.CurrentCamera.CFrame = workspace.CurrentCamera.CFrame * CFrame.fromEulerAnglesXYZ(math.rad(-2),0,0)
  92. runservice.RenderStepped:wait()
  93. end
  94. canmovecamera = true
  95. elseif whatremoved.Name == "hwallrunright" then
  96. canmovecamera = true
  97. wrunning = false
  98. elseif whatremoved.Name == "hwallrunleft" then
  99. canmovecamera = true
  100. wrunningl = false
  101. end
  102. end)
  103. --
  104. mouse.KeyDown:connect(function(key)
  105. key = key:lower()
  106. if key == "w" or key == "a" or key == "s" or key == "d" then
  107. walkpressed = walkpressed + 1
  108. end
  109. if key == "r" then
  110. parkietremote:FireServer(rootpart.CFrame, "triggerroll")
  111. end
  112. if key == "e" then
  113. parkietremote:FireServer(rootpart.CFrame, "slide")
  114. end
  115. end)
  116. mouse.KeyUp:connect(function(key)
  117. key = key:lower()
  118. if key == "w" or key == "a" or key == "s" or key == "d" then
  119. walkpressed = walkpressed - 1
  120. end
  121. if key == "r" then
  122. parkietremote:FireServer(rootpart.CFrame, "triggerroll")
  123. end
  124. end)
  125. --
  126. humanoid.Died:connect(function()
  127. local correction = Instance.new("ColorCorrectionEffect", workspace.CurrentCamera)
  128. local deathsound = Instance.new("Sound", owner:findFirstChildOfClass("PlayerGui"))
  129. deathsound.SoundId = "rbxassetid://1038809455"
  130. deathsound.Volume = 10
  131. deathsound:Play()
  132. game.Debris:AddItem(deathsound, deathsound.TimeLength)
  133. game.Debris:AddItem(correction, game:GetService("Players").RespawnTime)
  134. for i = 1,5 do
  135. correction.Brightness = correction.Brightness + 0.2
  136. runservice.RenderStepped:wait()
  137. end
  138. while runservice.RenderStepped:wait() do
  139. workspace.CurrentCamera.CFrame = CFrame.new(0,9999999,0)
  140. end
  141. end)
  142. --
  143. while game:GetService("RunService").RenderStepped:wait() do
  144. ----
  145. local vwallray = Ray.new(rootpart.CFrame.p, rootpart.CFrame.lookVector * 2)
  146. local vwallhit, vwallpos, vwallsurface = workspace:FindPartOnRayWithIgnoreList(vwallray, {owner.Character})
  147. if vwallhit and humanoid.Jump and rootpart.Velocity.y > -30 then
  148. if not vwallhit.Parent:findFirstChildOfClass("Humanoid") then
  149. parkietremote:FireServer(rootpart.CFrame, "vwallrun", vwallhit, vwallpos, vwallsurface)
  150. end
  151. end
  152. ---
  153. local hwallray = Ray.new(rootpart.CFrame.p, (rootpart.CFrame.rightVector * 3.5) + (rootpart.CFrame.lookVector * -0.3))
  154. local hwallhit, hwallpos, surface = workspace:FindPartOnRayWithIgnoreList(hwallray, {owner.Character})
  155. if hwallhit and humanoid.Jump and rootpart.Velocity.y > -20 then
  156. if not hwallhit.Parent:findFirstChildOfClass("Humanoid") then
  157. parkietremote:FireServer(rootpart.CFrame, "hwallrunright", hwallhit, hwallpos, surface)
  158. end
  159. end
  160. --
  161. local hwallrayl = Ray.new(rootpart.CFrame.p, rootpart.CFrame.rightVector * -3.5 + (rootpart.CFrame.lookVector * -0.3))
  162. local hwallhitl, hwallposl, surfacel = workspace:FindPartOnRayWithIgnoreList(hwallrayl, {owner.Character})
  163. if hwallhitl and humanoid.Jump and rootpart.Velocity.y > -20 then
  164. if not hwallhitl.Parent:findFirstChildOfClass("Humanoid") then
  165. parkietremote:FireServer(rootpart.CFrame, "hwallrunleft", hwallhitl, hwallposl, surfacel)
  166. end
  167. end
  168. ---
  169. local poleray = Ray.new(ownerhead.CFrame.p, ownerhead.CFrame.lookVector * 3.5)
  170. local polerayhit, poleraypos, poleraysurface = workspace:FindPartOnRayWithIgnoreList(poleray, {owner.Character})
  171. if polerayhit and rootpart.Velocity.y > -60 then
  172. if not polerayhit.Parent:findFirstChildOfClass("Humanoid") then
  173. parkietremote:FireServer(rootpart.CFrame, "polegrab", polerayhit, poleraypos, poleraysurface)
  174. end
  175. end
  176. --
  177. local poleray = Ray.new(ownerhead.CFrame.p, (ownerhead.CFrame.lookVector * 3.5) + (ownerhead.CFrame.upVector * -0.5))
  178. local polerayhit, poleraypos, poleraysurface = workspace:FindPartOnRayWithIgnoreList(poleray, {owner.Character})
  179. if polerayhit and rootpart.Velocity.y > -60 then
  180. if not polerayhit.Parent:findFirstChildOfClass("Humanoid") then
  181. parkietremote:FireServer(rootpart.CFrame, "polegrab", polerayhit, poleraypos, poleraysurface)
  182. end
  183. end
  184. --
  185. local poleray = Ray.new(ownerhead.CFrame.p, (ownerhead.CFrame.lookVector * 3.5) + (ownerhead.CFrame.upVector * 0.5))
  186. local polerayhit, poleraypos, poleraysurface = workspace:FindPartOnRayWithIgnoreList(poleray, {owner.Character})
  187. if polerayhit and rootpart.Velocity.y > -60 then
  188. if not polerayhit.Parent:findFirstChildOfClass("Humanoid") then
  189. parkietremote:FireServer(rootpart.CFrame, "polegrab", polerayhit, poleraypos, poleraysurface)
  190. end
  191. end
  192. ----
  193. if walkpressed > 0 and humanoid.WalkSpeed < 23 and not owner.Character:findFirstChild("ouchfell") then
  194. humanoid.WalkSpeed = humanoid.WalkSpeed + 1.2
  195. elseif walkpressed == 0 and humanoid.WalkSpeed > 0 and not owner.Character:findFirstChild("ouchfell") then
  196. humanoid.WalkSpeed = humanoid.WalkSpeed - 1.2
  197. end
  198. if (workspace.CurrentCamera.CFrame.p - part.Position).magnitude <= 1.7 then
  199. if canmovecamera and not owner.Character:findFirstChild("ouchfell") and not owner.Character:findFirstChild("rollin") and not owner.Character:findFirstChild("pole") then
  200. game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.Position,Vector3.new(mouse.Hit.p.x,game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.Position.y,mouse.Hit.p.z))
  201. end
  202. if owner.Character:findFirstChild("ouchfell") then
  203. workspace.CurrentCamera.CFrame = owner.Character.Head.CFrame * CFrame.new(0,0,-0.4)
  204. end
  205. if owner.Character:findFirstChild("rollin") then
  206. workspace.CurrentCamera.CFrame = owner.Character.Head.CFrame * CFrame.new(0,0,-0.2)
  207. end
  208. if owner.Character:findFirstChild("FALLING") then
  209. canmovecamera = false
  210. workspace.CurrentCamera.CFrame = owner.Character.Head.CFrame * CFrame.new(0,0,-0.4) * CFrame.fromEulerAnglesXYZ(math.rad(math.sin(tick()*45))*6,0,0)
  211. end
  212. workspace.CurrentCamera.FieldOfView = 120
  213. for i,v in pairs(owner.Character:GetChildren()) do
  214. if v.ClassName == "Part" or v.ClassName == "MeshPart" and v.Name ~= "Head" then
  215. v.LocalTransparencyModifier = 0
  216. end
  217. if v.ClassName == "Accessory" then
  218. v.Handle.Transparency = 1
  219. end
  220. end
  221. if owner.Character.Head:findFirstChildOfClass("Decal") then
  222. owner.Character.Head:findFirstChildOfClass("Decal").Transparency = 1
  223. end
  224. owner.Character.Head.Transparency = 1
  225. workspace.CurrentCamera.CameraSubject = part
  226. else
  227. for i,v in pairs(owner.Character:GetChildren()) do
  228. if v.ClassName == "Accessory" then
  229. v.Handle.Transparency = 0
  230. end
  231. end
  232. workspace.CurrentCamera.FieldOfView = 70
  233. owner.Character.Head.Transparency = 0
  234. if owner.Character.Head:findFirstChildOfClass("Decal") then
  235. owner.Character.Head:findFirstChildOfClass("Decal").Transparency = 0
  236. end
  237. workspace.CurrentCamera.CameraSubject = owner.Character
  238. end
  239. end
  240. ]], character)
  241. local ownerhead = character:WaitForChild("Head")
  242. mouse = owner:GetMouse()
  243. anim = "idle"
  244. cananimate = true
  245. humanoid = character:findFirstChildOfClass("Humanoid")
  246. rootpart = character.HumanoidRootPart
  247. runservice = game:GetService("RunService")
  248. local rightarm = Instance.new("Weld", owner.Character.Torso)
  249. rightarm.Part0 = owner.Character.Torso
  250. rightarm.Part1 = owner.Character["Right Arm"]
  251. rightarm.C0 = CFrame.new(1.5,0,0)
  252. rightarm.Name = "RightArmWeld"
  253. local rightleg = Instance.new("Weld", owner.Character.Torso)
  254. rightleg.Part0 = owner.Character.Torso
  255. rightleg.Part1 = owner.Character["Right Leg"]
  256. rightleg.C0 = CFrame.new(0.5,-2,0)
  257. rightleg.Name = "RightLegWeld"
  258. local leftarm = Instance.new("Weld", owner.Character.Torso)
  259. leftarm.Part0 = owner.Character.Torso
  260. leftarm.Part1 = owner.Character["Left Arm"]
  261. leftarm.C0 = CFrame.new(-1.5,0,0)
  262. leftarm.Name = "LeftArmWeld"
  263. local leftleg = Instance.new("Weld", owner.Character.Torso)
  264. leftleg.Part0 = owner.Character.Torso
  265. leftleg.Part1 = owner.Character["Left Leg"]
  266. leftleg.C0 = CFrame.new(-0.5,-2,0)
  267. leftleg.Name = "LeftLegWeld"
  268. local head = Instance.new("Weld", owner.Character.Torso)
  269. head.Part0 = owner.Character.Torso
  270. head.Part1 = owner.Character.Head
  271. head.C0 = CFrame.new(0,1.5,0)
  272. head.Name = "HeadWeld"
  273. local humanoidrootpart = Instance.new("Weld", owner.Character.HumanoidRootPart)
  274. humanoidrootpart.Part0 = owner.Character.HumanoidRootPart
  275. humanoidrootpart.Part1 = owner.Character.Torso
  276. humanoidrootpart.Name = "HumanoidRootPartWeld"
  277. local music = Instance.new("Sound", owner.Character.Head)
  278. music.Looped = true
  279. local musicrandom = math.random(1,5)
  280. if musicrandom == 1 then
  281. music.SoundId = "rbxassetid://4502246491"
  282. music.Volume = 2
  283. elseif musicrandom == 2 then
  284. music.SoundId = "rbxassetid://469593664"
  285. music.Volume = 2
  286. elseif musicrandom == 3 then
  287. music.SoundId = "rbxassetid://477207390"
  288. music.Volume = 2
  289. elseif musicrandom == 4 then
  290. music.SoundId = "rbxassetid://147811295"
  291. music.Volume = 2
  292. elseif musicrandom == 5 then
  293. music.SoundId = "rbxassetid://4519453403"
  294. music.Volume = 1
  295. end
  296. music:Play()
  297. local runsound = Instance.new("Sound", owner.Character.Head)
  298. runsound.SoundId = "rbxassetid://3084278209"
  299. runsound.Looped = true
  300. runsound:Play()
  301. runsound.PlaybackSpeed = 1.4
  302. local bodyhitsound = Instance.new("Sound", owner.Character.Head)
  303. bodyhitsound.SoundId = "rbxassetid://261338552"
  304. bodyhitsound.Volume = 0.5
  305. local fallingsound = Instance.new("Sound", owner.Character.Head)
  306. fallingsound.SoundId = "rbxassetid://866649671"
  307. fallingsound.Volume = 0
  308. fallingsound.Looped = true
  309. fallingsound:Play()
  310. local parkietremote = Instance.new("RemoteEvent", character)
  311. parkietremote.Name = "parkietremote"
  312. cando = true
  313. roll = false
  314. fallingtodeath = false
  315. grabbedpole = false
  316. parkietremote.OnServerEvent:connect(function(plr, rootpos, what, rayehit, rayepos, rayesurface)
  317. if plr == owner and not fallingtodeath and cando then
  318. character.HumanoidRootPart.CanCollide = false
  319. if what == "slide" then
  320. cananimate = false
  321. cando = false
  322. local action = Instance.new("BoolValue", character)
  323. action.Name = "slide"
  324. local velo = Instance.new("BodyVelocity", rootpart)
  325. velo.MaxForce = Vector3.new(math.huge,0,math.huge)
  326. velo.Velocity = rootpart.CFrame.lookVector*22
  327. runsound.Volume = 0
  328. for i = 0,1 , 0.04 do
  329. rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.70441437, 0.561628342, 9.53674316e-07, 0.642787516, -0.766044259, 1.49011612e-08, 0.766044319, 0.642787576, 0, 1.17273338e-08, -1.27691155e-08, 0.99999994),i)
  330. leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.54449558, -0.470175743, -0.242582321, 0.983905256, -0.168530971, 0.0593911819, 0.178687513, 0.926305115, -0.331706733, 0.000888578361, 0.336980522, 0.941511095),i)
  331. leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.500000954, -1.64282608, -0.0428800583, 0.999999821, -1.0857935e-08, 1.23050938e-08, 0, 0.939692557, 0.342019677, 1.49011612e-08, -0.342019677, 0.939692557),i)
  332. rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.5, -2, 0, 0.999999821, 0, 1.49011612e-08, 0, 0.99999994, 0, 1.49011612e-08, 0, 0.99999994),i)
  333. humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.new(-0.416755676, -2.3635385, 0, 0.98480767, 0, -0.173648164, -0.173648179, -4.37113883e-08, -0.98480773, -7.59040297e-09, 1, -4.30473115e-08),i)
  334. head.C0 = head.C0:lerp(CFrame.new(-9.53674316e-07, 1.15137196, -0.85847187, 0.999999821, -4.60215439e-08, -1.65799918e-07, 1.71363354e-07, 0.173648059, 0.98480767, 2.98023153e-08, -0.984807611, 0.173648059),i)
  335. runservice.Stepped:wait()
  336. end
  337. local funnysine = 0
  338. for i = 1,60 do
  339. local ray = Ray.new(character.Torso.Position, character.Torso.CFrame.upVector*-5.5)
  340. local hit, positionn = workspace:FindPartOnRayWithIgnoreList(ray, {character})
  341. if hit then
  342. break
  343. end
  344. velo.Velocity = velo.Velocity/1.01
  345. runservice.Stepped:wait()
  346. end
  347. velo:destroy()
  348. action:destroy()
  349. cananimate = true
  350. cando = true
  351. elseif what == "vwallrun" then
  352. local polereally = false
  353. if rayehit.Size.y <= 1 then
  354. if rayehit.Size.z > rayehit.Size.x and rayehit.Size.x <= 1 then
  355. --print("pole z > x BAD")
  356. polereally = true
  357. elseif rayehit.Size.x > rayehit.Size.z and rayehit.Size.z <= 1 then
  358. --print("pole x > z BAD")
  359. polereally = true
  360. end
  361. end
  362. if not polereally then
  363. cananimate = false
  364. cando = false
  365. humanoid.AutoRotate = false
  366. local action = Instance.new("BoolValue", character)
  367. action.Name = "vwallrun"
  368. character.HumanoidRootPart.CFrame = rootpos
  369. local goupvel = Instance.new("BodyVelocity", rootpart)
  370. goupvel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  371. goupvel.Velocity = Vector3.new(0,20,0)
  372. local gotin = false
  373. for i = 1,70 do
  374. local headray = Ray.new(rootpart.CFrame.p, rootpart.CFrame.upVector * 3.5)
  375. local headrayhit, headraypos = workspace:FindPartOnRayWithIgnoreList(headray, {owner.Character})
  376. if headrayhit then
  377. gotin = false
  378. break
  379. end
  380. local headraywall = Ray.new(ownerhead.CFrame.p, ownerhead.CFrame.lookVector * 3)
  381. local headraywallhit, headraywallpos = workspace:FindPartOnRayWithIgnoreList(headraywall, {owner.Character})
  382. if not headraywallhit then
  383. gotin = true
  384. break
  385. end
  386. goupvel.Velocity = goupvel.Velocity/1.025
  387. humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.new(),0.3)
  388. head.C0 = head.C0:lerp(CFrame.new(0,1,0) * CFrame.Angles(math.rad(30),0,0) * CFrame.new(0,0.5,0),0.3)
  389. leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.5,0.5,0) * CFrame.Angles(math.pi/2+math.sin(i/5),0,math.cos(i/5)/3) * CFrame.new(0,-0.5,0),0.3)
  390. rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.Angles(math.pi/2-math.sin(i/5),0,-math.cos(i/5)/3) * CFrame.new(0,-0.5,0),0.3)
  391. leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.5,-1-math.cos(i/5)/2,0) * CFrame.Angles(-math.sin(i/5),0,0) * CFrame.new(0,-1,0),0.3)
  392. rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.5,-1+math.cos(i/5)/2,0) * CFrame.Angles(math.sin(i/5),0,0) * CFrame.new(0,-1,0),0.3)
  393. runservice.Stepped:wait()
  394. end
  395. action:destroy()
  396. if gotin then
  397. rootpart.Anchored = true
  398. for i = 1,30 do
  399. rootpart.CFrame = rootpart.CFrame * CFrame.new(0,0.15,-math.sin(i/14)/9)
  400. humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.fromEulerAnglesXYZ(math.rad(-20),0,0),0.3)
  401. head.C0 = head.C0:lerp(CFrame.new(0,1,0) * CFrame.Angles(math.rad(20),0,0) * CFrame.new(0,0.5,0),0.3)
  402. leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.5,0.5,0) * CFrame.Angles(math.rad(60)+math.cos(i/7)*1.5,0,0) * CFrame.new(0,-0.5,0),0.3)
  403. rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.Angles(math.rad(60)+math.cos(i/7)*1.5,0,0) * CFrame.new(0,-0.5,0),0.3)
  404. leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.5,-1,0) * CFrame.Angles(0,0,0) * CFrame.new(0,-1,0),0.3)
  405. rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.5,-0.25+math.cos(i/7)/1.2,-0.5) * CFrame.Angles(0,0,0) * CFrame.new(0,-1,0),0.3)
  406. runservice.Stepped:wait()
  407. end
  408. end
  409. humanoid.AutoRotate = true
  410. rootpart.Anchored = false
  411. goupvel:destroy()
  412. cananimate = true
  413. cando = true
  414. end
  415. elseif what == "hwallrunright" and anim == "jumprun" or anim == "fallrun" and rayepos ~= nil then
  416. cananimate = false
  417. cando = false
  418. humanoid.AutoRotate = false
  419. local action = Instance.new("BoolValue", character)
  420. action.Name = "hwallrunright"
  421. rootpart.CFrame = CFrame.new(rayepos, rayepos + rayesurface) * CFrame.fromEulerAnglesXYZ(0,-math.pi/2,0)
  422. rootpart.CFrame = rootpart.CFrame * CFrame.new(-1.8,0,0)
  423. if rootpart:findFirstChild("wallrunvel") then
  424. rootpart:findFirstChild("wallrunvel"):destroy()
  425. end
  426. local goupvel = Instance.new("BodyVelocity", rootpart)
  427. goupvel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  428. goupvel.Velocity = rootpart.CFrame.lookVector * 20
  429. goupvel.Name = "wallrunvel"
  430. runsound.PlaybackSpeed = 1.7
  431. runsound.Volume = 1.5
  432. local jumped = false
  433. local shouldcontinue = true
  434. local candothat = true
  435. for i = 1,20 do
  436. local rootrightray = Ray.new(rootpart.CFrame.p, rootpart.CFrame.rightVector * 2.5)
  437. local wallrighthit, rootrightraypos = workspace:FindPartOnRayWithIgnoreList(rootrightray, {owner.Character})
  438. if not wallrighthit then
  439. shouldcontinue = false
  440. break
  441. end
  442. local rootfrontray = Ray.new(rootpart.CFrame.p, rootpart.CFrame.lookVector * 4)
  443. local rootfrontrayhit, rootfrontraypos = workspace:FindPartOnRayWithIgnoreList(rootfrontray, {owner.Character})
  444. if rootfrontrayhit then
  445. shouldcontinue = false
  446. break
  447. end
  448. humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.fromEulerAnglesXYZ(0,0,math.rad(30)),0.3)
  449. head.C0 = head.C0:lerp(CFrame.new(0,1,0) * CFrame.Angles(0,0,0) * CFrame.new(0,0.5,0),0.3)
  450. leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.5,0.5,0) * CFrame.Angles(-math.sin(tick()*14)*1.3,0,math.rad(-15)) * CFrame.new(0,-0.5,0),0.3)
  451. rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.Angles(0,0,math.pi/1.5) * CFrame.new(0,-0.5,0),0.3)
  452. leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.5,-1+math.cos(tick()*14)/2,-math.cos(tick()*14)/2) * CFrame.fromEulerAnglesXYZ(math.sin(tick()*14),0,0) * CFrame.new(0,-1,0),0.2)
  453. rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.5,-1-math.cos(tick()*14)/2,math.cos(tick()*14)/2) * CFrame.fromEulerAnglesXYZ(-math.sin(tick()*14),0,0) * CFrame.new(0,-1,0),0.2)
  454. runservice.Stepped:wait()
  455. end
  456. for i = 1,60 do
  457. if candothat then
  458. if not shouldcontinue then
  459. break
  460. end
  461. if humanoid.Jump then
  462. jumped = true
  463. break
  464. end
  465. local rootrightray = Ray.new(rootpart.CFrame.p, rootpart.CFrame.rightVector * 2.5)
  466. local wallrighthit, rootrightraypos = workspace:FindPartOnRayWithIgnoreList(rootrightray, {owner.Character})
  467. if not wallrighthit then
  468. break
  469. end
  470. local rootfrontray = Ray.new(rootpart.CFrame.p, rootpart.CFrame.lookVector * 4)
  471. local rootfrontrayhit, rootfrontraypos = workspace:FindPartOnRayWithIgnoreList(rootfrontray, {owner.Character})
  472. if rootfrontrayhit then
  473. break
  474. end
  475. humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.fromEulerAnglesXYZ(0,0,math.rad(30)),0.3)
  476. head.C0 = head.C0:lerp(CFrame.new(0,1,0) * CFrame.Angles(0,0,0) * CFrame.new(0,0.5,0),0.3)
  477. leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.5,0.5,0) * CFrame.Angles(-math.sin(tick()*14)*1.3,0,math.rad(-15)) * CFrame.new(0,-0.5,0),0.3)
  478. rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.Angles(0,0,math.pi/1.5) * CFrame.new(0,-0.5,0),0.3)
  479. leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.5,-1+math.cos(tick()*14)/2,-math.cos(tick()*14)/2) * CFrame.fromEulerAnglesXYZ(math.sin(tick()*14),0,0) * CFrame.new(0,-1,0),0.2)
  480. rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.5,-1-math.cos(tick()*14)/2,math.cos(tick()*14)/2) * CFrame.fromEulerAnglesXYZ(-math.sin(tick()*14),0,0) * CFrame.new(0,-1,0),0.2)
  481. runservice.Stepped:wait()
  482. end
  483. end
  484. action:destroy()
  485. candothat = false
  486. if jumped then
  487. goupvel.Velocity = goupvel.Velocity + (rootpart.CFrame.rightVector*-20) + Vector3.new(0,5,0)
  488. game.Debris:AddItem(goupvel, 0.25)
  489. for i = 0,0.6 ,0.03 do
  490. if not cananimate then
  491. head.C0 = head.C0:lerp(CFrame.new(0,1,0) * CFrame.fromEulerAnglesXYZ(math.rad(10),math.rad(-5),0) * CFrame.new(0,0.5,0),i)
  492. leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.5,-1,0) * CFrame.fromEulerAnglesXYZ(-math.rad(40),0,math.rad(-2)) * CFrame.new(0,-1,0),i)
  493. rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.5,-1,0) * CFrame.fromEulerAnglesXYZ(math.rad(40),0,math.rad(2)) * CFrame.new(0,-1,0),i)
  494. humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.fromEulerAnglesXYZ(math.rad(-10),0,math.rad(10)),i)
  495. leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.5,0.5,-0.5) * CFrame.fromEulerAnglesXYZ(math.pi/2+math.rad(20),0,0) * CFrame.new(0,-0.5,0),i)
  496. rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.fromEulerAnglesXYZ(-math.pi/3,0,0) * CFrame.new(0,-0.5,0),i)
  497. runservice.Stepped:wait()
  498. end
  499. end
  500. else
  501. goupvel:destroy()
  502. end
  503. humanoid.AutoRotate = true
  504. cananimate = true
  505. cando = true
  506. elseif what == "hwallrunleft" and anim == "jumprun" or anim == "fallrun" and rayepos ~= nil then
  507. cananimate = false
  508. cando = false
  509. humanoid.AutoRotate = false
  510. local action = Instance.new("BoolValue", character)
  511. action.Name = "hwallrunleft"
  512. rootpart.CFrame = CFrame.new(rayepos, rayepos + rayesurface) * CFrame.fromEulerAnglesXYZ(0,math.pi/2,0)
  513. rootpart.CFrame = rootpart.CFrame * CFrame.new(1.8,0,0)
  514. if rootpart:findFirstChild("wallrunvel") then
  515. rootpart:findFirstChild("wallrunvel"):destroy()
  516. end
  517. local goupvel = Instance.new("BodyVelocity", rootpart)
  518. goupvel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  519. goupvel.Velocity = rootpart.CFrame.lookVector * 20
  520. goupvel.Name = "wallrunvel"
  521. runsound.PlaybackSpeed = 1.7
  522. runsound.Volume = 1.5
  523. local jumped = false
  524. local shouldcontinue = true
  525. local candothat = true
  526. for i = 1,20 do
  527. local rootrightray = Ray.new(rootpart.CFrame.p, rootpart.CFrame.rightVector * -2.5)
  528. local wallrighthit, rootrightraypos = workspace:FindPartOnRayWithIgnoreList(rootrightray, {owner.Character})
  529. if not wallrighthit then
  530. shouldcontinue = false
  531. break
  532. end
  533. local rootfrontray = Ray.new(rootpart.CFrame.p, rootpart.CFrame.lookVector * 4)
  534. local rootfrontrayhit, rootfrontraypos = workspace:FindPartOnRayWithIgnoreList(rootfrontray, {owner.Character})
  535. if rootfrontrayhit then
  536. shouldcontinue = false
  537. break
  538. end
  539. humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.fromEulerAnglesXYZ(0,0,math.rad(-30)),0.3)
  540. head.C0 = head.C0:lerp(CFrame.new(0,1,0) * CFrame.Angles(0,0,0) * CFrame.new(0,0.5,0),0.3)
  541. leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.5,0.5,0) * CFrame.Angles(0,0,-math.pi/1.5) * CFrame.new(0,-0.5,0),0.3)
  542. rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.Angles(-math.sin(tick()*14)*1.3,0,math.rad(15)) * CFrame.new(0,-0.5,0),0.3)
  543. leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.5,-1+math.cos(tick()*14)/2,-math.cos(tick()*14)/2) * CFrame.fromEulerAnglesXYZ(math.sin(tick()*14),0,0) * CFrame.new(0,-1,0),0.2)
  544. rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.5,-1-math.cos(tick()*14)/2,math.cos(tick()*14)/2) * CFrame.fromEulerAnglesXYZ(-math.sin(tick()*14),0,0) * CFrame.new(0,-1,0),0.2)
  545. runservice.Stepped:wait()
  546. end
  547. for i = 1,60 do
  548. if candothat then
  549. if not shouldcontinue then
  550. break
  551. end
  552. if humanoid.Jump then
  553. jumped = true
  554. break
  555. end
  556. local rootrightray = Ray.new(rootpart.CFrame.p, rootpart.CFrame.rightVector * -2.5)
  557. local wallrighthit, rootrightraypos = workspace:FindPartOnRayWithIgnoreList(rootrightray, {owner.Character})
  558. if not wallrighthit then
  559. break
  560. end
  561. local rootfrontray = Ray.new(rootpart.CFrame.p, rootpart.CFrame.lookVector * 4)
  562. local rootfrontrayhit, rootfrontraypos = workspace:FindPartOnRayWithIgnoreList(rootfrontray, {owner.Character})
  563. if rootfrontrayhit then
  564. break
  565. end
  566. humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.fromEulerAnglesXYZ(0,0,math.rad(-30)),0.3)
  567. head.C0 = head.C0:lerp(CFrame.new(0,1,0) * CFrame.Angles(0,0,0) * CFrame.new(0,0.5,0),0.3)
  568. leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.5,0.5,0) * CFrame.Angles(0,0,-math.pi/1.5) * CFrame.new(0,-0.5,0),0.3)
  569. rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.Angles(-math.sin(tick()*14)*1.3,0,math.rad(15)) * CFrame.new(0,-0.5,0),0.3)
  570. leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.5,-1+math.cos(tick()*14)/2,-math.cos(tick()*14)/2) * CFrame.fromEulerAnglesXYZ(math.sin(tick()*14),0,0) * CFrame.new(0,-1,0),0.2)
  571. rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.5,-1-math.cos(tick()*14)/2,math.cos(tick()*14)/2) * CFrame.fromEulerAnglesXYZ(-math.sin(tick()*14),0,0) * CFrame.new(0,-1,0),0.2)
  572. runservice.Stepped:wait()
  573. end
  574. end
  575. action:destroy()
  576. candothat = false
  577. if jumped then
  578. goupvel.Velocity = goupvel.Velocity + (rootpart.CFrame.rightVector*20) + Vector3.new(0,5,0)
  579. game.Debris:AddItem(goupvel, 0.25)
  580. for i = 0,0.6 ,0.03 do
  581. if not cananimate then
  582. head.C0 = head.C0:lerp(CFrame.new(0,1,0) * CFrame.fromEulerAnglesXYZ(math.rad(10),math.rad(-5),0) * CFrame.new(0,0.5,0),i)
  583. leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.5,-1,0) * CFrame.fromEulerAnglesXYZ(-math.rad(40),0,math.rad(-2)) * CFrame.new(0,-1,0),i)
  584. rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.5,-1,0) * CFrame.fromEulerAnglesXYZ(math.rad(40),0,math.rad(2)) * CFrame.new(0,-1,0),i)
  585. humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.fromEulerAnglesXYZ(math.rad(-10),0,math.rad(-10)),i)
  586. leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.5,0.5,-0.5) * CFrame.fromEulerAnglesXYZ(-math.pi/3,0,0) * CFrame.new(0,-0.5,0),i)
  587. rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.fromEulerAnglesXYZ(math.pi/2+math.rad(20),0,0) * CFrame.new(0,-0.5,0),i)
  588. runservice.Stepped:wait()
  589. end
  590. end
  591. else
  592. goupvel:destroy()
  593. end
  594. humanoid.AutoRotate = true
  595. cananimate = true
  596. cando = true
  597. elseif what == "triggerroll" then
  598. if roll then
  599. roll = false
  600. elseif not roll then
  601. roll = true
  602. end
  603. elseif what == "polegrab" then
  604. local polereally = false
  605. if rayehit.Size.y <= 1 then
  606. if rayehit.Size.z > rayehit.Size.x and rayehit.Size.x <= 1 then
  607. --print("pole z > x")
  608. polereally = true
  609. elseif rayehit.Size.x > rayehit.Size.z and rayehit.Size.z <= 1 then
  610. --print("pole x > z")
  611. polereally = true
  612. end
  613. end
  614. if polereally then
  615. cando = false
  616. cananimate = false
  617. humanoid.AutoRotate = false
  618. rootpart.Anchored = true
  619. grabbedpole = true
  620. local action = Instance.new("BoolValue", character)
  621. action.Name = "pole"
  622. local thesine = 0
  623. local speed = 3
  624. local sineadd = 0.2
  625. local multiply = 1.2
  626. coroutine.wrap(function()
  627. while grabbedpole and runservice.Stepped:wait() do
  628. thesine = thesine + sineadd
  629. head.C0 = head.C0:lerp(CFrame.new(0,1,0) * CFrame.Angles(-math.sin(thesine/speed)*(multiply/1.5),0,0) * CFrame.new(0,0.5,0),0.3)
  630. leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.5,0.5,0) * CFrame.Angles(math.pi,0,0) * CFrame.new(0,-0.8,0),0.3)
  631. rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.Angles(math.pi,0,0) * CFrame.new(0,-0.8,0),0.3)
  632. leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.5,-1,0) * CFrame.Angles(math.sin(thesine/speed)*multiply,0,0) * CFrame.new(0,-1,0),0.3)
  633. rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.5,-1,0) * CFrame.Angles(math.sin(thesine/speed)*multiply,0,0) * CFrame.new(0,-1,0),0.3)
  634. rootpart.CFrame = CFrame.new(rayepos, rayepos + rayesurface) * CFrame.fromEulerAnglesXYZ(-math.sin(thesine/speed)*multiply,math.pi,0) * CFrame.new(0,-2.5,0)
  635. if humanoid.Jump and math.sin(thesine/speed) > 0.2 then
  636. rootpart.Anchored = false
  637. grabbedpole = false
  638. action:destroy()
  639. local v = Instance.new("BodyVelocity", rootpart)
  640. v.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  641. v.Velocity = rootpart.CFrame.lookVector * 20
  642. game.Debris:AddItem(v, 0.5)
  643. humanoid.AutoRotate = true
  644. cananimate = true
  645. cando = true
  646. break
  647. end
  648. end
  649. end)()
  650. end
  651. end
  652. end
  653. end)
  654. coroutine.wrap(function()
  655. while runservice.Stepped:wait() do
  656. if rootpart.Velocity.x >= 2 or rootpart.Velocity.x <= -2 or rootpart.Velocity.z >= 2 or rootpart.Velocity.z <= -2 then
  657. if humanoid.FloorMaterial == Enum.Material.Air then
  658. if rootpart.Velocity.x >= 16 or rootpart.Velocity.x <= -16 or rootpart.Velocity.z >= 16 or rootpart.Velocity.z <= -16 then
  659. if rootpart.Velocity.y >= 3 then
  660. anim = "jumprun"
  661. --print("jumping (running)")
  662. elseif rootpart.Velocity.y <= -3 then
  663. anim = "fallrun"
  664. --("falling (running)")
  665. end
  666. else
  667. if rootpart.Velocity.y >= 3 then
  668. anim = "jump"
  669. --print("jumping (walking)")
  670. elseif rootpart.Velocity.y <= -3 then
  671. anim = "fall"
  672. --print("falling (walking)")
  673. end
  674. end
  675. else
  676. if rootpart.Velocity.x >= 16 or rootpart.Velocity.x <= -16 or rootpart.Velocity.z >= 16 or rootpart.Velocity.z <= -16 then
  677. anim = "run"
  678. --print("running")
  679. else
  680. anim = "walk"
  681. --print("walking")
  682. end
  683. end
  684. elseif rootpart.Velocity.x <= 2 or rootpart.Velocity.x >= -2 or rootpart.Velocity.z <= 2 or rootpart.Velocity.z >= -2 then
  685. if humanoid.FloorMaterial == Enum.Material.Air then
  686. if rootpart.Velocity.y >= 3 then
  687. anim = "jump"
  688. --print("jumping (standing)")
  689. elseif rootpart.Velocity.y < -3 then
  690. anim = "fall"
  691. --print("falling (standing)")
  692. end
  693. else
  694. anim = "idle"
  695. --print("standing")
  696. end
  697. end
  698. end
  699. end)()
  700. coroutine.wrap(function()
  701. while runservice.Stepped:wait() do
  702. if rootpart.Velocity.y < -90 then
  703. while rootpart.Velocity.y < 0 and rootpart.Velocity.y >= -135 and runservice.Stepped:wait() do
  704. --print("falling")
  705. end
  706. if rootpart.Velocity.y >= -135 then
  707. cananimate = false
  708. if not roll then
  709. print('hit ground')
  710. runsound.Volume = 0
  711. bodyhitsound.TimePosition = 1
  712. bodyhitsound:Play()
  713. local action = Instance.new("BoolValue", character)
  714. action.Name = "ouchfell"
  715. humanoid.WalkSpeed = 0
  716. humanoid.JumpPower = 0
  717. humanoid.Health = humanoid.Health - math.random(30,60)
  718. for i = 0,1 , 0.04 do
  719. humanoid.WalkSpeed = 0
  720. humanoid.JumpPower = 0
  721. rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.03661776, -0.287070274, -0.937994003, 1, 2.13205098e-09, 1.80749957e-08, 2.98023224e-08, 0.642787397, -0.766044438, 4.47034836e-08, 0.766044438, 0.642787457),i)
  722. leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.5, 0.00759601593, -0.0868253708, 1.00000012, 4.17280432e-09, 2.23762484e-08, 3.55271368e-15, 0.98480767, -0.173648164, 2.98023224e-08, 0.173648179, 0.98480773),i)
  723. leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.188133717, -0.968682289, -0.200000763, 0.939692676, -0.342020154, 2.98023224e-08, 0.342020094, 0.939692557, -8.8817842e-16, 2.7206255e-08, -7.1326367e-09, 1),i)
  724. rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.5, -2, -9.53674316e-07, 1.00000012, 3.55271368e-15, 2.98023224e-08, 3.55271368e-15, 0.99999994, -8.8817842e-16, 2.98023224e-08, -8.8817842e-16, 1),i)
  725. humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.new(0.138917923, -1.81215382, -0.199999809, -0.17364794, 0, 0.984807789, -0.984807849, -4.37113883e-08, -0.173647955, 4.3047315e-08, -1, 7.59039409e-09),i)
  726. head.C0 = head.C0:lerp(CFrame.new(0, 1.3184042, -0.620952606, 1.00000012, -2.15236486e-08, 7.42341655e-09, 3.55271368e-15, 0.499999791, 0.866025388, 2.98023224e-08, -0.866025388, 0.499999791),i)
  727. runservice.Stepped:wait()
  728. end
  729. wait(0.7)
  730. for i = 0,0.35 , 0.005 do
  731. humanoid.WalkSpeed = 0
  732. humanoid.JumpPower = 0
  733. rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.43661785, 0.8717556, -1.1015135, 0.99999994, -1.49011354e-08, 2.58095625e-08, 2.98023171e-08, -0.342020303, -0.939692438, 1.49011914e-08, 0.939692736, -0.342020363),i)
  734. leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.5, 0.691013336, -1.08328879, 1, 1.29770106e-14, -3.44476568e-15, -1.36212808e-15, -0.173648149, -0.98480767, 2.84217094e-14, 0.984807968, -0.173648193),i)
  735. leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.5, -0.697739601, -0.911438107, 0.99999994, 6.67691635e-15, 1.17806545e-14, -1.36212851e-15, 0.939692438, -0.342020303, 2.84217094e-14, 0.342020422, 0.939692795),i)
  736. rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.500000954, -1.51961517, -1.30000019, 1, 6.15348006e-15, 1.0658141e-14, -1.36212808e-15, 0.866025329, -0.49999997, 2.84217094e-14, 0.500000119, 0.866025627),i)
  737. humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.new(0.138917923, -0.812153816, -0.199999809, 1, 0, -1.93715096e-07, 1.93715096e-07, -4.37113883e-08, 1.00000012, -7.10542736e-15, -1, -4.37113883e-08),i)
  738. head.C0 = head.C0:lerp(CFrame.new(0, 1.56080723, -0.0747625828, 1, -3.66066168e-15, 2.96555518e-14, -1.36212808e-15, 0.98480767, 0.173648074, 2.84217094e-14, -0.173648104, 0.984807909),i)
  739. runservice.Stepped:wait()
  740. end
  741. humanoid.JumpPower = 50
  742. game.Debris:AddItem(action, 0.3)
  743. cananimate = true
  744. else
  745. local action = Instance.new("BoolValue", character)
  746. action.Name = "rollin"
  747. local rotva = 0
  748. coroutine.wrap(function()
  749. humanoidrootpart.C0 = CFrame.new(0,-1.5,0)
  750. for i = 1,35 do
  751. rootpart.CFrame = rootpart.CFrame * CFrame.new(0,0,-0.3)
  752. humanoidrootpart.C0 = humanoidrootpart.C0 * CFrame.fromEulerAnglesXYZ(math.rad(-8.5),0,0)
  753. runservice.Stepped:wait()
  754. end
  755. action:destroy()
  756. cananimate = true
  757. end)()
  758. for i = 0,1 , 0.04 do
  759. rightarm.C0 = rightarm.C0:lerp(CFrame.new(0.5, 0.41317749, -1.40775204, 1.12057243e-08, 1, 4.07854905e-09, 0.173648134, 2.0707327e-09, -0.984807491, -0.984807551, 1.17437136e-08, -0.173648149),i)
  760. leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.5, 0.178607941, -0.38302207, 1, 0, 0, 0, 0.642787397, -0.766044199, 0, 0.766044259, 0.642787457),i)
  761. leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.5, -0.93637085, -0.903905869, 1, 0, 0, 0, 0.642787278, 0.766044319, 0, -0.766044378, 0.642787337),i)
  762. rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.5, -1.08567047, -0.913578272, 1, 0, 0, 0, 0.642787516, 0.76604408, 0, -0.76604414, 0.642787576),i)
  763. head.C0 = head.C0:lerp(CFrame.new(0, 1.30701828, -0.629077435, 1, 0, 0, 0, 0.438599855, 0.898682296, 0, -0.898682296, 0.438599855),i)
  764. runservice.Stepped:wait()
  765. end
  766. end
  767. elseif rootpart.Velocity.y < -135 then
  768. fallingtodeath = true
  769. local action = Instance.new("BoolValue", character)
  770. action.Name = "FALLING"
  771. local i = 0
  772. while runservice.Stepped:wait() do
  773. fallingsound.Volume = fallingsound.Volume + 0.06
  774. i = i + 1
  775. humanoidrootpart.C0 = humanoidrootpart.C0 * CFrame.fromEulerAnglesXYZ(math.rad(1.5),math.rad(0.5),math.rad(1))
  776. head.C0 = head.C0:lerp(CFrame.new(0,1,0) * CFrame.Angles(math.rad(-10),0,0) * CFrame.new(0,0.5,0),0.2)
  777. leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.5,0.5,0) * CFrame.Angles(math.pi/2+math.sin(i/5)*1.8,0,math.cos(i/5)/1.5) * CFrame.new(0,-0.7,0),0.2)
  778. rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.Angles(math.pi/2+math.sin(i/4.5)*1.8,0,-math.cos(i/5)/1.5) * CFrame.new(0,-0.7,0),0.2)
  779. leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.5,-1-math.cos(i/5)/2,0) * CFrame.Angles(-math.sin(i/5),0,0) * CFrame.new(0,-1,0),0.2)
  780. rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.5,-1+math.cos(i/5)/2,0) * CFrame.Angles(math.sin(i/5),0,0) * CFrame.new(0,-1,0),0.2)
  781. --print('death falling')
  782. end
  783. end
  784. end
  785. end
  786. end)()
  787. while runservice.Stepped:wait() do
  788. if cananimate and not fallingtodeath then
  789. runsound.Volume = 0
  790. if anim == "idle" then
  791. head.C0 = head.C0:lerp(CFrame.new(0,1,0) * CFrame.fromEulerAnglesXYZ(0,math.rad(-5),0) * CFrame.new(0,0.5,0),0.2)
  792. leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.5,-1-math.cos(tick())/15,0) * CFrame.fromEulerAnglesXYZ(0,0,math.rad(-2)) * CFrame.new(0,-1,0),0.2)
  793. rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.5,-1-math.cos(tick())/15,0) * CFrame.fromEulerAnglesXYZ(0,0,math.rad(2)) * CFrame.new(0,-1,0),0.2)
  794. humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.new(0,math.cos(tick())/15,0) * CFrame.fromEulerAnglesXYZ(0,math.rad(5),0),0.2)
  795. leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.5,0.5,0) * CFrame.fromEulerAnglesXYZ(0,0,math.rad(-5)-math.sin(tick())/20) * CFrame.new(0,-0.5,0),0.2)
  796. rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.fromEulerAnglesXYZ(0,0,math.rad(5)+math.sin(tick())/20) * CFrame.new(0,-0.5,0),0.2)
  797. elseif anim == "walk" then
  798. runsound.Volume = 0.4
  799. runsound.PlaybackSpeed = 1.1
  800. head.C0 = head.C0:lerp(CFrame.new(0,1,0) * CFrame.fromEulerAnglesXYZ(0,0,0) * CFrame.new(0,0.5,0),0.2)
  801. leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.5,-1+math.cos(tick()*12)/4,-math.cos(tick()*12)/1.5) * CFrame.fromEulerAnglesXYZ(math.sin(tick()*12)*1.5,0,0) * CFrame.new(0,-1,0),0.2)
  802. rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.5,-1-math.cos(tick()*12)/4,math.cos(tick()*12)/1.5) * CFrame.fromEulerAnglesXYZ(-math.sin(tick()*12)*1.5,0,0) * CFrame.new(0,-1,0),0.2)
  803. humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.new(0,math.sin(tick()*24)/12,0) * CFrame.fromEulerAnglesXYZ(-math.rad(5),0,0),0.2)
  804. leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.5,0.3+math.sin(tick()*12)/3,-0.2+math.sin(tick()*12)/2) * CFrame.fromEulerAnglesXYZ(math.rad(40)-math.sin(tick()*12)*2,0,-math.sin(tick()*12)/2.5) * CFrame.new(0,-0.5,0),0.2)
  805. rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.5,0.3-math.sin(tick()*12)/3,-0.2-math.sin(tick()*12)/2) * CFrame.fromEulerAnglesXYZ(math.rad(40)+math.sin(tick()*12)*2,0,-math.sin(tick()*12)/2.5) * CFrame.new(0,-0.5,0),0.2)
  806. elseif anim == "run" then
  807. runsound.Volume = 1
  808. runsound.PlaybackSpeed = 1.4
  809. head.C0 = head.C0:lerp(CFrame.new(0,1,0) * CFrame.fromEulerAnglesXYZ(math.rad(10),0,0) * CFrame.new(0,0.5,0),0.2)
  810. leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.5,-1+math.cos(tick()*12)/2,-math.cos(tick()*12)/1.5) * CFrame.fromEulerAnglesXYZ(math.sin(tick()*12)*1.4,0,0) * CFrame.new(0,-1,0),0.2)
  811. rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.5,-1-math.cos(tick()*12)/2,math.cos(tick()*12)/1.5) * CFrame.fromEulerAnglesXYZ(-math.sin(tick()*12)*1.4,0,0) * CFrame.new(0,-1,0),0.2)
  812. humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.new(0,-0.2+math.sin(tick()*24)/10,0) * CFrame.fromEulerAnglesXYZ(0,math.rad(-rootpart.Orientation.y),0) * CFrame.fromEulerAnglesXYZ(humanoid.MoveDirection.z/5,0,-humanoid.MoveDirection.x/5) * CFrame.fromEulerAnglesXYZ(0,math.rad(rootpart.Orientation.y),0) * CFrame.fromEulerAnglesXYZ(-math.rad(10),0,0),0.2)
  813. leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.5,0.5,0) * CFrame.fromEulerAnglesXYZ(math.rad(10)-math.sin(tick()*12)*1.9,0,-math.sin(tick()*12)/2.5) * CFrame.new(0,-0.7,0),0.2)
  814. rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.fromEulerAnglesXYZ(math.rad(10)+math.sin(tick()*12)*1.9,0,-math.sin(tick()*12)/2.5) * CFrame.new(0,-0.7,0),0.2)
  815. elseif anim == "jumprun" or anim == "fallrun" then
  816. if not roll then
  817. head.C0 = head.C0:lerp(CFrame.new(0,1,0) * CFrame.fromEulerAnglesXYZ(math.rad(20),0,0) * CFrame.new(0,0.5,0),0.2)
  818. leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.5,-1-math.cos(tick())/15,0) * CFrame.fromEulerAnglesXYZ(math.sin(tick()*2),0,math.rad(-2)) * CFrame.new(0,-1,0),0.2)
  819. rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.5,-1-math.cos(tick())/15,0) * CFrame.fromEulerAnglesXYZ(-math.sin(tick()*2),0,math.rad(2)) * CFrame.new(0,-1,0),0.2)
  820. humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.new(0,math.cos(tick())/15,0) * CFrame.fromEulerAnglesXYZ(math.rad(-20),0,0),0.2)
  821. leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.5,0.5,0) * CFrame.fromEulerAnglesXYZ(-math.pi/3+math.sin(tick()*2)/5,0,math.cos(tick()*2)/5) * CFrame.new(0,-0.5,0),0.2)
  822. rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.fromEulerAnglesXYZ(math.pi/2+math.rad(20)+math.sin(tick()*2)/5,0,-math.cos(tick()*2)/5) * CFrame.new(0,-0.5,0),0.2)
  823. else
  824. head.C0 = head.C0:lerp(CFrame.new(0, 1.38302183, -0.321395874, 1, 0, 0, 0, 0.766044259, 0.642787695, 0, -0.642787695, 0.766044259),0.2)
  825. leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.5, -2.00000048, 3.81469727e-06, 1, 0, 0, 0, 0.99999994, 0, 0, 1.49011612e-08, 1),0.2)
  826. rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.5, -2.00000048, 3.81469727e-06, 1, 0, 0, 0, 0.99999994, 0, 0, 1.49011612e-08, 1),0.2)
  827. humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.new(0, 0, 0, 1, 0, 0, 0, 0.984807789, 0.17364797, 0, -0.17364797, 0.984807789),0.2)
  828. leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.18301296, -0.0232186317, -0.439029694, 0.866025329, -0.49999997, 0, 0.383022159, 0.663413882, -0.642787457, 0.321393758, 0.556670368, 0.766044438),0.2)
  829. rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.18301296, -0.0232186317, -0.439029694, 0.866025388, 0.5, 0, -0.3830221, 0.663413823, -0.642787635, -0.321393877, 0.556670487, 0.766044259),0.2)
  830. end
  831. elseif anim == "jump" or anim == "fall" then
  832. head.C0 = head.C0:lerp(CFrame.new(0,1,0) * CFrame.fromEulerAnglesXYZ(0,0,0) * CFrame.new(0,0.5,0),0.2)
  833. leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.5,0,-0.5) * CFrame.fromEulerAnglesXYZ(0,0,math.rad(-2)) * CFrame.new(0,-1,0),0.2)
  834. rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.5,-1,0) * CFrame.fromEulerAnglesXYZ(0,0,math.rad(2)) * CFrame.new(0,-1,0),0.2)
  835. humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.new(0,math.cos(tick())/15,0) * CFrame.fromEulerAnglesXYZ(0,0,0),0.2)
  836. leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.5,0.5,0) * CFrame.fromEulerAnglesXYZ(math.pi-math.rad(30),0,0) * CFrame.new(0,-0.5,0),0.2)
  837. rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.fromEulerAnglesXYZ(math.pi-math.rad(30),0,0) * CFrame.new(0,-0.5,0),0.2)
  838. end
  839. end
  840. end
Add Comment
Please, Sign In to add comment