Advertisement
Vintage-Furry

Vintage Script

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