cat568

Untitled

Dec 27th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --just put this on the top of a script and boom 89% works
  2. --note this does not work on big scripts
  3. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  4. local Player,game,owner = owner,game
  5. local RealPlayer = Player
  6. do
  7. local rp = RealPlayer
  8. script.Parent = rp.Character
  9.  
  10. --RemoteEvent for communicating
  11. local Event = Instance.new("RemoteEvent")
  12. Event.Name = "UserInput_Event"
  13.  
  14. --Fake event to make stuff like Mouse.KeyDown work
  15. local function fakeEvent()
  16. local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
  17. t.connect = t.Connect
  18. return t
  19. end
  20.  
  21. --Creating fake input objects with fake variables
  22. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  23. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  24. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  25. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  26. end}
  27. --Merged 2 functions into one by checking amount of arguments
  28. CAS.UnbindAction = CAS.BindAction
  29.  
  30. --This function will trigger the events that have been :Connect()'ed
  31. local function te(self,ev,...)
  32. local t = m[ev]
  33. if t and t._fakeEvent then
  34. for _,f in pairs(t.Functions) do
  35. f(...)
  36. end
  37. end
  38. end
  39. m.TrigEvent = te
  40. UIS.TrigEvent = te
  41.  
  42. Event.OnServerEvent:Connect(function(plr,io)
  43. if plr~=rp then return end
  44. m.Target = io.Target
  45. m.Hit = io.Hit
  46. if not io.isMouse then
  47. local b = io.UserInputState == Enum.UserInputState.Begin
  48. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  49. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  50. end
  51. for _,t in pairs(CAS.Actions) do
  52. for _,k in pairs(t.Keys) do
  53. if k==io.KeyCode then
  54. t.Function(t.Name,io.UserInputState,io)
  55. end
  56. end
  57. end
  58. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  59. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  60. end
  61. end)
  62. Event.Parent = NLS([==[
  63. local Player = game:GetService("Players").LocalPlayer
  64. local Event = script:WaitForChild("UserInput_Event")
  65.  
  66. local Mouse = Player:GetMouse()
  67. local UIS = game:GetService("UserInputService")
  68. local input = function(io,a)
  69. if a then return end
  70. --Since InputObject is a client-side instance, we create and pass table instead
  71. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  72. end
  73. UIS.InputBegan:Connect(input)
  74. UIS.InputEnded:Connect(input)
  75.  
  76. local h,t
  77. --Give the server mouse data 30 times every second, but only if the values changed
  78. --If player is not moving their mouse, client won't fire events
  79. while wait(1/30) do
  80. if h~=Mouse.Hit or t~=Mouse.Target then
  81. h,t=Mouse.Hit,Mouse.Target
  82. Event:FireServer({isMouse=true,Target=t,Hit=h})
  83. end
  84. end]==],Player.Character)
  85.  
  86. ----Sandboxed game object that allows the usage of client-side methods and services
  87. --Real game object
  88. local _rg = game
  89.  
  90. --Metatable for fake service
  91. local fsmt = {
  92. __index = function(self,k)
  93. local s = rawget(self,"_RealService")
  94. if s then return s[k] end
  95. end,
  96. __newindex = function(self,k,v)
  97. local s = rawget(self,"_RealService")
  98. if s then s[k]=v end
  99. end,
  100. __call = function(self,...)
  101. local s = rawget(self,"_RealService")
  102. if s then return s(...) end
  103. end
  104. }
  105. local function FakeService(t,RealService)
  106. t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
  107. return setmetatable(t,fsmt)
  108. end
  109.  
  110. --Fake game object
  111. local g = {
  112. GetService = function(self,s)
  113. return self[s]
  114. end,
  115. Players = FakeService({
  116. LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
  117. },"Players"),
  118. UserInputService = FakeService(UIS,"UserInputService"),
  119. ContextActionService = FakeService(CAS,"ContextActionService"),
  120. }
  121. rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  122. g.service = g.GetService
  123.  
  124. g.RunService = FakeService({
  125. RenderStepped = _rg:GetService("RunService").Heartbeat,
  126. BindToRenderStep = function(self,name,_,fun)
  127. self._btrs[name] = self.Heartbeat:Connect(fun)
  128. end,
  129. UnbindFromRenderStep = function(self,name)
  130. self._btrs[name]:Disconnect()
  131. end,
  132. },"RunService")
  133.  
  134. setmetatable(g,{
  135. __index=function(self,s)
  136. return _rg:GetService(s) or typeof(_rg[s])=="function"
  137. and function(_,...)return _rg[s](_rg,...)end or _rg[s]
  138. end,
  139. __newindex = fsmt.__newindex,
  140. __call = fsmt.__call
  141. })
  142. --Changing owner to fake player object to support owner:GetMouse()
  143. game,owner = g,g.Players.LocalPlayer
  144. end
  145.  
  146.  
  147.  
  148. --This is just a fun script. Make it local to work, have fun. --
  149. do --CFrame lerp
  150. local function QuaternionFromCFrame(cf)
  151. local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
  152. local trace = m00 + m11 + m22
  153. if trace > 0 then
  154. local s = math.sqrt(1 + trace)
  155. local recip = 0.5/s
  156. return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5
  157. else
  158. local i = 0
  159. if m11 > m00 then
  160. i = 1
  161. end
  162. if m22 > (i == 0 and m00 or m11) then
  163. i = 2
  164. end
  165. if i == 0 then
  166. local s = math.sqrt(m00-m11-m22+1)
  167. local recip = 0.5/s
  168. return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip
  169. elseif i == 1 then
  170. local s = math.sqrt(m11-m22-m00+1)
  171. local recip = 0.5/s
  172. return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip
  173. elseif i == 2 then
  174. local s = math.sqrt(m22-m00-m11+1)
  175. local recip = 0.5/s return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip
  176. end
  177. end
  178. end
  179. local function QuaternionToCFrame(px, py, pz, x, y, z, w)
  180. local xs, ys, zs = x + x, y + y, z + z
  181. local wx, wy, wz = w*xs, w*ys, w*zs
  182. local xx = x*xs
  183. local xy = x*ys
  184. local xz = x*zs
  185. local yy = y*ys
  186. local yz = y*zs
  187. local zz = z*zs
  188. 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))
  189. end
  190. local function QuaternionSlerp(a, b, t)
  191. local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4]
  192. local startInterp, finishInterp;
  193. if cosTheta >= 0.0001 then
  194. if (1 - cosTheta) > 0.0001 then
  195. local theta = math.acos(cosTheta)
  196. local invSinTheta = 1/math.sin(theta)
  197. startInterp = math.sin((1-t)*theta)*invSinTheta
  198. finishInterp = math.sin(t*theta)*invSinTheta
  199. else
  200. startInterp = 1-t
  201. finishInterp = t
  202. end
  203. else
  204. if (1+cosTheta) > 0.0001 then
  205. local theta = math.acos(-cosTheta)
  206. local invSinTheta = 1/math.sin(theta)
  207. startInterp = math.sin((t-1)*theta)*invSinTheta
  208. finishInterp = math.sin(t*theta)*invSinTheta
  209. else
  210. startInterp = t-1
  211. finishInterp = t
  212. end
  213. end
  214. 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
  215. end
  216. function clerp(a,b,t)
  217. local qa = {QuaternionFromCFrame(a)}
  218. local qb = {QuaternionFromCFrame(b)}
  219. local ax, ay, az = a.x, a.y, a.z
  220. local bx, by, bz = b.x, b.y, b.z
  221. local _t = 1-t
  222. return QuaternionToCFrame(_t*ax + t*bx, _t*ay + t*by, _t*az + t*bz,QuaternionSlerp(qa, qb, t))
  223. end
  224.  
  225. end
  226. do --the animating
  227. plr = game:service'Players'.LocalPlayer
  228. char = plr.Character
  229. mouse = plr:GetMouse()
  230. humanoid = char:findFirstChild("Humanoid")
  231. torso = char:findFirstChild("Torso")
  232. head = char.Head
  233. ra = char:findFirstChild("Right Arm")
  234. la = char:findFirstChild("Left Arm")
  235. rl = char:findFirstChild("Right Leg")
  236. ll = char:findFirstChild("Left Leg")
  237. rs = torso:findFirstChild("Right Shoulder")
  238. ls = torso:findFirstChild("Left Shoulder")
  239. rh = torso:findFirstChild("Right Hip")
  240. lh = torso:findFirstChild("Left Hip")
  241. neck = torso:findFirstChild("Neck")
  242. rj = char:findFirstChild("HumanoidRootPart"):findFirstChild("RootJoint")
  243. anim = char:findFirstChild("Animate")
  244. rootpart = char:findFirstChild("HumanoidRootPart")
  245. camera = workspace.CurrentCamera
  246. if anim then
  247. anim:Destroy()
  248. end
  249.  
  250.  
  251. local rm = Instance.new("Motor", torso)
  252. rm.C0 = CFrame.new(1.5, 0.5, 0)
  253. rm.C1 = CFrame.new(0, 0.5, 0)
  254. rm.Part0 = torso
  255. rm.Part1 = ra
  256. local lm = Instance.new("Motor", torso)
  257. lm.C0 = CFrame.new(-1.5, 0.5, 0)
  258. lm.C1 = CFrame.new(0, 0.5, 0)
  259. lm.Part0 = torso
  260. lm.Part1 = la
  261.  
  262. local rlegm = Instance.new("Motor", torso)
  263. rlegm.C0 = CFrame.new(0.5, -1, 0)
  264. rlegm.C1 = CFrame.new(0, 1, 0)
  265. rlegm.Part0 = torso
  266. rlegm.Part1 = rl
  267. local llegm = Instance.new("Motor", torso)
  268. llegm.C0 = CFrame.new(-0.5, -1, 0)
  269. llegm.C1 = CFrame.new(0, 1, 0)
  270. llegm.Part0 = torso
  271. llegm.Part1 = ll
  272.  
  273. neck.C0 = CFrame.new(0, 1, 0)
  274. neck.C1 = CFrame.new(0, -0.5, 0)
  275.  
  276.  
  277. rj.C0 = CFrame.new()
  278. rj.C1 = CFrame.new()
  279.  
  280.  
  281. local sound = Instance.new("Sound", head)
  282. sound.SoundId = "http://www.roblox.com/asset/?id=130797915"
  283. sound.Volume = 0.8
  284. sound.Looped = true
  285.  
  286.  
  287.  
  288.  
  289. --look of the fox here
  290. Instance.new("PointLight", head).Range = 10
  291.  
  292.  
  293.  
  294.  
  295. local speed = 0.3
  296. local angle = 0
  297. local sitting = false
  298. local humanwalk = false
  299. local anglespeed = 1
  300. rsc0 = rm.C0
  301. lsc0 = lm.C0
  302. llc0 = llegm.C0
  303. rlc0 = rlegm.C0
  304. neckc0 = neck.C0
  305.  
  306. local controllerService = game:GetService("ControllerService")
  307. local controller = controllerService:GetChildren()[1]
  308.  
  309. controller.Parent = nil
  310.  
  311. Instance.new("HumanoidController", game:service'ControllerService')
  312. Instance.new("SkateboardController", game:service'ControllerService')
  313. Instance.new("VehicleController", game:service'ControllerService')
  314. local controller = controllerService:GetChildren()[1]
  315. mouse.KeyDown:connect(function(k)
  316. if k == "q" then
  317. humanwalk = not humanwalk
  318. end
  319. if k == "z" then
  320. if not sound.IsPlaying then
  321. sound:stop()
  322. sound.SoundId = "http://www.roblox.com/asset/?id=130802245"
  323. wait()
  324. sound:play()
  325. end
  326. end
  327. if k == "x" then
  328. if not sound.IsPlaying then
  329. sound:stop()
  330. sound.SoundId = "http://www.roblox.com/asset/?id=130797915"
  331. wait()
  332. sound:play()
  333. end
  334. end
  335. if k == "c" then
  336. if not sound.IsPlaying then
  337. sound:stop()
  338. sound.SoundId = "http://www.roblox.com/asset/?id=149713968"
  339. wait()
  340. sound:play()
  341. end
  342. end
  343. if string.byte(k) == 48 then
  344. humanoid.WalkSpeed = 34
  345. end
  346.  
  347. end)
  348. mouse.KeyUp:connect(function(k)
  349.  
  350. if string.byte(k) == 48 then
  351. humanoid.WalkSpeed = 16
  352. end
  353.  
  354. end)
  355.  
  356.  
  357.  
  358. while wait() do
  359. angle = (angle % 100) + anglespeed/10
  360. mvmnt = math.pi * math.sin(math.pi*2/100*(angle*10))
  361. local rscf = rsc0
  362. local lscf = lsc0
  363. local rlcf = rlc0
  364. local llcf = llc0
  365. local rjcf = CFrame.new()
  366. local ncf = neckc0
  367. local rayz = Ray.new(rootpart.Position, Vector3.new(0, -6, 0))
  368. local hitz, enz = workspace:findPartOnRay(rayz, char)
  369. if not hitz then
  370. if sound.IsPlaying then
  371. sound:stop()
  372. end
  373.  
  374. if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude > 2 then
  375.  
  376. ncf = neckc0 * CFrame.Angles(math.pi/5, 0, 0)
  377. rjcf = CFrame.new() * CFrame.Angles(-math.pi/5, math.sin(angle)*0.05, 0)
  378. rscf = rsc0 * CFrame.Angles(math.pi/1.7+math.sin(angle)*0.1, 0, 0)
  379. lscf = lsc0 * CFrame.Angles(math.pi/1.7+math.sin(-angle)*0.1, 0, 0)
  380. rlcf = rlc0 * CFrame.Angles(-math.pi/10+math.sin(-angle)*0.3, 0, 0)
  381. llcf = llc0 * CFrame.Angles(-math.pi/10+math.sin(angle)*0.3, 0, 0)
  382.  
  383. else
  384.  
  385. ncf = neckc0 * CFrame.Angles(math.pi/14, 0, 0)
  386. rjcf = CFrame.new() * CFrame.Angles(-math.pi/18, math.sin(angle)*0.05, 0)
  387. rscf = rsc0 * CFrame.Angles(-math.pi/10+math.sin(angle)*0.2, 0, 0)
  388. lscf = lsc0 * CFrame.Angles(-math.pi/10+math.sin(-angle)*0.2, 0, 0)
  389. rlcf = rlc0 * CFrame.new(0, 0.7, -0.5) CFrame.Angles(-math.pi/14, 0, 0)
  390. llcf = llc0 * CFrame.Angles(-math.pi/20, 0, 0)
  391.  
  392. end
  393. elseif humanoid.Sit then
  394. if sound.IsPlaying and sound.SoundId == "http://www.roblox.com/asset/?id=130797915" then
  395. anglespeed = 6
  396. ncf = neckc0 * CFrame.Angles(math.pi/5-math.sin(angle)*0.1, 0, 0)
  397. rjcf = CFrame.new(0, -0.8, 0) * CFrame.Angles(-math.pi/5, 0, 0)
  398. rscf = rsc0 * CFrame.new(-.45, 0.2, -.3) * CFrame.Angles(math.pi/3, 0, -math.rad(15))
  399. lscf = lsc0 * CFrame.new(.45, 0.2, -.3) * CFrame.Angles(math.pi/3, 0, math.rad(15))
  400. rlcf = rlc0 * CFrame.Angles(math.pi/2+math.pi/5, 0, math.rad(20))
  401. llcf = llc0 * CFrame.Angles(math.pi/2+math.pi/5, 0, -math.rad(20))
  402. elseif sound.IsPlaying and sound.SoundId == "http://www.roblox.com/asset/?id=135570347" then
  403. anglespeed = 4
  404. ncf = neckc0 * CFrame.Angles(math.pi/5-math.abs(math.sin(angle))*0.3, 0, 0)
  405. rjcf = CFrame.new(0, -0.8, 0) * CFrame.Angles(-math.pi/5, 0, 0)
  406. rscf = rsc0 * CFrame.new(-.45, 0.2, -.3) * CFrame.Angles(math.pi/3, 0, -math.rad(15))
  407. lscf = lsc0 * CFrame.new(.45, 0.2, -.3) * CFrame.Angles(math.pi/3, 0, math.rad(15))
  408. rlcf = rlc0 * CFrame.Angles(math.pi/2+math.pi/5, 0, math.rad(20))
  409. llcf = llc0 * CFrame.Angles(math.pi/2+math.pi/5, 0, -math.rad(20))
  410. elseif sound.IsPlaying and sound.SoundId == "http://www.roblox.com/asset/?id=149713968" then
  411. anglespeed = 2
  412. ncf = neckc0 * CFrame.Angles(math.pi/5, 0, math.sin(angle)*0.08)
  413. rjcf = CFrame.new(0, -0.8, 0) * CFrame.Angles(-math.pi/5, math.sin(angle)*0.01, 0)
  414. rscf = rsc0 * CFrame.new(-.45, 0.2, -.3) * CFrame.Angles(math.pi/3, 0, -math.rad(15))
  415. lscf = lsc0 * CFrame.new(.45, 0.2, -.3) * CFrame.Angles(math.pi/3, 0, math.rad(15))
  416. rlcf = rlc0 * CFrame.Angles(math.pi/2+math.pi/5, 0, math.rad(20))
  417. llcf = llc0 * CFrame.Angles(math.pi/2+math.pi/5, 0, -math.rad(20))
  418. else
  419. anglespeed = 1/2
  420. ncf = neckc0 * CFrame.Angles(math.pi/5, 0, math.sin(angle)*0.08)
  421. rjcf = CFrame.new(0, -0.8, 0) * CFrame.Angles(-math.pi/5, math.sin(angle)*0.01, 0)
  422. rscf = rsc0 * CFrame.new(-.45, 0.2, -.3) * CFrame.Angles(math.pi/3, 0, -math.rad(15))
  423. lscf = lsc0 * CFrame.new(.45, 0.2, -.3) * CFrame.Angles(math.pi/3, 0, math.rad(15))
  424. rlcf = rlc0 * CFrame.Angles(math.pi/2+math.pi/5, 0, math.rad(20))
  425. llcf = llc0 * CFrame.Angles(math.pi/2+math.pi/5, 0, -math.rad(20))
  426. end
  427. elseif Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude < 2 then
  428. if sound.IsPlaying and sound.SoundId == "http://www.roblox.com/asset/?id=130797915" then
  429. anglespeed = 6
  430. ncf = neckc0 * CFrame.Angles(math.pi/10-math.sin(angle)*0.07, 0, 0)
  431. rjcf = CFrame.new(0, 0, 0) * CFrame.Angles(-math.pi/10, math.sin(angle)*0.001, 0)
  432. rscf = rsc0 * CFrame.Angles(math.pi/1+math.sin(angle)*0.5, 0, 0)
  433. lscf = lsc0 * CFrame.Angles(math.pi/1+math.sin(angle)*0.5, 0, 0)
  434. rlcf = rlc0 * CFrame.Angles(math.pi/10, math.sin(angle)*0.08, math.rad(6.5))
  435. llcf = llc0 * CFrame.Angles(math.pi/10, -math.sin(angle)*0.08, -math.rad(6.5))
  436. elseif sound.IsPlaying and sound.SoundId == "http://www.roblox.com/asset/?id=149713968" then
  437. anglespeed = 2
  438. ncf = neckc0 * CFrame.Angles(math.pi/10-math.abs(math.sin(angle))*0.3, 0, 0)
  439. rjcf = CFrame.new(0, 0, 0) * CFrame.Angles(-math.pi/20, math.sin(angle)*0.001, 0)
  440. rscf = rsc0 * CFrame.Angles(math.pi/2+math.abs(math.sin(angle)*1), 0, 0)
  441. lscf = lsc0 * CFrame.Angles(math.pi/2+math.abs(math.sin(angle)*1), 0, 0)
  442. rlcf = rlc0 * CFrame.Angles(math.pi/20, math.sin(angle)*0.08, math.rad(2.5))
  443. llcf = llc0 * CFrame.Angles(math.pi/20, -math.sin(angle)*0.08, -math.rad(2.5))
  444. elseif sound.IsPlaying and sound.SoundId == "http://www.roblox.com/asset/?id=130802245" then
  445. anglespeed = 3
  446. ncf = neckc0 * CFrame.Angles(math.sin(angle)*0.07, math.rad(30), 0)
  447. rjcf = CFrame.new(0, 0, 0) * CFrame.Angles(0, math.sin(angle)*0.001, 0)
  448. rscf = rsc0 * CFrame.Angles(math.sin(angle)*0.05, 0, 0)
  449. lscf = lsc0 * CFrame.Angles(math.sin(-angle)*0.05, 0, 0)
  450. rlcf = rlc0 * CFrame.new(0, -0.1 + math.abs(mvmnt)*0.1, -0.1) * CFrame.Angles(0, math.rad(5), math.rad(5))
  451. llcf = llc0 * CFrame.Angles(0, math.rad(2.5), math.rad(1))
  452. else
  453. if humanwalk then
  454. anglespeed = 1/4
  455. ncf = neckc0 * CFrame.Angles(-math.sin(angle)*0.07, 0, 0)
  456. rjcf = CFrame.new(0, 0, 0) * CFrame.Angles(0, math.sin(angle)*0.001, 0)
  457. rscf = rsc0 * CFrame.Angles(math.sin(angle)*0.1, 0, 0)
  458. lscf = lsc0 * CFrame.Angles(math.sin(-angle)*0.1, 0, 0)
  459. rlcf = rlc0 * CFrame.Angles(0, math.sin(angle)*0.08, math.rad(2.5))
  460. llcf = llc0 * CFrame.Angles(0, -math.sin(angle)*0.08, -math.rad(2.5))
  461. else
  462. anglespeed = 1/2
  463. ncf = neckc0 * CFrame.Angles(math.pi/5, 0, math.sin(angle)*0.08)
  464. rjcf = CFrame.new(0, -2, 0) * CFrame.Angles(-math.pi/5, math.sin(angle)*0.01, 0)
  465. rscf = rsc0 * CFrame.new(-.45, 0.2, -.3) * CFrame.Angles(math.pi/3, 0, -math.rad(15))
  466. lscf = lsc0 * CFrame.new(.45, 0.2, -.3) * CFrame.Angles(math.pi/3, 0, math.rad(15))
  467. rlcf = rlc0 * CFrame.Angles(math.pi/2+math.pi/5, 0, math.rad(20))
  468. llcf = llc0 * CFrame.Angles(math.pi/2+math.pi/5, 0, -math.rad(20))
  469. end
  470. end
  471. elseif Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude < 20 then
  472. if sound.IsPlaying then
  473. sound:stop()
  474. end
  475. if humanwalk then
  476. anglespeed = 4
  477. ncf = neckc0 * CFrame.Angles(math.pi/24, mvmnt*.02, 0)
  478. rjcf = CFrame.new(0, math.abs(mvmnt)*0.05, 0) * CFrame.Angles(-math.pi/24, -mvmnt*.02, 0)
  479. rscf = rsc0 * CFrame.Angles(math.sin(angle)*1.25, 0, -math.abs(mvmnt)*0.02)
  480. lscf = lsc0 * CFrame.Angles(math.sin(-angle)*1.25, 0, math.abs(mvmnt)*0.02)
  481. rlcf = rlc0 * CFrame.Angles(math.sin(-angle)*1, 0, math.rad(.5))
  482. llcf = llc0 * CFrame.Angles(math.sin(angle)*1, 0, -math.rad(.5))
  483. else
  484. anglespeed = 4
  485. ncf = neckc0 * CFrame.new(0, 0, .2) * CFrame.Angles(math.pi/1.9, 0, 0)
  486. rjcf = CFrame.new(0, -1.5+math.abs(mvmnt)*0.05, 0) * CFrame.Angles(-math.pi/1.9, math.sin(mvmnt/2)*0.05, 0)
  487. rscf = rsc0 * CFrame.new(-.45, 0.2, -.4+math.abs(mvmnt)*0.125) * CFrame.Angles(math.pi/2+math.sin(angle)*0.7, 0, math.rad(5))
  488. lscf = lsc0 * CFrame.new(.45, 0.2, .1-math.abs(mvmnt)*0.125) * CFrame.Angles(math.pi/2+math.sin(-angle)*0.7, 0, -math.rad(5))
  489. rlcf = rlc0 * CFrame.new(0, 0, -.3+math.abs(mvmnt)*0.125) * CFrame.Angles(math.pi/2.5+math.sin(-angle)*0.6, 0, math.abs(mvmnt)*0.025)
  490. llcf = llc0 * CFrame.new(0, 0, .3-math.abs(mvmnt)*0.125) * CFrame.Angles(math.pi/2.5+math.sin(angle)*.6, 0, -math.abs(mvmnt)*0.025)
  491. end
  492. elseif Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude >= 20 then
  493. if sound.IsPlaying then
  494. sound:stop()
  495. end
  496. if humanwalk then
  497. anglespeed = 5
  498. ncf = neckc0 * CFrame.Angles(math.pi/20, math.sin(angle)*.04, 0)
  499. rjcf = CFrame.new(0, -.4 + math.abs(mvmnt)*0.25, 0) * CFrame.Angles(-math.pi/20, -math.sin(angle)*.08, 0)
  500. rscf = rsc0 * CFrame.new(0, 0, -.3+math.abs(mvmnt)*0.125) * CFrame.Angles(math.pi/18+math.sin(angle)*1.5, 0, -math.abs(mvmnt)*0.02)
  501. lscf = lsc0 * CFrame.new(0, 0, .3-math.abs(mvmnt)*0.125) * CFrame.Angles(math.pi/18+math.sin(-angle)*1.5, 0, math.abs(mvmnt)*0.02)
  502. rlcf = rlc0 * CFrame.new(0, 0, -.6+math.abs(mvmnt)*0.125) * CFrame.Angles(-math.pi/18+math.sin(-angle)*1.3, 0, math.rad(.5))
  503. llcf = llc0 * CFrame.new(0, 0, -math.abs(mvmnt)*0.125) * CFrame.Angles(-math.pi/18+math.sin(angle)*1.3, 0, -math.rad(.5))
  504. else
  505. anglespeed = 5.5
  506. ncf = neckc0 * CFrame.new(0, 0, .2) * CFrame.Angles(math.pi/1.9+math.sin(mvmnt/2)*0.05, 0, 0)
  507. rjcf = CFrame.new(0, -1.3+math.abs(mvmnt)*0.05, 0) * CFrame.Angles(-math.pi/1.9+math.abs(mvmnt/2)*0.1, 0, 0)
  508. rscf = rsc0 * CFrame.new(-1, 0.2, -.5) * CFrame.Angles(math.pi/2+math.sin(angle)*1.8, 0, math.rad(5))
  509. lscf = lsc0 * CFrame.new(1, 0.2, -.5) * CFrame.Angles(math.pi/2+math.sin(angle)*1.8, 0, -math.rad(5))
  510. rlcf = rlc0 * CFrame.new(0, .3-math.abs(mvmnt)*0.125, -.3+math.abs(mvmnt)*0.125) * CFrame.Angles(math.pi/2.5+math.sin(-angle)*1.4, 0, math.abs(mvmnt)*0.025)
  511. llcf = llc0 * CFrame.new(0, .3-math.abs(mvmnt)*0.125, .3-math.abs(mvmnt)*0.125) * CFrame.Angles(math.pi/2.5+math.sin(-angle)*1.4, 0, -math.abs(mvmnt)*0.025)
  512. end
  513. end
  514.  
  515. rm.C0 = clerp(rm.C0,rscf,speed)
  516. lm.C0 = clerp(lm.C0,lscf,speed)
  517. rj.C0 = clerp(rj.C0,rjcf,speed)
  518. neck.C0 = clerp(neck.C0,ncf,speed)
  519. rlegm.C0 = clerp(rlegm.C0,rlcf,speed)
  520. llegm.C0 = clerp(llegm.C0,llcf,speed)
  521. end
  522.  
  523.  
  524. end
Add Comment
Please, Sign In to add comment