GangHaning

Untitled

Dec 8th, 2016
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 28.82 KB | None | 0 0
  1. -- Decompiled by Blyat
  2. -- Fixed by Ben
  3.  
  4. script.Parent = nil
  5. Character = game.Players.localPlayer.Character
  6. Humanoid = Character.Humanoid
  7. if Humanoid:findFirstChild("Animate") then
  8. Humanoid:findFirstChild("Animate"):Destroy()
  9. end
  10. Player = game:GetService("Players").LocalPlayer
  11. Character = Player.Character
  12. PlayerGui = Player.PlayerGui
  13. Backpack = Player.Backpack
  14. Torso = Character.Torso
  15. Head = Character.Head
  16. Humanoid = Character.Humanoid
  17. m = Instance.new("Model", Character)
  18. LeftArm = Character["Left Arm"]
  19. LeftLeg = Character["Left Leg"]
  20. RightArm = Character["Right Arm"]
  21. RightLeg = Character["Right Leg"]
  22. LS = Torso["Left Shoulder"]
  23. LH = Torso["Left Hip"]
  24. RS = Torso["Right Shoulder"]
  25. RH = Torso["Right Hip"]
  26. Face = Head.face
  27. Neck = Torso.Neck
  28. attacktype = 1
  29. vt = Vector3.new
  30. cf = CFrame.new
  31. euler = CFrame.fromEulerAnglesXYZ
  32. angles = CFrame.Angles
  33. cloaked = false
  34. necko = cf(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0)
  35. necko2 = cf(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0)
  36. LHC0 = cf(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  37. LHC1 = cf(-0.5, 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  38. RHC0 = cf(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  39. RHC1 = cf(0.5, 1, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  40. RootPart = Character.HumanoidRootPart
  41. RootJoint = RootPart.RootJoint
  42. RootCF = euler(-1.57, 0, 3.14)
  43. attack = false
  44. attackdebounce = false
  45. deb = false
  46. equipped = true
  47. hand = false
  48. MMouse = nil
  49. combo = 0
  50. mana = 0
  51. trispeed = 0.2
  52. attackmode = "none"
  53. local idle = 0
  54. local Anim = "Idle"
  55. local gun = false
  56. local shoot = false
  57. player = nil
  58. mana = 0
  59. local defensevalue = 0.3
  60. local speedvalue = 1
  61. local damagevalue = 1
  62. local cf = CFrame.new
  63. local mr = math.rad
  64. local angles = CFrame.Angles
  65. local ud = UDim2.new
  66. local c3 = Color3.new
  67. local stats = Instance.new("Folder", Character)
  68. stats.Name = "Stats"
  69. local block = Instance.new("BoolValue", stats)
  70. block.Name = "Block"
  71. block.Value = false
  72. local stun = Instance.new("BoolValue", stats)
  73. stun.Name = "Stun"
  74. stun.Value = false
  75. local defense = Instance.new("NumberValue", stats)
  76. defense.Name = "Defence"
  77. defense.Value = defensevalue
  78. local speed = Instance.new("NumberValue", stats)
  79. speed.Name = "Speed"
  80. speed.Value = speedvalue
  81. local damagea = Instance.new("NumberValue", stats)
  82. damagea.Name = "Damage"
  83. damagea.Value = damagevalue
  84. Humanoid = Character.Humanoid
  85. if Humanoid:FindFirstChild("Animator") then
  86. Humanoid:FindFirstChild("Animator"):Destroy()
  87. end
  88. Humanoid.WalkSpeed = 3
  89. Colorpart1 = Torso.BrickColor.r
  90. Colorpart2 = Torso.BrickColor.g
  91. Colorpart3 = Torso.BrickColor.b
  92. CloakEffectLight2 = Instance.new("PointLight", Torso)
  93. CloakEffectLight2.Color = Color3.new(Colorpart1, Colorpart2, Colorpart3)
  94. CloakEffectLight2.Range = 7.5
  95. CloakEffectLight2.Brightness = 7.5
  96. CloakEffectLight2.Enabled = true
  97. mouse = Player:GetMouse()
  98. RSH = nil
  99. RW = Instance.new("Motor")
  100. LW = Instance.new("Motor")
  101. RW.Name = "Right Shoulder"
  102. LW.Name = "Left Shoulder"
  103. LH = Torso["Left Hip"]
  104. RH = Torso["Right Hip"]
  105. TorsoColor = Torso.BrickColor
  106. NoOutline = function(Part)
  107.  
  108. Part.TopSurface = 10
  109. end
  110.  
  111. player = Player
  112. ch = Character
  113. RSH = ch.Torso["Right Shoulder"]
  114. LSH = ch.Torso["Left Shoulder"]
  115. RSH.Parent = nil
  116. LSH.Parent = nil
  117. RW.Name = "Right Shoulder"
  118. RW.Part0 = ch.Torso
  119. RW.C0 = cf(1.5, 0.5, 0)
  120. RW.C1 = cf(0, 0.5, 0)
  121. RW.Part1 = ch["Right Arm"]
  122. RW.Parent = ch.Torso
  123. LW.Name = "Left Shoulder"
  124. LW.Part0 = ch.Torso
  125. LW.C0 = cf(-1.5, 0.5, 0)
  126. LW.C1 = cf(0, 0.5, 0)
  127. LW.Part1 = ch["Left Arm"]
  128. LW.Parent = ch.Torso
  129. local weldBetween = function(a, b)
  130.  
  131. local weldd = Instance.new("ManualWeld")
  132. weldd.Part0 = a
  133. weldd.Part1 = b
  134. weldd.C0 = CFrame.new()
  135. weldd.C1 = b.CFrame:inverse() * a.CFrame
  136. weldd.Parent = a
  137. return weldd
  138. end
  139.  
  140. fat = Instance.new("BindableEvent", script)
  141. fat.Name = "Heartbeat"
  142. script:WaitForChild("Heartbeat")
  143. frame = 0.033333333333333
  144. tf = 0
  145. allowframeloss = false
  146. tossremainder = false
  147. lastframe = tick()
  148. script.Heartbeat:Fire()
  149. game:GetService("RunService").Heartbeat:connect(function(s, p)
  150.  
  151. tf = tf + s
  152. if frame <= tf then
  153. if allowframeloss then
  154. script.Heartbeat:Fire()
  155. lastframe = tick()
  156. else
  157. for i = 1, math.floor(tf / frame) do
  158. script.Heartbeat:Fire()
  159. end
  160. lastframe = tick()
  161. end
  162. if tossremainder then
  163. tf = 0
  164. else
  165. tf = tf - frame * math.floor(tf / frame)
  166. end
  167. end
  168. end
  169. )
  170. local CFrameFromTopBack = function(at, top, back)
  171.  
  172. local right = top:Cross(back)
  173. return CFrame.new(at.x, at.y, at.z, right.x, top.x, back.x, right.y, top.y, back.y, right.z, top.z, back.z)
  174. end
  175.  
  176. Triangle = function(a, b, c)
  177.  
  178. local edg1 = c - a:Dot(b - a.unit)
  179. local edg2 = a - b:Dot(c - b.unit)
  180. local edg3 = b - c:Dot(a - c.unit)
  181. if edg1 <= b - a.magnitude and edg1 >= 0 then
  182. a = a
  183. else
  184. -- DECOMPILER ERROR at PC35: Overwrote pending register: R1 in 'AssignReg'
  185.  
  186. if edg2 <= c - b.magnitude and edg2 >= 0 then
  187. a = b
  188. else
  189. -- DECOMPILER ERROR at PC46: Overwrote pending register: R2 in 'AssignReg'
  190.  
  191. -- DECOMPILER ERROR at PC47: Overwrote pending register: R1 in 'AssignReg'
  192.  
  193. if edg3 <= a - c.magnitude and edg3 >= 0 then
  194. a = c
  195. else
  196. assert(false, "unreachable")
  197. end
  198. end
  199. end
  200. local len1 = c - a:Dot(b - a.unit)
  201. local len2 = b - a.magnitude - len1
  202. local width = a + b - a.unit * len1 - c.magnitude
  203. local maincf = CFrameFromTopBack(a, b - a:Cross(c - b).unit, -b - a.unit)
  204. local list = {}
  205. local TrailColor = "Dark grey"
  206. if len1 > 0.01 then
  207. local w1 = Instance.new("WedgePart", m)
  208. game:GetService("Debris"):AddItem(w1, 5)
  209. w1.Material = "SmoothPlastic"
  210. w1.FormFactor = "Custom"
  211. w1.BrickColor = BrickColor.new(TrailColor)
  212. w1.Transparency = 0
  213. w1.Reflectance = 0
  214. w1.Material = "SmoothPlastic"
  215. w1.CanCollide = false
  216. NoOutline(w1)
  217. local sz = Vector3.new(0.2, width, len1)
  218. w1.Size = sz
  219. local sp = Instance.new("SpecialMesh", w1)
  220. sp.MeshType = "Wedge"
  221. sp.Scale = Vector3.new(0, 1, 1) * sz / w1.Size
  222. w1:BreakJoints()
  223. w1.Anchored = true
  224. w1.Parent = workspace
  225. w1.Transparency = 0.7
  226. table.insert(Effects, {w1, "Disappear", 0.01})
  227. w1.CFrame = maincf * CFrame.Angles(math.pi, 0, math.pi / 2) * CFrame.new(0, width / 2, len1 / 2)
  228. table.insert(list, w1)
  229. end
  230. do
  231. if len2 > 0.01 then
  232. local w2 = Instance.new("WedgePart", m)
  233. game:GetService("Debris"):AddItem(w2, 5)
  234. w2.Material = "SmoothPlastic"
  235. w2.FormFactor = "Custom"
  236. w2.BrickColor = BrickColor.new(TrailColor)
  237. w2.Transparency = 0
  238. w2.Reflectance = 0
  239. w2.Material = "SmoothPlastic"
  240. w2.CanCollide = false
  241. NoOutline(w2)
  242. local sz = Vector3.new(0.2, width, len2)
  243. w2.Size = sz
  244. local sp = Instance.new("SpecialMesh", w2)
  245. sp.MeshType = "Wedge"
  246. sp.Scale = Vector3.new(0, 1, 1) * sz / w2.Size
  247. w2:BreakJoints()
  248. w2.Anchored = true
  249. w2.Parent = workspace
  250. w2.Transparency = 0.7
  251. table.insert(Effects, {w2, "Disappear", 0.01})
  252. w2.CFrame = maincf * CFrame.Angles(math.pi, math.pi, -math.pi / 2) * CFrame.new(0, width / 2, -len1 - len2 / 2)
  253. table.insert(list, w2)
  254. end
  255. do
  256. return unpack(list)
  257. end
  258. end
  259. end
  260.  
  261. rayCast = function(Pos, Dir, Max, Ignore)
  262.  
  263. return game:service("Workspace"):FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore)
  264. end
  265.  
  266. clerp = function(a, b, t)
  267.  
  268. local qa = {QuaternionFromCFrame(a)}
  269. local qb = {QuaternionFromCFrame(b)}
  270. local ax, ay, az = a.x, a.y, a.z
  271. local bx, by, bz = b.x, b.y, b.z
  272. local _t = 1 - t
  273. return QuaternionToCFrame(_t * ax + t * bx, _t * ay + t * by, _t * az + t * bz, QuaternionSlerp(qa, qb, t))
  274. end
  275.  
  276. local clerp = CFrame.new().lerp
  277. QuaternionFromCFrame = function(cf)
  278.  
  279. local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
  280. local trace = m00 + m11 + m22
  281. if trace > 0 then
  282. local s = math.sqrt(1 + trace)
  283. local recip = 0.5 / s
  284. return (m21 - m12) * recip, (m02 - m20) * recip, (m10 - m01) * recip, s * 0.5
  285. else
  286. do
  287. local i = 0
  288. if m00 < m11 then
  289. i = 1
  290. end
  291. if i == 0 and m00 or m11 < m22 then
  292. i = 2
  293. end
  294. if i == 0 then
  295. local s = math.sqrt(m00 - m11 - m22 + 1)
  296. local recip = 0.5 / s
  297. return 0.5 * s, (m10 + m01) * recip, (m20 + m02) * recip, (m21 - m12) * recip
  298. else
  299. do
  300. if i == 1 then
  301. local s = math.sqrt(m11 - m22 - m00 + 1)
  302. local recip = 0.5 / s
  303. return (m01 + m10) * recip, 0.5 * s, (m21 + m12) * recip, (m02 - m20) * recip
  304. else
  305. do
  306. if i == 2 then
  307. local s = math.sqrt(m22 - m00 - m11 + 1)
  308. local recip = 0.5 / s
  309. return (m02 + m20) * recip, (m12 + m21) * recip, 0.5 * s, (m10 - m01) * recip
  310. end
  311. end
  312. end
  313. end
  314. end
  315. end
  316. end
  317. end
  318.  
  319. QuaternionToCFrame = function(px, py, pz, x, y, z, w)
  320.  
  321. local xs, ys, zs = x + x, y + y, z + z
  322. local wx, wy, wz = w * xs, w * ys, w * zs
  323. local xx = x * xs
  324. local xy = x * ys
  325. local xz = x * zs
  326. local yy = y * ys
  327. local yz = y * zs
  328. local zz = z * zs
  329. return CFrame.new(px, py, pz, 1 - (yy + zz), xy - wz, xz + wy, xy + wz, 1 - (xx + zz), yz - wx, xz - wy, yz + wx, 1 - (xx + yy))
  330. end
  331.  
  332. QuaternionSlerp = function(a, b, t)
  333.  
  334. local cosTheta = a[1] * b[1] + a[2] * b[2] + a[3] * b[3] + a[4] * b[4]
  335. local startInterp, finishInterp = nil, nil
  336. if cosTheta >= 0.0001 then
  337. if 1 - cosTheta > 0.0001 then
  338. local theta = math.acos(cosTheta)
  339. local invSinTheta = 1 / math.sin(theta)
  340. startInterp = math.sin((1 - t) * theta) * invSinTheta
  341. finishInterp = math.sin(t * theta) * invSinTheta
  342. else
  343. do
  344. startInterp = 1 - t
  345. finishInterp = t
  346. if 1 + cosTheta > 0.0001 then
  347. local theta = math.acos(-cosTheta)
  348. local invSinTheta = 1 / math.sin(theta)
  349. startInterp = math.sin((t - 1) * theta) * invSinTheta
  350. finishInterp = math.sin(t * theta) * invSinTheta
  351. else
  352. do
  353. startInterp = t - 1
  354. finishInterp = t
  355. return a[1] * (startInterp) + b[1] * finishInterp, a[2] * (startInterp) + b[2] * finishInterp, a[3] * (startInterp) + b[3] * finishInterp, a[4] * (startInterp) + b[4] * finishInterp
  356. end
  357. end
  358. end
  359. end
  360. end
  361. end
  362.  
  363. sitting = false
  364. resting = false
  365. meditating = false
  366. sprint = false
  367. mouse.Button1Down:connect(function()
  368.  
  369. end
  370. )
  371. print("Only instinct left is survival.")
  372. mouse.KeyDown:connect(function(k)
  373.  
  374. k = k:lower()
  375. if k == "z" and attack == false and resting == false and sprint == false and meditating == false then
  376. attack = true
  377. if sitting == false then
  378. sitting = true
  379. Humanoid.WalkSpeed = 0
  380. for i = 0, 1, 0.04 do
  381. fat.Event:wait()
  382. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, -1.25) * angles(math.rad(0), math.rad(15), math.rad(0)), 0.15)
  383. Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * cf(0, 0, 0) * angles(math.rad(20), math.rad(0), math.rad(30)), 0.15)
  384. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(0), math.rad(0), math.rad(20)), 0.15)
  385. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.3, 0) * angles(math.rad(15), math.rad(0), math.rad(-25)), 0.15)
  386. RH.C0 = clerp(RH.C0, cf(1, -1, 0) * angles(math.rad(-60), math.rad(90), math.rad(0)) * angles(math.rad(-2.5), math.rad(0), math.rad(0)), 0.15)
  387. LH.C0 = clerp(LH.C0, cf(-0.75, 0.25, -1) * angles(math.rad(-15), math.rad(-90), math.rad(0)) * angles(math.rad(-15), math.rad(0), math.rad(0)), 0.15)
  388. end
  389. else
  390. do
  391. if sitting == true then
  392. sitting = false
  393. for i = 0, 1, 0.04 do
  394. fat.Event:wait()
  395. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, -1.25) * angles(math.rad(0), math.rad(15), math.rad(0)), 0.15)
  396. Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * cf(0, 0, 0) * angles(math.rad(20), math.rad(0), math.rad(30)), 0.15)
  397. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(0), math.rad(0), math.rad(20)), 0.15)
  398. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.3, 0) * angles(math.rad(15), math.rad(0), math.rad(-25)), 0.15)
  399. RH.C0 = clerp(RH.C0, cf(1, -1, 0) * angles(math.rad(-60), math.rad(90), math.rad(0)) * angles(math.rad(-2.5), math.rad(0), math.rad(0)), 0.15)
  400. LH.C0 = clerp(LH.C0, cf(-0.75, 0.25, -1) * angles(math.rad(-15), math.rad(-90), math.rad(0)) * angles(math.rad(-15), math.rad(0), math.rad(0)), 0.15)
  401. end
  402. Humanoid.WalkSpeed = 3
  403. end
  404. attack = false
  405. if k == "x" and attack == false and sitting == false and sprint == false and meditating == false then
  406. attack = true
  407. if resting == false then
  408. resting = true
  409. Humanoid.WalkSpeed = 0
  410. for i = 0, 1, 0.04 do
  411. fat.Event:wait()
  412. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, -1.05) * angles(math.rad(0), math.rad(15), math.rad(0)), 0.15)
  413. Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * cf(0, 0, 0) * angles(math.rad(20), math.rad(0), math.rad(30)), 0.15)
  414. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(0), math.rad(0), math.rad(20)), 0.15)
  415. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.1, 0) * angles(math.rad(15), math.rad(0), math.rad(-25)), 0.15)
  416. RH.C0 = clerp(RH.C0, cf(1, -1, 0) * angles(math.rad(-40), math.rad(90), math.rad(0)) * angles(math.rad(-2.5), math.rad(0), math.rad(0)), 0.15)
  417. LH.C0 = clerp(LH.C0, cf(-0.75, 0.05, -1) * angles(math.rad(-15), math.rad(-90), math.rad(0)) * angles(math.rad(-15), math.rad(0), math.rad(0)), 0.15)
  418. end
  419. else
  420. do
  421. if resting == true then
  422. resting = false
  423. for i = 0, 1, 0.04 do
  424. fat.Event:wait()
  425. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, -1.05) * angles(math.rad(0), math.rad(15), math.rad(0)), 0.15)
  426. Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * cf(0, 0, 0) * angles(math.rad(20), math.rad(0), math.rad(30)), 0.15)
  427. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(0), math.rad(0), math.rad(20)), 0.15)
  428. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.1, 0) * angles(math.rad(15), math.rad(0), math.rad(-25)), 0.15)
  429. RH.C0 = clerp(RH.C0, cf(1, -1, 0) * angles(math.rad(-40), math.rad(90), math.rad(0)) * angles(math.rad(-2.5), math.rad(0), math.rad(0)), 0.15)
  430. LH.C0 = clerp(LH.C0, cf(-0.75, 0.05, -1) * angles(math.rad(-15), math.rad(-90), math.rad(0)) * angles(math.rad(-15), math.rad(0), math.rad(0)), 0.15)
  431. end
  432. Humanoid.WalkSpeed = 3
  433. end
  434. attack = false
  435. if k == "c" and attack == false and sitting == false and resting == false and sprint == false then
  436. attack = true
  437. if meditating == false then
  438. meditating = true
  439. Humanoid.WalkSpeed = 0
  440. for i = 0, 1, 0.04 do
  441. fat.Event:wait()
  442. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, -1.05) * angles(math.rad(0), math.rad(15), math.rad(0)), 0.15)
  443. Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * cf(0, 0, 0) * angles(math.rad(20), math.rad(0), math.rad(30)), 0.15)
  444. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(0), math.rad(0), math.rad(20)), 0.15)
  445. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.1, 0) * angles(math.rad(15), math.rad(0), math.rad(-25)), 0.15)
  446. RH.C0 = clerp(RH.C0, cf(1, -1, 0) * angles(math.rad(-40), math.rad(90), math.rad(0)) * angles(math.rad(-2.5), math.rad(0), math.rad(0)), 0.15)
  447. LH.C0 = clerp(LH.C0, cf(-0.75, 0.05, -1) * angles(math.rad(-15), math.rad(-90), math.rad(0)) * angles(math.rad(-15), math.rad(0), math.rad(0)), 0.15)
  448. end
  449. else
  450. do
  451. if meditating == true then
  452. meditating = false
  453. for i = 0, 1, 0.04 do
  454. fat.Event:wait()
  455. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, -1.05) * angles(math.rad(0), math.rad(15), math.rad(0)), 0.15)
  456. Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * cf(0, 0, 0) * angles(math.rad(20), math.rad(0), math.rad(30)), 0.15)
  457. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(0), math.rad(0), math.rad(20)), 0.15)
  458. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.1, 0) * angles(math.rad(15), math.rad(0), math.rad(-25)), 0.15)
  459. RH.C0 = clerp(RH.C0, cf(1, -1, 0) * angles(math.rad(-40), math.rad(90), math.rad(0)) * angles(math.rad(-2.5), math.rad(0), math.rad(0)), 0.15)
  460. LH.C0 = clerp(LH.C0, cf(-0.75, 0.05, -1) * angles(math.rad(-15), math.rad(-90), math.rad(0)) * angles(math.rad(-15), math.rad(0), math.rad(0)), 0.15)
  461. end
  462. Humanoid.WalkSpeed = 3
  463. end
  464. attack = false
  465. if k == "e" and attack == false and resting == false and sitting == false and meditating == false and sprint == false then
  466. sprint = true
  467. Humanoid.WalkSpeed = 16
  468. end
  469. end
  470. end
  471. end
  472. end
  473. end
  474. end
  475. end
  476. end
  477. end
  478. end
  479. )
  480. mouse.KeyUp:connect(function(k)
  481.  
  482. if k == "e" and attack == false and resting == false and sitting == false and meditating == false and sprint == true then
  483. sprint = false
  484. Humanoid.WalkSpeed = 3
  485. end
  486. end
  487. )
  488. local sine = 0
  489. local change = 1
  490. local val = 0
  491. fat.Event:connect(function()
  492.  
  493. sine = sine + change
  494. local torvel = (RootPart.Velocity * Vector3.new(1, 0, 1)).magnitude
  495. do
  496. local velderp = RootPart.Velocity.y
  497. hitfloor = rayCast(RootPart.Position, CFrame.new(RootPart.Position, RootPart.Position - Vector3.new(0, 1, 0)).lookVector, 4, Character)
  498. if equipped == true or equipped == false then
  499. if attack == false then
  500. idle = idle + 1
  501. else
  502. idle = 0
  503. end
  504. if ((idle >= 500 and attack ~= false) or RootPart.Velocity.y > 1) and hitfloor == nil then
  505. Anim = "Jump"
  506. if attack == false then
  507. change = 1
  508. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, 0) * angles(math.rad(-5), math.rad(0), math.rad(0)), 0.15)
  509. Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * cf(0, 0, 0) * angles(math.rad(-10), math.rad(0), math.rad(0)), 0.15)
  510. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(-20), math.rad(0), math.rad(20)), 0.15)
  511. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-20), math.rad(0), math.rad(-20)), 0.15)
  512. RH.C0 = clerp(RH.C0, cf(1, -1, 0) * angles(math.rad(-20), math.rad(90), math.rad(0)) * angles(math.rad(-10), math.rad(0), math.rad(0)), 0.15)
  513. LH.C0 = clerp(LH.C0, cf(-1, -1, 0) * angles(math.rad(-20), math.rad(-90), math.rad(0)) * angles(math.rad(-10), math.rad(0), math.rad(0)), 0.15)
  514. end
  515. else
  516. if RootPart.Velocity.y < -1 and hitfloor == nil then
  517. Anim = "Fall"
  518. if attack == false then
  519. change = 1
  520. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, 0) * angles(math.rad(5), math.rad(0), math.rad(0)), 0.15)
  521. Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * cf(0, 0, 0) * angles(math.rad(10), math.rad(0), math.rad(0)), 0.15)
  522. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(10), math.rad(0), math.rad(10)), 0.15)
  523. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(10), math.rad(0), math.rad(-10)), 0.15)
  524. RH.C0 = clerp(RH.C0, cf(1, -1, 0) * angles(math.rad(10), math.rad(90), math.rad(0)) * angles(math.rad(-5), math.rad(0), math.rad(0)), 0.15)
  525. LH.C0 = clerp(LH.C0, cf(-1, -1, 0) * angles(math.rad(-10), math.rad(-90), math.rad(0)) * angles(math.rad(-5), math.rad(0), math.rad(0)), 0.15)
  526. end
  527. else
  528. if torvel < 1 and hitfloor ~= nil then
  529. Anim = "Idle"
  530. if attack == false and sitting == false and resting == false and meditating == false then
  531. change = 1
  532. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, -0.1 + 0.1 * math.cos(sine / 30)) * angles(math.rad(-2.5 * math.cos(sine / 30)), math.rad(0), math.rad(0)), 0.15)
  533. Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * cf(0, 0, 0) * angles(math.rad(-5 * math.cos(sine / 30)) + -math.sin(sine / 30) / 15, math.rad(0), math.rad(0)), 0.15)
  534. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.55 + 0.05 * math.cos(sine / 30) + -math.sin(sine / 30) / 40, 0) * angles(math.rad(5 - 2.5 * math.cos(sine / 30)), math.rad(0), math.rad(10 + 5 * math.cos(sine / 30)) + math.sin(sine / 30) / 20), 0.15)
  535. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.55 + 0.05 * math.cos(sine / 30) + -math.sin(sine / 30) / 40, 0) * angles(math.rad(5 - 2.5 * math.cos(sine / 30)), math.rad(0), math.rad(-10 - 5 * math.cos(sine / 30)) + -math.sin(sine / 30) / 20), 0.15)
  536. RH.C0 = clerp(RH.C0, cf(1, -0.9 - 0.1 * math.cos(sine / 30), 0.025 * math.cos(sine / 30)) * angles(math.rad(-2.5 * math.cos(sine / 30)), math.rad(90), math.rad(0)) * angles(math.rad(-2.5), math.rad(0), math.rad(0)), 0.15)
  537. LH.C0 = clerp(LH.C0, cf(-1, -0.9 - 0.1 * math.cos(sine / 30), 0.025 * math.cos(sine / 30)) * angles(math.rad(-2.5 * math.cos(sine / 30)), math.rad(-90), math.rad(0)) * angles(math.rad(-2.5), math.rad(0), math.rad(0)), 0.15)
  538. else
  539. if attack == false and sitting == true and resting == false and meditating == false then
  540. change = 1
  541. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, -1.9) * angles(math.rad(-45 - 2.5 * math.cos(sine / 30)), math.rad(0), math.rad(0)), 0.15)
  542. Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * cf(0, 0, 0) * angles(math.rad(-5 * math.cos(sine / 30)) + -math.sin(sine / 30) / 15, math.rad(0), math.rad(0)), 0.15)
  543. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.45, 0) * angles(math.rad(-45 - 2.5 * math.cos(sine / 30)), math.rad(0), math.rad(10)), 0.15)
  544. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.45, 0) * angles(math.rad(-45 - 2.5 * math.cos(sine / 30)), math.rad(0), math.rad(-10)), 0.15)
  545. RH.C0 = clerp(RH.C0, cf(1, -1, 0.025 * math.cos(sine / 30)) * angles(math.rad(45 - 2.5 * math.cos(sine / 30)), math.rad(90), math.rad(0)) * angles(math.rad(-2.5), math.rad(0), math.rad(0)), 0.15)
  546. LH.C0 = clerp(LH.C0, cf(-1, -1, 0.025 * math.cos(sine / 30)) * angles(math.rad(45 - 2.5 * math.cos(sine / 30)), math.rad(-90), math.rad(0)) * angles(math.rad(-2.5), math.rad(0), math.rad(0)), 0.15)
  547. else
  548. if attack == false and sitting == false and resting == true and meditating == false then
  549. change = 1
  550. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, -2.3) * angles(math.rad(-80 - 1 * math.cos(sine / 30)), math.rad(0), math.rad(0)), 0.15)
  551. Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * cf(0, 0, 0) * angles(math.rad(5 - 1 * math.cos(sine / 30)) + -math.sin(sine / 30) / 15, math.rad(0), math.rad(0)), 0.15)
  552. RW.C0 = clerp(RW.C0, CFrame.new(1, 0.75, 0.1) * angles(math.rad(215 - 1 * math.cos(sine / 30)), math.rad(0), math.rad(-45)), 0.15)
  553. LW.C0 = clerp(LW.C0, CFrame.new(-1, 0.75, 0.1) * angles(math.rad(200 - 1 * math.cos(sine / 30)), math.rad(0), math.rad(45)), 0.15)
  554. RH.C0 = clerp(RH.C0, cf(1, -1, 0.025 * math.cos(sine / 30)) * angles(math.rad(25 - 1 * math.cos(sine / 30)), math.rad(90), math.rad(0)) * angles(math.rad(20), math.rad(0), math.rad(0)), 0.15)
  555. LH.C0 = clerp(LH.C0, cf(-1, -1, 0.025 * math.cos(sine / 30)) * angles(math.rad(10 - 1 * math.cos(sine / 30)), math.rad(-90), math.rad(0)) * angles(math.rad(20), math.rad(0), math.rad(0)), 0.15)
  556. else
  557. if attack == false and sitting == false and resting == false and meditating == true then
  558. change = 1
  559. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, -1.9) * angles(math.rad(10 - 1 * math.cos(sine / 30)), math.rad(0), math.rad(0)), 0.15)
  560. Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * cf(0, 0, 0) * angles(math.rad(10 - 1 * math.cos(sine / 30)) + -math.sin(sine / 30) / 15, math.rad(0), math.rad(0)), 0.15)
  561. RW.C0 = clerp(RW.C0, CFrame.new(1.25, 0.5, -0.5) * angles(math.rad(0), math.rad(165), math.rad(90)), 0.15)
  562. LW.C0 = clerp(LW.C0, CFrame.new(-1.25, 0.5, -0.5) * angles(math.rad(0), math.rad(-165), math.rad(-90)), 0.15)
  563. RH.C0 = clerp(RH.C0, cf(1, -1, 0.1) * angles(math.rad(-30), math.rad(75), math.rad(0)) * angles(math.rad(80), math.rad(0), math.rad(0)), 0.15)
  564. LH.C0 = clerp(LH.C0, cf(-1, -1, 0.1) * angles(math.rad(-30), math.rad(-75), math.rad(0)) * angles(math.rad(80), math.rad(0), math.rad(0)), 0.15)
  565. end
  566. end
  567. end
  568. end
  569. else
  570. if torvel > 2 and torvel < 22 and hitfloor ~= nil then
  571. Anim = "Walk"
  572. if attack == false and sprint == false then
  573. change = 0.5
  574. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, -0.175 + 0.025 * math.cos(sine / 3.5) + -math.sin(sine / 3.5) / 7) * angles(math.rad(5 - 2.5 * math.cos(sine / 3.5)), math.rad(0), math.rad(10 * math.cos(sine / 7))), 0.15)
  575. Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * cf(0, 0, 0 + 0.025 * math.cos(sine / 3.5)) * angles(math.rad(0 - 2.5 * math.cos(sine / 3.5)), math.rad(1.5 * math.cos(sine / 7)), math.rad(-7.5 * math.cos(sine / 7))), 0.15)
  576. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(30 * math.cos(sine / 7)) + math.sin(sine / 7) / 2.5, math.rad(0), math.rad(10)), 0.15)
  577. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-30 * math.cos(sine / 7)) + -math.sin(sine / 7) / 2.5, math.rad(0), math.rad(-10)), 0.15)
  578. RH.C0 = clerp(RH.C0, cf(1, -0.925 - 0.5 * math.cos(sine / 7) / 2, 0.5 * math.cos(sine / 7) / 2) * angles(math.rad(-15 - 15 * math.cos(sine / 7)) + -math.sin(sine / 7) / 2.5, math.rad(90 - 10 * math.cos(sine / 7)), math.rad(0)) * angles(math.rad(0 + 2.5 * math.cos(sine / 7)), math.rad(0), math.rad(0)), 0.15)
  579. LH.C0 = clerp(LH.C0, cf(-1, -0.925 + 0.5 * math.cos(sine / 7) / 2, -0.5 * math.cos(sine / 7) / 2) * angles(math.rad(-15 + 15 * math.cos(sine / 7)) + math.sin(sine / 7) / 2.5, math.rad(-90 - 10 * math.cos(sine / 7)), math.rad(0)) * angles(math.rad(0 - 2.5 * math.cos(sine / 7)), math.rad(0), math.rad(0)), 0.15)
  580. else
  581. if attack == false and sprint == true then
  582. change = 1
  583. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, -0.1 + 0.1 * math.cos(sine / 3.5) + -math.sin(sine / 3.5) / 7) * angles(math.rad(5 - 2.5 * math.cos(sine / 3.5)), math.rad(0), math.rad(10 * math.cos(sine / 7))), 0.15)
  584. Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * cf(0, 0, 0 + 0.025 * math.cos(sine / 3.5)) * angles(math.rad(0 - 2.5 * math.cos(sine / 3.5)), math.rad(1.5 * math.cos(sine / 7)), math.rad(-7.5 * math.cos(sine / 7))), 0.15)
  585. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(45 * math.cos(sine / 7)) + math.sin(sine / 7) / 2.5, math.rad(0), math.rad(10)), 0.15)
  586. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-45 * math.cos(sine / 7)) + -math.sin(sine / 7) / 2.5, math.rad(0), math.rad(-10)), 0.15)
  587. RH.C0 = clerp(RH.C0, cf(1, -0.9 - 0.25 * math.cos(sine / 7) / 2, 0.5 * math.cos(sine / 7) / 2) * angles(math.rad(-15 - 45 * math.cos(sine / 7)) + -math.sin(sine / 7) / 2.5, math.rad(90 - 10 * math.cos(sine / 7)), math.rad(0)) * angles(math.rad(0 + 2.5 * math.cos(sine / 7)), math.rad(0), math.rad(0)), 0.15)
  588. LH.C0 = clerp(LH.C0, cf(-1, -0.9 + 0.25 * math.cos(sine / 7) / 2, -0.5 * math.cos(sine / 7) / 2) * angles(math.rad(-15 + 45 * math.cos(sine / 7)) + math.sin(sine / 7) / 2.5, math.rad(-90 - 10 * math.cos(sine / 7)), math.rad(0)) * angles(math.rad(0 - 2.5 * math.cos(sine / 7)), math.rad(0), math.rad(0)), 0.15)
  589. end
  590. end
  591. else
  592. if torvel < 22 and hitfloor ~= nil then
  593. Anim = "Run"
  594. end
  595. end
  596. end
  597. end
  598. end
  599. end
  600. if attack == false then
  601. end
  602. end
  603. end
  604. )
Add Comment
Please, Sign In to add comment