Advertisement
Ilkailka

Pacifist roblox

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