Advertisement
Dark_EccentricYT

Untitled

Sep 26th, 2017
499
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.75 KB | None | 0 0
  1.  
  2. local plr = game.Players.LocalPlayer
  3. local char = plr.Character
  4. local mouse = plr:GetMouse()
  5. local torso = char.Torso
  6. local rs = torso["Right Shoulder"]
  7. local ls = torso["Left Shoulder"]
  8. local rh = torso["Right Hip"]
  9. local lh = torso["Left Hip"]
  10. local rj = char.HumanoidRootPart.RootJoint
  11. local neck = torso.Neck
  12. local animpose = "Idle"
  13. local attacking = false
  14. local cananim = true
  15. local rage = false
  16. local shield = nil
  17. local sprint = false
  18. local canrage = true
  19. local legs = false
  20. local recording = false
  21. local animatepls = false
  22. local timetravel = false
  23. local mode = "Neutral"
  24. local outlines = {}
  25. local bc = char:WaitForChild("Body Colors")
  26. local multiplier = 0
  27. local lac = char["Body Colors"].LeftArmColor
  28. local rac = char["Body Colors"].RightArmColor
  29. local rlc = char["Body Colors"].RightArmColor
  30. local llc = char["Body Colors"].LeftLegColor
  31. local hc = char["Body Colors"].HeadColor
  32. local tc = char["Body Colors"].TorsoColor
  33. local humanoid = char:FindFirstChildOfClass("Humanoid")
  34. local huge = Vector3.new(math.huge,math.huge,math.huge)
  35. local model = Instance.new("Model", char)
  36. model.Name = "thingy"
  37.  
  38. function legsonly()
  39. spawn(function()
  40. for i = 0, 10 do
  41. wait(0.001)
  42. if attacking then break end
  43. end
  44. if not attacking then
  45. legs = false
  46. end
  47. end)
  48. end
  49. function smooth(obj)
  50. for i,v in pairs({"Right", "Left", "Top", "Bottom", "Front", "Back"}) do
  51. obj[v.."Surface"] = "SmoothNoOutlines"
  52. end
  53. end
  54. function swait(t)
  55. if t == nil or t == 0 then
  56. game:service('RunService').Stepped:wait(0)
  57. else
  58. for i = 0, t do
  59. game:service('RunService').Stepped:wait(0)
  60. end
  61. end
  62. end
  63. function hurt(hit, dmg)
  64. if hit.Parent then
  65. if hit.Parent.Name == "thingy" then print("urmum") hit.Parent:Destroy() end
  66. local hum = hit.Parent:FindFirstChildOfClass("Humanoid")
  67. if hum then
  68. if hum.Parent.Name ~= plr.Name then
  69. if dmg == "Kill" or hum.Health > 100000 then
  70. hit.Parent:BreakJoints()
  71. return true
  72. else
  73. if math.random(0, 100) == 50 then
  74. hum.Health = hum.Health - dmg*multiplier*2.5
  75. else
  76. hum.Health = hum.Health -dmg*multiplier
  77. end
  78. return true
  79. end
  80. end
  81. end
  82. end
  83. end
  84. function soundeffect(id, volume, speed, parent, forcewait)
  85. if not forcewait then
  86. spawn(function()
  87. local s = Instance.new("Sound")
  88. s.SoundId = id
  89. s.Volume = volume
  90. s.PlaybackSpeed = speed
  91. s.Parent = parent
  92. s:Play()
  93. repeat wait() until not s.Playing
  94. s:Destroy()
  95. end)
  96. else
  97. local s = Instance.new("Sound")
  98. s.SoundId = id
  99. s.Volume = volume
  100. s.PlaybackSpeed = speed
  101. s.Parent = parent
  102. s:Play()
  103. repeat wait() until not s.Playing
  104. s:Destroy()
  105. end
  106. end
  107. function gethum(obj)
  108. if obj.Parent then
  109. if obj.Parent:FindFirstChild("Humanoid") then
  110. if obj.Parent.Name ~= plr.Name then
  111. return obj.Parent:FindFirstChildOfClass("Humanoid")
  112. end
  113. end
  114. end
  115. end
  116. function fade(obj, dest, grow)
  117. spawn(function()
  118. local oldcf = obj.CFrame
  119. for i = 0, 10 do
  120. if grow then
  121. obj.Size = obj.Size +Vector3.new(1,1,1)
  122. obj.CFrame = oldcf
  123. end
  124. obj.Transparency = obj.Transparency +0.1
  125. swait()
  126. end
  127. if dest then
  128. obj:Destroy()
  129. end
  130. end)
  131. end
  132.  
  133.  
  134. function animate()
  135. a = function(b)
  136. for i,v in pairs(b:children()) do
  137. if v:IsA("BasePart") and v.Name ~= "HumanoidRootPart" then
  138. if v.Anchored == false then
  139. local val = Instance.new("StringValue", v)
  140. val.Name = "Anchoredz"
  141. v.Anchored = true
  142. end
  143. end
  144. a(v)
  145. end
  146. end
  147. a(workspace)
  148. end
  149. function unanimate()
  150. a = function(b)
  151. for i,v in pairs(b:children()) do
  152. if v:IsA("BasePart") then
  153. if v:FindFirstChild("Anchoredz") then
  154. v.Anchoredz:Destroy()
  155. v.Anchored = false
  156. end
  157. end
  158. a(v)
  159. end
  160. end
  161. a(workspace)
  162. end
  163. local data = {
  164. ["Objects"] = {
  165.  
  166. }
  167. }
  168. local freeze = false
  169. local frames = 0
  170. local objects = 0
  171. local cons4freeze = {}
  172. mouse.KeyDown:connect(function(key)
  173. if key == "e" and not timetravel and not freeze then
  174. timetravel = true
  175. local currentframe = frames+1
  176. animate(true)
  177. spawn(function()
  178. local num = 2
  179. repeat
  180. num = num - 0.1
  181. soundeffect("rbxassetid://1", 3, num, char, true)
  182. until not timetravel
  183. end)
  184. for i,v in pairs(cons4freeze) do
  185. if v then
  186. v:disconnect()
  187. v = nil
  188. end
  189. end
  190. for i = 1, frames do
  191. currentframe = currentframe - 1
  192. local currentobj = 0
  193. for i = 1, objects do
  194. currentobj = currentobj + 1
  195. obj = data["Objects"]["obj"..currentobj]
  196. if obj["Object"] then
  197. if obj["Frame"..currentframe] then
  198. obj["Object"].CFrame = obj["Frame"..currentframe]["CFrame"]
  199. end
  200. end
  201. end
  202. wait()
  203. end
  204. unanimate()
  205. timetravel = false
  206. objects = 0
  207. frames = 0
  208. data = {
  209. ["Objects"] = {
  210.  
  211. }
  212. }
  213.  
  214. end
  215. end)
  216. mouse.KeyDown:connect(function(key)
  217. if key == "q" and not recording and not timetravel then
  218. recording = true
  219. if not timetravel and recording then
  220. frames = frames+1
  221. local num = 0
  222. a = function(b)
  223. for i,v in pairs(b:children()) do
  224. if v:IsA("BasePart") then
  225. num = num + 1
  226. if not data["Objects"]["obj"..num] then
  227. data["Objects"]["obj"..num] = {
  228. ["Object"] = nil
  229.  
  230. }
  231. data["Objects"]["obj"..num]["Object"] = v
  232. objects = objects + 1
  233. end
  234. data["Objects"]["obj"..num]["Frame"..frames] = {}
  235. data["Objects"]["obj"..num]["Frame"..frames]["Size"] = v.Size
  236. data["Objects"]["obj"..num]["Frame"..frames]["CFrame"] = v.CFrame
  237. end
  238. a(v)
  239. end
  240. end
  241. a(workspace)
  242. end
  243. recording = false
  244. end
  245. end)
  246. local joints = {rs,ls,rh,lh,neck,rj}
  247. local todo = {}
  248. for i,v in pairs(joints) do
  249. local tabl = {
  250. Name = v.Name,
  251. Part0 = v.Part0,
  252. Part1 = v.Part1,
  253. C0 = v.C0,
  254. C1 = v.C1,
  255. Parent = v.Parent,
  256. }
  257. table.insert(todo, tabl)
  258. end
  259. local idlesin = 0
  260. local walkloopnum = 0
  261. local function ontouch()
  262. local cf1 = char.Head.CFrame
  263. local cf2 = char.Torso.CFrame
  264. local cf3 = char["Right Arm"].CFrame
  265. local cf4 = char["Left Arm"].CFrame
  266. local cf5 = char["Right Leg"].CFrame
  267. local cf6 = char["Left Leg"].CFrame
  268. wait(2)
  269. repeat wait()
  270. local hum = humanoid
  271. hum.Health = hum.MaxHealth
  272. char.Head.CFrame = cf1
  273. char.Torso.CFrame = cf2
  274. char["Right Arm"].CFrame = cf3
  275. char["Left Arm"].CFrame = cf4
  276. char["Right Leg"].CFrame = cf5
  277. char["Left Leg"].CFrame = cf6
  278. for i,v in pairs(char:children()) do
  279. if v:IsA("BasePart") and v.Name ~= "HumanoidRootPart" then
  280. v.Anchored = true
  281. end
  282. end
  283. for i,v in pairs(todo) do
  284. local m = Instance.new("Motor6D")
  285. local stuf = {"Name", "Part0", "Part1", "C0", "C1", "Parent"}
  286. for i,e in pairs(stuf) do
  287. m[e] = v[e]
  288. end
  289. end
  290. for i,v in pairs(char:children()) do
  291. if v:IsA("BasePart") and v.Name ~= "HumanoidRootPart" then
  292. v.Anchored = false
  293. end
  294. end
  295. hum.Health = hum.MaxHealth
  296. swait()
  297. until hum.Health > 0
  298. end
  299. humanoid.Died:connect(function()
  300. ontouch(char.Torso)
  301. end)
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322. -- Roblox.LUA | Neko Pets, WIP. | Made by Cass.
  323.  
  324. --Declarations
  325. local Cn=CFrame.new
  326. local CA=CFrame.Angles
  327. local mr=math.rad
  328. local rn=math.random
  329. local mc=math.cos
  330. local Vn=Vector3.new
  331. local NR=NumberRange.new
  332. local NSeq=NumberSequence.new
  333. local plrs=game:service"Players"
  334. local wrk=game:service"Workspace"
  335. local deb=game:service"Debris"
  336. local rs=game:service"RunService".Stepped
  337. local IS=game:GetService("InsertService")
  338. local TS=game:GetService("TweenService")
  339. local UIS=game:GetService("UserInputService")
  340. local p=plrs.LocalPlayer
  341. local cam=wrk.CurrentCamera
  342. local char=p.Character
  343. local mouse=p:GetMouse()
  344. local lam=char["Left Arm"]
  345. local ram=char["Right Arm"]
  346. local llg=char["Left Leg"]
  347. local rlg=char["Right Leg"]
  348. local hed=char.Head
  349. local tor=char.Torso
  350. local hrp=char.HumanoidRootPart
  351.  
  352. for _,v in pairs(char:GetChildren()) do
  353. if v.Name=="asdFlower" then
  354. v:Destroy()
  355. end
  356. end
  357. script.Name="asdFlower"
  358.  
  359. ---Tables
  360.  
  361. local Anims={}
  362. local Vars={
  363. sine=0;
  364. animpose="";
  365. lastanimpose="";
  366. ffing=false;
  367. on=false;
  368. noRig=false;
  369. int=0;
  370. sFollow=true;
  371. kFollow=true;
  372. sPos=Cn(30,10,30);
  373. kPos=Cn(26,10,30);
  374. sRot=CA(0,0,0);
  375. kRot=CA(0,0,0);
  376. sRotting=true;
  377. kRotting=true;
  378. }
  379. local blink={
  380. sCur=0;
  381. kCur=0;
  382. sMax=7;
  383. kMax=7;
  384. sOn=false;
  385. kOn=false;
  386. }
  387.  
  388. ---Functions
  389.  
  390. function bool(lean)
  391. on.Value=lean
  392. Vars.on=lean
  393. end
  394.  
  395. --
  396. function FndHm(flnm)
  397. for i,v in pairs(flnm:GetChildren()) do
  398. if v:IsA("Humanoid") then
  399. return v
  400. end
  401. end
  402. end
  403. local hum=FndHm(char)
  404.  
  405. --
  406. function chrDes(inst)
  407. local ret=nil
  408. for _,v in pairs(game.Players:GetChildren()) do
  409. if inst:IsDescendantOf(v) then
  410. ret=v
  411. break
  412. end
  413. end
  414. return ret
  415. end
  416.  
  417. --
  418. function get(a)
  419. local cont={}
  420. for i,v in pairs(a:GetChildren()) do
  421. table.insert(cont,v)
  422. pcall(function()
  423. for _,b in pairs(get(v)) do
  424. table.insert(cont,b)
  425. end
  426. end)
  427. end
  428. return cont
  429. end
  430.  
  431. --
  432. function inT(qur,tbl)
  433. local a=false
  434. for i,v in pairs(tbl) do
  435. if v==qur then
  436. a=true
  437. break
  438. else
  439. a=false
  440. end
  441. end
  442. return a
  443. end
  444.  
  445. --
  446. function Tween(a,b,c)
  447. return a+(b-a)*c
  448. end
  449.  
  450. --
  451. function vectorTween(a,b,c)
  452. return Vector3.new(a.X+(b.X-a.X)*c,a.Y+(b.Y-a.Y)*c,a.Z+(b.Z-a.Z)*c)
  453. end
  454.  
  455. --
  456. function Avg(a,b)
  457. return Cn((a.X+b.X)/2,(a.Y+b.Y)/2,(a.Z+b.Z)/2)
  458. end
  459.  
  460. --
  461. function RLerp(c1,c2,tim)
  462. return c1:lerp(c2,tim)
  463. end
  464.  
  465. --
  466. function tPos(ui,ud,ES,tim)
  467. ui:TweenPosition(ud,0,ES,tim)
  468. end
  469.  
  470. --
  471. function newAnim(wld)
  472. local asd={["Weld"]=wld;["Int"]=0;["Frame"]=1;}
  473. asd.getFrames=function()
  474. local num=0
  475. for _,v in pairs(asd) do
  476. pcall(function()
  477. num=num+v.Length
  478. end)
  479. end
  480. return num
  481. end
  482. asd.resetAnim=function()
  483. asd.Int=0
  484. asd.Frame=1
  485. end
  486. table.insert(Anims,asd)
  487. return asd
  488. end
  489.  
  490. --
  491. function newKF(tab,c0,lng,off,eas)
  492. off=off or 1
  493. table.insert(tab,{["C0"]=c0,["Length"]=lng,["Offset"]=off,["Ease"]=eas})
  494. end
  495.  
  496. --
  497. function runKF(tab)
  498. tab.Int=tab.Int+1
  499. if tab.Int>=tab[tab.Frame].Length-(tab[tab.Frame].Ease or 0) then
  500. tab.Frame=tab.Frame+1
  501. tab.Int=0
  502. if tab.Frame>#tab then
  503. tab.Frame=1
  504. end
  505. end
  506. tab.Weld.C0=RLerp(tab.Weld.C0,tab[tab.Frame].C0,(tab[tab.Frame].Offset/tab[tab.Frame].Length)*tab.Int)
  507. end
  508.  
  509. --
  510. function nwPrt(prnt,siz,cf,col)
  511. local prt=Instance.new("Part")
  512. prt.Parent=prnt
  513. prt.FormFactor=3
  514. prt.Name="Part"
  515. prt.Size=siz
  516. prt.CanCollide=false
  517. prt.Anchored=true
  518. prt.Locked=true
  519. prt.TopSurface=10
  520. prt.BottomSurface=10
  521. prt.FrontSurface=10
  522. prt.BackSurface=10
  523. prt.LeftSurface=10
  524. prt.RightSurface=10
  525. prt:BreakJoints()
  526. prt.CFrame=cf or Cn(30,10,30)
  527. prt.Material="SmoothPlastic"
  528. prt.BrickColor=BrickColor.new(col)
  529. m=Instance.new("SpecialMesh",prt)
  530. m.MeshType=6
  531. return prt
  532. end
  533.  
  534. --
  535. function nwWdg(prnt,siz,cf,col)
  536. local prt=Instance.new("WedgePart")
  537. prt.Parent=prnt
  538. prt.FormFactor=3
  539. prt.Name="Part"
  540. prt.Size=siz
  541. prt.CanCollide=false
  542. prt.Anchored=false
  543. prt.Locked=true
  544. prt.TopSurface=0
  545. prt.BottomSurface=0
  546. prt:BreakJoints()
  547. prt.CFrame=cf or Cn(30,10,30)
  548. prt.Material="SmoothPlastic"
  549. prt.BrickColor=BrickColor.new(col)
  550. return prt
  551. end
  552.  
  553. --
  554. function newGui(prnt,clsnm,siz,pos,bsp,bc,bt)
  555. local gui=Instance.new(clsnm,prnt)
  556. gui.Size=siz or UDim2.new(0,100,0,100)
  557. gui.Position=pos or UDim2.new(0,0,0,0)
  558. gui.BorderSizePixel=bsp or 0
  559. gui.BackgroundColor3=bc or Color3.new(0,0,0)
  560. gui.BackgroundTransparency=bt or 1
  561. return gui
  562. end
  563.  
  564. --
  565. function nwWld(wp0,wp1,wc0)
  566. wld = Instance.new("Weld",wp1)
  567. wld.Part0=wp0
  568. wld.Part1=wp1
  569. wld.C0=wc0 or Cn(0,0,0)
  570. return wld
  571. end
  572.  
  573. --
  574. function nwSnd(pch,vol,id)
  575. local s=Instance.new("Sound",hed)
  576. s.Pitch=pch
  577. s.Volume=vol
  578. s.SoundId="rbxassetid://"..id
  579. s.PlayOnRemove=true
  580. s:Destroy()
  581. end
  582.  
  583. --
  584. function newRay(start,face,range,wat)
  585. local rey=Ray.new(start.p,(face.p-start.p).Unit*range)
  586. hit,pos=Workspace:FindPartOnRayWithIgnoreList(rey,wat)
  587. return rey,hit,pos
  588. end
  589.  
  590. --
  591. for _,v in pairs(get(char)) do
  592. if v:IsA("Motor6D") then
  593. v.Parent=v.Part1
  594. end
  595. end
  596. function replaceWeld(purt)
  597. for _,v in pairs(purt:GetChildren()) do
  598. if v:IsA("Motor6D") then
  599. table.insert(Mots,v)
  600. v.Parent=nil
  601. local wld=nwWld(v.Part0,v.Part1,v.C0)
  602. wld.C1=v.C1
  603. return wld
  604. elseif v:IsA("Weld") then
  605. for _,c in pairs(Mots) do
  606. if c.Part1==purt then
  607. v:Destroy()
  608. c.Parent=purt
  609. end
  610. end
  611. end
  612. end
  613. end
  614.  
  615. --
  616. function HSV(H,S,V)
  617. H = H%360
  618. local C=V*S
  619. local H2=H/60
  620. local X=C*(1-math.abs((H2%2)-1))
  621. local color=Color3.new(0,0,0)
  622. if H2<=0 then
  623. color=Color3.new(C,0,0)
  624. elseif 0<=H2 and H2<=1 then
  625. color=Color3.new(C,X,0)
  626. elseif 1<=H2 and H2<=2 then
  627. color=Color3.new(X,C,0)
  628. elseif 2<=H2 and H2<=3 then
  629. color=Color3.new(0,C,X)
  630. elseif 3<=H2 and H2<=4 then
  631. color=Color3.new(0,X,C)
  632. elseif 4<=H2 and H2<=5 then
  633. color=Color3.new(X,0,C)
  634. elseif 5<=H2 and H2<=6 then
  635. color=Color3.new(C,0,X)
  636. end
  637. local m=V-C
  638. return Vector3.new(color.r+m,color.g+m,color.b+m)
  639. end
  640.  
  641. ---Welds
  642.  
  643. local law=nwWld(tor,lam,Cn(-1.5,0.5,0))
  644. law.C1=Cn(0,0.5,0)
  645. local raw=nwWld(tor,ram,Cn(1.5,0.5,0))
  646. raw.C1=Cn(0,0.5,0)
  647. hew=nwWld(tor,hed,Cn(0,1.5,0))
  648. local llw=nwWld(tor,llg,Cn(-0.5,-1,0))
  649. llw.C1=Cn(0,1,0)
  650. local rlw=nwWld(tor,rlg,Cn(0.5,-1,0))
  651. rlw.C1=Cn(0,1,0)
  652. local tow=nwWld(hrp,tor,Cn(0,-1,0))
  653. tow.C1=Cn(0,-1,0)
  654.  
  655. --
  656. local laD=Cn(-1.5,0.5,0)
  657. local raD=Cn(1.5,0.5,0)
  658. local hD=Cn(0,1.5,0)
  659. local tD=Cn(0,-1,0)
  660. local llD=Cn(-0.5,-1,0)
  661. local rlD=Cn(0.5,-1,0)
  662.  
  663. ---Build
  664.  
  665.  
  666. ---Anims
  667.  
  668. --Idle
  669. local heid=newAnim(hew)
  670. newKF(heid,hD,40,0.3,5)
  671. local toid=newAnim(tow)
  672. newKF(toid,tD*Cn(0,0.025,0)*CA(mr(0.5),0,0),40,0.3,5)
  673. newKF(toid,tD,40,0.3,5)
  674. local laid=newAnim(law)
  675. newKF(laid,laD*Cn(0,0.025,0)*CA(0,0,mr(-1)),40,0.3,5)
  676. newKF(laid,laD,40,0.3,5)
  677. local raid=newAnim(raw)
  678. newKF(raid,raD*Cn(0,0.025,0)*CA(0,0,mr(1)),40,0.3,5)
  679. newKF(raid,raD,40,0.3,5)
  680. local llid=newAnim(llw)
  681. newKF(llid,llD*Cn(0,-0.025,0)*CA(mr(-0.5),0,0),40,0.3,5)
  682. newKF(llid,llD,40,0.3,5)
  683. local rlid=newAnim(rlw)
  684. newKF(rlid,rlD*Cn(0,-0.025,0)*CA(mr(-0.5),0,0),40,0.3,5)
  685. newKF(rlid,rlD,40,0.3,5)
  686.  
  687. --Walk
  688. local hewk=newAnim(hew)
  689. newKF(hewk,hD,40,0.3,5)
  690. local towk=newAnim(tow)
  691. newKF(towk,tD*Cn(0,0.1,0),15,0.3,2)
  692. newKF(towk,tD*CA(0,0,mr(-1)),15,0.3,2)
  693. newKF(towk,tD*Cn(0,0.1,0),15,0.3,2)
  694. newKF(towk,tD*CA(0,0,mr(1)),15,0.3,2)
  695. local lawk=newAnim(law)
  696. newKF(lawk,laD*CA(mr(40),0,0),30,0.3,4)
  697. newKF(lawk,laD*CA(mr(-40),0,0),30,0.3,4)
  698. local rawk=newAnim(raw)
  699. newKF(rawk,raD*CA(mr(-40),0,0),30,0.3,4)
  700. newKF(rawk,raD*CA(mr(40),0,0),30,0.3,4)
  701. local llwk=newAnim(llw)
  702. newKF(llwk,llD*Cn(0,0,0)*CA(mr(-45),0,0),26,0.3,0)
  703. newKF(llwk,llD*Cn(0,0.2,0),15,0.3,2)
  704. newKF(llwk,llD*Cn(0,-0.2,0)*CA(mr(45),0,0),15,0.3,2)
  705. local rlwk=newAnim(rlw)
  706. newKF(rlwk,rlD*Cn(0,0.2,0),15,0.3,2)
  707. newKF(rlwk,rlD*Cn(0,-0.2,0)*CA(mr(45),0,0),15,0.3,2)
  708. newKF(rlwk,rlD*Cn(0,0,0)*CA(mr(-45),0,0),26,0.3,0)
  709.  
  710. --FreeFalling
  711. local heff=newAnim(hew)
  712. newKF(heff,hD,20,0.3,5)
  713. local toff=newAnim(tow)
  714. newKF(toff,tD,20,0.3,5)
  715. local laff=newAnim(law)
  716. newKF(laff,laD*CA(mr(140),0,mr(-10)),20,0.3,5)
  717. local raff=newAnim(raw)
  718. newKF(raff,raD*CA(mr(140),0,mr(10)),20,0.3,5)
  719. local llff=newAnim(llw)
  720. newKF(llff,llD*CA(0,0,mr(-5)),20,0.3,5)
  721. local rlff=newAnim(rlw)
  722. newKF(rlff,rlD*CA(0,0,mr(5)),20,0.3,5)
  723.  
  724. --Blink
  725. local eyeInfo=TweenInfo.new(0.3,1,1,0,false,0)
  726. function cEye(ley,rey)
  727. local anim1=TS:Create(ley.Mesh,eyeInfo,{Scale=Vn(1,0.2,1)})
  728. local anim2=TS:Create(rey.Mesh,eyeInfo,{Scale=Vn(1,0.2,1)})
  729. anim1:Play()
  730. anim2:Play()
  731. end
  732.  
  733. function oEye(ley,rey)
  734. local anim1=TS:Create(ley.Mesh,eyeInfo,{Scale=Vn(1,1,1)})
  735. local anim2=TS:Create(rey.Mesh,eyeInfo,{Scale=Vn(1,1,1)})
  736. anim1:Play()
  737. anim2:Play()
  738. end
  739.  
  740. function hcEye(ley,rey)
  741. local anim1=TS:Create(ley.Mesh,eyeInfo,{Scale=Vn(1,0.6,1)})
  742. local anim2=TS:Create(rey.Mesh,eyeInfo,{Scale=Vn(1,0.6,1)})
  743. anim1:Play()
  744. anim2:Play()
  745. end
  746.  
  747. --Angry
  748.  
  749.  
  750. local movInfo=TweenInfo.new(0.1,1,1,1,false,0.1)
  751.  
  752. ---Main
  753.  
  754. function reAdjust(ey1,ey2)
  755. for i=1,10 do
  756. ey1.Motor6D.C0=RLerp(ey1.Motor6D.C0,leD,0.2)
  757. ey2.Motor6D.C0=RLerp(ey2.Motor6D.C0,reD,0.2)
  758. rs:wait()
  759. end
  760. end
  761.  
  762. function happy(bod,ey1,ey2)
  763. cEye(ey1,ey2)
  764. local scalInfo=TweenInfo.new(0.4,7,1,0,false,0)
  765. local wobl=TS:Create(bod.Mesh,scalInfo,{Scale=Vn(1,1,1)})
  766. local a,b,c=bod.CFrame:toEulerAnglesXYZ()
  767. for i=1,5 do
  768. for i=1,10 do
  769. bod.CFrame=RLerp(bod.CFrame,Cn(bod.Position+Vn(0,1,0))*CA(a,b,c),0.3)
  770. rs:wait()
  771. end
  772. for i=1,10 do
  773. bod.CFrame=RLerp(bod.CFrame,Cn(bod.Position-Vn(0,1,0))*CA(a,b,c),0.3)
  774. rs:wait()
  775. end
  776. bod.Mesh.Scale=Vn(1.2,0.8,1.2)
  777. wobl:Play()
  778. wait(0.1)
  779. end
  780. reAdjust(ey1,ey2)
  781. end
  782.  
  783. function angry(bod,ey1,ey2)
  784. hcEye(ey1,ey2)
  785. for i=1,10 do
  786. ey1.Motor6D.C0=RLerp(ey1.Motor6D.C0,leD*CA(0,0,mr(-40)),0.2)
  787. ey2.Motor6D.C0=RLerp(ey2.Motor6D.C0,reD*CA(0,0,mr(40)),0.2)
  788. rs:wait()
  789. end
  790. end
  791.  
  792. function chase()
  793. Vars.on=true
  794. Vars.sFollow=false
  795. Vars.kFollow=false
  796. Vars.sRotting=false
  797. Vars.kRotting=false
  798. blink.sOn=true
  799. blink.kOn=true
  800. Vars.sPos=(Cn(hrp.Position)*Cn(0,0,-3)).p
  801. Vars.kPos=(Cn(hrp.Position)*CA(0,mr(-5),0)*Cn(0,0,-3)).p
  802. angry(kbod,key1,key2)
  803. wait(0.1)
  804. for a=1,6 do
  805. for i=0,360,10 do
  806. Vars.sPos=(Cn(hrp.Position)*CA(0,mr(i),0)*Cn(0,0,-3)).p
  807. Vars.kPos=(Cn(hrp.Position)*CA(0,mr(i-40),0)*Cn(0,0,-3)).p
  808. Vars.sRot=CA(0,mr(i+90+(40*mc(Vars.sine/4))),0)
  809. Vars.kRot=CA(0,mr(i+60),0)
  810. wait()
  811. end
  812. end
  813. local rand=rn(1,2)
  814. if rand==1 then
  815. local a,b,c=Cn(sbod.Position,kbod.Position):toEulerAnglesXYZ()
  816. Vars.sRot=CA(a,b,c)*CA(0,mr(0+(40*mc(Vars.sine/4))),0)
  817. reAdjust(key1,key2)
  818. happy(kbod,key1,key2)
  819. elseif rand==2 then
  820. Vars.sPos=(hrp.CFrame*Cn(-2.5,-1.5,1)).p
  821. wait(0.2)
  822. local sa,sb,sc=Cn(sbod.Position,kbod.Position):toEulerAnglesXYZ()
  823. local ka,kb,kc=Cn(kbod.Position,sbod.Position):toEulerAnglesXYZ()
  824. Vars.sRot=CA(sa,sb,sc)
  825. Vars.kRot=CA(ka,kb,kc)
  826. happy(sbod,sey1,sey2)
  827. wait(0.4)
  828. Vars.sPos=(hrp.CFrame*Cn(3,0.5,1)).p
  829. wait(0.2)
  830. local sa,sb,sc=Cn(sbod.Position,kbod.Position):toEulerAnglesXYZ()
  831. local ka,kb,kc=Cn(kbod.Position,sbod.Position):toEulerAnglesXYZ()
  832. Vars.sRot=CA(sa,sb,sc)
  833. Vars.kRot=CA(ka,kb,kc)
  834. happy(sbod,sey1,sey2)
  835. wait(0.6)
  836. Vars.sPos=(hrp.CFrame*Cn(0,4,1)).p
  837. wait(0.2)
  838. local sa,sb,sc=Cn(sbod.Position,kbod.Position):toEulerAnglesXYZ()
  839. local ka,kb,kc=Cn(kbod.Position,sbod.Position):toEulerAnglesXYZ()
  840. Vars.sRot=CA(sa,sb,sc)
  841. Vars.kRot=CA(ka,kb,kc)
  842. happy(sbod,sey1,sey2)
  843. wait(0.4)
  844. end
  845. local ha,hb,hc=hrp.CFrame:toEulerAnglesXYZ()
  846. Vars.sRot=CA(ha,hb,hc)
  847. Vars.kRot=CA(ha,hb,hc)
  848. Vars.sFollow=true
  849. Vars.kFollow=true
  850. Vars.sRotting=true
  851. Vars.kRotting=true
  852. blink.sOn=false
  853. blink.kOn=false
  854. Vars.on=false
  855. end
  856.  
  857. mouse.KeyDown:connect(function(k)
  858. if k=="l" then
  859. chase()
  860. end
  861. end)
  862.  
  863. ---Loop
  864.  
  865. local ffing=false
  866. hum.FreeFalling:connect(function(asd)
  867. ffing=asd
  868. end)
  869.  
  870. rs:connect(function()
  871. Vars.sine=Vars.sine+1
  872. if blink.sOn==false then
  873. blink.sCur=blink.sCur+0.03
  874. end
  875. if blink.kOn==false then
  876. blink.kCur=blink.kCur+0.03
  877. end
  878. if hum.Sit==true then
  879. Vars.animpose="Sitting"
  880. elseif ffing==true then
  881. Vars.animpose="Freefalling"
  882. elseif (hrp.Velocity*Vn(1,0,1)).magnitude<2 then
  883. Vars.animpose="Idle"
  884. elseif (hrp.Velocity*Vn(1,0,1)).magnitude<20 then
  885. Vars.animpose="Walking"
  886. elseif (hrp.Velocity*Vn(1,0,1)).magnitude>20 then
  887. Vars.animpose="Sprinting"
  888. end
  889. if Vars.noRig==false then
  890. if Vars.animpose=="Freefalling" then
  891. runKF(heff)
  892. runKF(toff)
  893. runKF(laff)
  894. runKF(raff)
  895. runKF(llff)
  896. runKF(rlff)
  897. elseif Vars.animpose=="Idle" then
  898. runKF(heid)
  899. runKF(toid)
  900. runKF(laid)
  901. runKF(raid)
  902. runKF(llid)
  903. runKF(rlid)
  904. elseif Vars.animpose=="Walking" then
  905. runKF(hewk)
  906. runKF(towk)
  907. runKF(lawk)
  908. runKF(rawk)
  909. runKF(llwk)
  910. runKF(rlwk)
  911. end
  912. end
  913. if Vars.sFollow==true then
  914. Vars.sPos=(hrp.CFrame*Cn(-2,3,0)).p
  915. end
  916. if Vars.kFollow==true then
  917. Vars.kPos=(hrp.CFrame*Cn(2,3,0)).p
  918. end
  919. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement