Advertisement
memberhero

something idk

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