Advertisement
Vintage-Furry

PACIFFST

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