Advertisement
naser2345

Mugex Exercise

Aug 8th, 2016
3,153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.19 KB | None | 0 0
  1. game:service'RunService':UnbindFromRenderStep('Mug_Anims')
  2. ply=game:service'Players'.LocalPlayer
  3. char=ply.Character
  4. torso=char.Torso
  5. rarm,larm=char['Right Arm'],char['Left Arm']
  6. rleg,lleg=char['Right Leg'],char['Left Leg']
  7.  
  8. bcol=BrickColor.new
  9. cfn,md,mr,v3n=CFrame.new,math.rad,math.random,Vector3.new
  10. ang=function(x,y,z)return CFrame.Angles(x or 0,y or 0,z or 0)end
  11. Debris=game:service'Debris'
  12. m={}
  13. m.tau=math.pi*2
  14. m.floatforce = 196.25
  15.  
  16. hum_root=char.HumanoidRootPart
  17.  
  18. mouse=ply:GetMouse()
  19.  
  20. function l(a,x,y,z,xx,yy,zz)
  21. if string.find(tostring(a),',') == nil then
  22. return (a.CFrame*CFrame.new(x or 0,y or 0,z or 0))*CFrame.Angles(xx or 0,yy or 0, zz or 0)
  23. else return (a * CFrame.new(x or 0,y or 0,z or 0))*CFrame.Angles(xx or 0,yy or 0,zz or 0)
  24. end
  25. end
  26.  
  27. pcall(function() char.Stick:Destroy() end) --- Destroys Physical Tool
  28. Weapon = Instance.new("Model",char) Weapon.Name = 'Stick'
  29.  
  30. do --UTILITIES
  31.  
  32. function Create(ClassName)
  33. local obj=Instance.new(ClassName)
  34. return function(props)
  35. obj.Parent=Weapon
  36. for key,val in pairs(props)do
  37. if key=='_P'then
  38. obj['Parent']=val
  39. elseif i=='_C'then
  40. obj[val[1]]:connect(val[2])
  41. else
  42. obj[key]=val
  43. end
  44. end
  45. return obj
  46. end
  47. end
  48.  
  49. do --CREATION
  50.  
  51. Weld = function(p0,p1,x,y,z,rx,ry,rz,par)
  52. p0.Position = p1.Position
  53. local w = Instance.new('Motor',game:service'JointsService')
  54. w.Part0 = p1
  55. w.Part1 = p0
  56. w.C0 = CFrame.new(x or 0,y or 0,z or 0)*CFrame.Angles(rx or 0,ry or 0,rz or 0)
  57. w.MaxVelocity = .1
  58. return w
  59. end
  60. Cur_Parent=nil
  61. current_mat=nil
  62. anchor=false
  63. Part = function(x,y,z,color,tr,cc,an,parent)
  64. local p = Instance.new('Part',parent or Cur_Parent or Weapon)
  65. p.formFactor = 'Custom'
  66. p.Locked = true
  67. p.Position=torso.Position
  68. p.Size = Vector3.new(x,y,z)
  69. p.BrickColor = BrickColor.new(color or 'White')
  70. p.CanCollide = cc or false
  71. p.Anchored = an or anchor or false
  72. p.Transparency = tr or 0
  73. p.Material=current_mat or'SmoothPlastic'
  74. for i,v in pairs{'TopSurface','BottomSurface','FrontSurface','BackSurface','LeftSurface','RightSurface'}do
  75. p[v]=10
  76. end
  77. return p
  78. end
  79. Wedge = function(x,y,z,color,tr,cc,an,parent)
  80. local p = Instance.new('WedgePart',parent or Weapon)
  81. p.formFactor = 'Custom'
  82. p.Size = Vector3.new(x,y,z)
  83. p.BrickColor = BrickColor.new(color or 'White')
  84. p.CanCollide = cc or false
  85. p.Anchored = an or false
  86. p.Transparency = tr or 0
  87. p.Material=current_mat or'SmoothPlastic'
  88. for i,v in pairs{'TopSurface','BottomSurface','FrontSurface','BackSurface','LeftSurface','RightSurface'}do
  89. p[v]=10
  90. end
  91. return p
  92. end
  93.  
  94. Meshes = {Diamond='9756362';Spikeball='9982590';Table='111868131';
  95. Egg='1527559';Ring='3270017';Bullet='2697549';Grass='1080954';
  96. Shark='82821384';Sword='12221720';Crown='10688643';Spike='1033714';
  97. Leaf='48100239';Fist='65322375';Chakram='19251107';Crown='20329976'}
  98.  
  99. Textures = {Leaf='rbxassetid://48047287'}
  100.  
  101. Mesh = function(par,num,x,y,z,tex)
  102. local msh = _
  103. if num == 1 then msh = Instance.new("CylinderMesh",par)
  104. elseif num == 2 then msh = Instance.new("SpecialMesh",par) msh.MeshType = 3
  105. elseif num == 3 then msh = Instance.new("SpecialMesh",par) msh.MeshType = 6
  106. elseif num == 4 then msh = Instance.new("SpecialMesh",par) msh.MeshType = 'Wedge'
  107. elseif type(num) == 'string' then msh = Instance.new("SpecialMesh",par)
  108. if num=='Torso'then msh.MeshType=1 else
  109. msh.MeshId = string.find(num,'://') == nil and 'rbxassetid://'..Meshes[num] or num end
  110. end
  111. msh.Scale = Vector3.new(x or 1,y or 1,z or 1)
  112. if tex then
  113. msh.TextureId = Textures[tex] or tex or ''
  114. end
  115. return msh
  116. end
  117.  
  118. end
  119.  
  120. function findHum(pos,rad,hum2)
  121. local hums={}
  122. function check(a)
  123. local res=false
  124. for i,ho in pairs(hums)do
  125. if a==ho then res=true end
  126. end
  127. return res
  128. end
  129. for i,v in pairs(Workspace:children())do
  130. if v:IsA'Model'and v~=char and v~=(hum2 or char) then
  131. for i,q in pairs(v:children())do
  132. if q:IsA'Humanoid' and q.Parent:FindFirstChild'Torso'and(q.Torso.Position-pos).magnitude < rad then
  133. if not check(q)then
  134. table.insert(hums,q)
  135. end
  136. end
  137. end
  138. end
  139. end
  140. return hums
  141. end
  142.  
  143.  
  144. udim=function(a,b,c,d)
  145. if type(a)=='string'then
  146. x,y=tostring(a):match('(%d*%.*%d*),(%d*%.*%d*)')
  147. return UDim2.new(x or 0,x2 or 0,y or 0,y2 or 0)
  148. else
  149. return UDim2.new(a or 0,c or 0,b or 0,d or 0)
  150. end end
  151.  
  152. function getHum(what,b)local res
  153. for i,v in pairs(what:children())do
  154. if v:IsA'Humanoid' then
  155. res=v
  156. end
  157. end
  158. return res
  159. end
  160.  
  161. end
  162.  
  163. do --ANIMATIONSYSTEM DECLARATIONS
  164. cont_anim=true
  165.  
  166. rarm,larm=char['Right Arm'],char['Left Arm']
  167. rleg,lleg=char['Right Leg'],char['Left Leg']
  168.  
  169. torw=char.HumanoidRootPart.RootJoint
  170. neck=torso.Neck
  171. rs,ls=torso['Right Shoulder'],torso['Left Shoulder']
  172. rh,lh=torso['Right Hip'],torso['Left Hip']
  173.  
  174. ort=cfn(0,0,0,-1,0,0,0,0,1,0,1,-0)
  175. norig=cfn(0,1,0,-1,-0,-0,0,0,1,0,1,0)
  176.  
  177. rw,lw=nil,nil
  178. arms=nil
  179.  
  180. r_shl_c0=cfn(1,0.5,0)--,0,0,1,0,1,0,-1,-0,-0)
  181. r_shl_c1=cfn(-0.5,0.5,0)--,0,0,1,0,1,0,-1,-0,-0)
  182.  
  183. l_shl_c0=cfn(-1,0.5,0)--,0,0,1,0,1,0,-1,-0,-0)
  184. l_shl_c1=cfn(0.5,0.5,0)--,0,0,1,0,1,0,-1,-0,-0)
  185.  
  186. -- l_shl_c0=cfn(-1,0.5,0)--,-0,-0,-1,0,1,0,1,0,0)
  187. -- l_shl_c1=cfn(0.5,0.5,0)--,-0,-0,-1,0,1,0,1,0,0)
  188.  
  189. r_hip_c0=cfn(1,-1,0)--,0,0,1,0,1,0,-1,-0,-0)
  190. r_hip_c1=cfn(0.5,1,0)--,0,0,1,0,1,0,-1,-0,-0)
  191.  
  192. l_hip_c0=cfn(-1,-1,0)--,-0,-0,-1,0,1,0,1,0,0)
  193. l_hip_c1=cfn(-0.5,1,0)--,-0,-0,-1,0,1,0,1,0,0)
  194.  
  195.  
  196. orig_rhip_c0=cfn(1,-1,0,0,0,1,0,1,0,-1,-0,-0)
  197. orig_lhip_c0=cfn(-1,-1,0,-0,-0,-1,0,1,0,1,0,0)
  198.  
  199. rw_cf=r_shl_c0--cfn(1.5,.95,0)
  200. lw_cf=l_shl_c0
  201.  
  202. rw2_cf=r_hip_c0
  203. lw2_cf=l_hip_c0
  204.  
  205. end
  206.  
  207. do ---ANIMATIONSYSTEM
  208. function Lock(which)
  209. arms={char:FindFirstChild'Right Arm',char:FindFirstChild'Left Arm'}
  210. legs={char:FindFirstChild'Right Leg',char:FindFirstChild'Left Leg'}
  211. local sh={torso:FindFirstChild'Right Shoulder',torso:FindFirstChild'Left Shoulder'}
  212. local sh2={torso:FindFirstChild'Right Hip',torso:FindFirstChild'Left Hip'}
  213. -- print(unpack(sh),unpack(arms))
  214. if arms and torso and sh and legs and sh2 then
  215. if which=='R'then
  216. if not rw then
  217. sh[1].Part1=nil
  218. rw=Instance.new('Weld')
  219. rw.Part0=torso
  220. rw.Parent=torso
  221. rw.Part1=arms[1]
  222. rw.C0=rw_cf
  223. rw.C1=r_shl_c1
  224. else
  225. rw:Destroy() rw=nil
  226. sh[1].Part0=torso sh[1].Part1=arms[1]
  227. end
  228. elseif which=='L'then
  229. if not lw then
  230. sh[2].Part1=nil
  231. lw=Instance.new('Weld')
  232. lw.Part0=torso
  233. lw.Parent=torso
  234. lw.Part1=arms[2]
  235. lw.C0=lw_cf
  236. lw.C1=l_shl_c1
  237. else
  238. lw:Destroy()lw=nil
  239. sh[2].Part0=torso sh[2].Part1=arms[2]
  240. end
  241. end
  242. if which=='RR'then
  243. if not rw2 then
  244. sh2[1].Part1=nil
  245. rw2=Instance.new('Weld')
  246. rw2.Part0=torso
  247. rw2.Parent=torso
  248. rw2.Part1=legs[1]
  249. rw2.C0=rw2_cf
  250. rw2.C1=r_hip_c1
  251. else
  252. rw2.Parent=nil rw2=nil
  253. sh2[1].Part0=torso sh2[1].Part1=legs[1]
  254. end
  255. elseif which=='LL'then
  256. if not lw2 then
  257. sh2[2].Part1=nil
  258. lw2=Instance.new('Weld')
  259. lw2.Part0=torso
  260. lw2.Parent=torso
  261. lw2.Part1=legs[2]
  262. lw2.C0=lw2_cf
  263. lw2.C1=l_hip_c1
  264. else
  265. lw2.Parent=nil lw2=nil
  266. sh2[2].Part0=torso sh2[2].Part1=legs[2]
  267. end
  268. end
  269. end
  270. end
  271.  
  272. pose={rw={},lw={},rw2={},lw2={},torw={},neck={}}
  273. function Anim(what)
  274. local weld=getfenv()[what]
  275. return function(where)
  276. if weld then
  277. target_pos[what]=def_pos[what]*where
  278. -- waitfor(weld,where)
  279. end
  280. end
  281. end
  282.  
  283. spd={
  284. rw=.1;lw=.1;rw2=.1;lw2=.1;torw=.1;neck=.1;hw=.1;
  285. }
  286. setmetatable(spd,{
  287. __newindex=function(tab,i,v)
  288. if i=='all'then
  289. for o,q in pairs(spd)do
  290. spd[o]=v
  291. end
  292. end end
  293. })
  294. def_pos={
  295. rw=rw_cf;lw=lw_cf;
  296. rw2=rw2_cf;lw2=lw2_cf;
  297. torw=ort;
  298. neck=norig;
  299. -- hw=cfn(0,-1,0)*ang(math.pi/2);
  300. shield_w=cfn(-.25,0,0)*ang(math.pi,math.pi/2);
  301. }
  302. target_pos={
  303. rw=rw_cf;
  304. lw=lw_cf;
  305. rw2=def_pos.rw2;
  306. lw2=def_pos.lw2;
  307. torw=def_pos.torw;
  308. neck=def_pos.neck;
  309. -- hw=def_pos.hw;
  310. }
  311. game:service'RunService':BindToRenderStep('Mug_Anims',5,function()
  312. if cont_anim then
  313. if rw then
  314. rw.C0=rw.C0:lerp(target_pos.rw,spd.rw)
  315. end
  316. if lw then
  317. lw.C0=lw.C0:lerp(target_pos.lw,spd.lw)
  318. end
  319. if rw2 then
  320. rw2.C0=rw2.C0:lerp(target_pos.rw2,spd.rw2)
  321. end
  322. if lw2 then
  323. lw2.C0=lw2.C0:lerp(target_pos.lw2,spd.lw2)
  324. end
  325. if torw then
  326. torw.C0=torw.C0:lerp(target_pos.torw,spd.torw)
  327. end
  328. if neck then
  329. neck.C0=neck.C0:lerp(target_pos.neck,spd.neck)
  330. end
  331. -- if hw then
  332. -- hw.C0=hw.C0:lerp(target_pos.hw,spd.hw)
  333. -- end
  334. end
  335. end)
  336. end
  337.  
  338. do --PATTERN
  339. mage_pat={
  340. {{0,0,0,255},{0,0,0,255},{0,0,0,255},{0,0,0,255},{0,0,0,255},{0,0,0,255},{0,0,0,255},{0,0,0,255},{0,0,0,255}};
  341. {{0,0,0,255},{0,255,102,255},{4,255,100,255},{58,48,246,255},{58,48,246,255},{58,48,246,255},{4,255,100,255},{0,255,102,255},{0,0,0,255}};
  342. {{0,0,0,255},{0,255,102,255},{58,48,246,255},{58,48,246,255},{58,48,246,255},{58,48,246,255},{58,48,246,255},{0,255,102,255},{0,0,0,255}};
  343. {{0,0,0,255},{229,13,13,255},{229,13,13,255},{234,255,0,255},{234,255,0,255},{234,255,0,255},{229,13,13,255},{229,13,13,255},{0,0,0,255}};
  344. {{0,0,0,255},{0,0,0,255},{229,13,13,255},{229,13,13,255},{58,48,246,255},{229,13,13,255},{229,13,13,255},{0,0,0,255},{0,0,0,255}};
  345. {{255,255,255,0},{0,0,0,255},{0,0,0,255},{229,13,13,255},{58,48,246,255},{229,13,13,255},{0,0,0,255},{0,0,0,255},{255,255,255,0}};
  346. {{0,0,0,255},{0,0,0,255},{229,13,13,255},{229,13,13,255},{58,48,246,255},{229,13,13,255},{229,13,13,255},{0,0,0,255},{0,0,0,255}};
  347. {{0,0,0,255},{229,13,13,255},{229,13,13,255},{234,255,0,255},{234,255,0,255},{234,255,0,255},{229,13,13,255},{229,13,13,255},{0,0,0,255}};
  348. {{0,0,0,255},{0,255,102,255},{58,48,246,255},{58,48,246,255},{58,48,246,255},{58,48,246,255},{58,48,246,255},{0,255,102,255},{0,0,0,255}};
  349. {{0,0,0,255},{0,255,102,255},{4,255,100,255},{58,48,246,255},{58,48,246,255},{58,48,246,255},{4,255,100,255},{0,255,102,255},{0,0,0,255}};
  350. {{0,0,0,255},{0,0,0,255},{0,0,0,255},{0,0,0,255},{0,0,0,255},{0,0,0,255},{0,0,0,255},{0,0,0,255},{0,0,0,255}};
  351. }
  352.  
  353. function tilefy(obj,pattern,colors)
  354. local function find_longest(a)
  355. local long=0
  356. local tab=nil
  357. for i,_v in pairs(a)do
  358. local v=_v
  359. if type(_v)=='number'then
  360. v={_v}
  361. end
  362. if #v>long then long=#v tab=v end
  363. end
  364. return tab
  365. end
  366. local function compare_tabs(tab,tab2) local res=false
  367. if tab[1]==tab2[1] and tab[2]==tab2[2] and tab[3]==tab[3] and tab[4]==tab[4] then
  368. res=true
  369. end
  370. return res
  371. end
  372. local tab,main_p=pattern,obj
  373. p_sx,p_sy=main_p.Size.x,main_p.Size.y
  374. t_sx,t_sy=#find_longest(tab),#tab
  375. local part_tab={}
  376. tile_x=p_sx/t_sx
  377. tile_y=p_sy/t_sy
  378. height=main_p.Size
  379. COLOR=nil
  380. part_cnt=0
  381. local y=1
  382. repeat
  383. v=tab[y]
  384. tile_x=p_sx/#v
  385. local i=1
  386. repeat
  387. local cur=i
  388. local nex=cur+1
  389. local alph=0
  390. local alph2=1
  391. if v[nex] then
  392. if compare_tabs(v[cur],v[nex]) and v[cur][4]==255 then
  393. while (v[cur] and compare_tabs(v[cur],v[nex])) do
  394. nex=cur
  395. cur=cur+1
  396. alph=alph+1
  397. end
  398. end
  399. end
  400. if v[i][4]~=0 then
  401. local p=Part(.1,.1,height.z,COLOR)ms=Mesh(p,3,(tile_x*(alph<=0 and 1 or alph))*5,(tile_y*(alph2<=0 and 1 or alph2))*5,height.z)
  402. p.Color=Color3.new(v[i][1]/255,v[i][2]/255,v[i][3]/255)
  403. Weld(p,obj,(-p_sx/2+(-.5+i)*tile_x)+ms.Scale.x*.1,(-p_sy/2+(-.5+y)*tile_y),0)
  404. part_cnt=part_cnt+1 table.insert(part_tab,p)
  405. end
  406. i=i+1+((alph-1)<0 and 0 or (alph-1)) alph=0
  407. until v[i]==nil
  408. wait()
  409. y=y+1
  410. until tab[y]==nil
  411. print(part_cnt)
  412. return part_tab
  413. end
  414.  
  415. end
  416.  
  417. do --BUILDING
  418. p=Part(1,1.75,.1)Weld(p,torso,0,0,-.55)
  419.  
  420. to_tilefy=Part(1*.75,1.75*.75,.1,'White',1)Weld(to_tilefy,p,-.05,0,-.1,math.pi)
  421.  
  422. p2=Part(.5,1.9,.1)
  423. Create'Weld'{_P=p2;Part0=p2;Part1=p;
  424. C1=cfn(-.5,0,0)*ang(0,md'25');
  425. C0=cfn(p2.Size.x/2,0,0);
  426. }
  427.  
  428. local function nappi(a)
  429. for i=-p2.Size.y/2+.125,p2.Size.y/2-.125,p2.Size.y/5 do
  430. local pp=Part(.25,.25,.25,'Black')
  431. Weld(pp,a,0,i+.125/2)
  432. local p=Part(.1,.1,.1,'New Yeller')Mesh(p,3,.25,.25,1)p.Material='Neon'
  433. Weld(p,pp,0,0,-.05)
  434. end end
  435. nappi(p2)
  436.  
  437. p22=Part(.5,1.9,.1)
  438. Create'Weld'{_P=p22;Part0=p22;Part1=p;
  439. C1=cfn(.5,0,0)*ang(0,md'-25');
  440. C0=cfn(-p22.Size.x/2,0,0);
  441. }
  442.  
  443. nappi(p22)
  444.  
  445. p3=Part(.5,1,.1)
  446. Create'Weld'{_P=p3;Part0=p3;Part1=p2;
  447. C1=cfn(0,1,0)*ang(math.pi/2);
  448. C0=cfn(0,-p3.size.y/2,0);
  449. }
  450. p32=Part(.5,1,.1)
  451. Create'Weld'{_P=p32;Part0=p32;Part1=p22;
  452. C1=cfn(0,1,0)*ang(math.pi/2);
  453. C0=cfn(0,-p32.size.y/2,0);
  454. }
  455.  
  456. p3=Part(.1,1.2,.1)Mesh(p3,3,.5)
  457. Create'Weld'{_P=p3;Part0=p3;Part1=p2;
  458. C1=cfn(-.3,-1+.15,-.1)*ang(-math.pi/2,0,md'1');
  459. C0=cfn(0,p3.size.y/2,0);
  460. }
  461. p32=Part(.1,1.2,.1)Mesh(p32,3,.5)
  462. Create'Weld'{_P=p32;Part0=p32;Part1=p22;
  463. C1=cfn(.3,-1+.15,-.1)*ang(-math.pi/2,0,md'-1');
  464. C0=cfn(0,p32.size.y/2,0);
  465. }
  466.  
  467. pp=Part(1,2,.1)Weld(pp,torso,0,.05,.55)
  468.  
  469. local function buton(y)
  470. local c_mp=Part(.1,.1,.1,'New Yeller',1)Weld(c_mp,pp,0,y+.175,.1)
  471. local c_sp=Part(.1,.1,.1,'New Yeller')Mesh(c_sp,'Diamond',.25,.25,.25)Weld(c_sp,c_mp,0,0,0,0,math.pi/2)
  472. local r=.125
  473. for i=0,m.tau,m.tau/5 do
  474. local alg=math.pi*(2*(r+(.1/2)))/5
  475. local p=Part(alg,.1,.1,'Black')Mesh(p,3,1.15,.5,.5)
  476. Create'Weld'{_P=p;
  477. Part0=p;Part1=c_mp;
  478. C1=cfn(0,0,0)*ang(math.pi/2,i);
  479. C0=cfn(0,0,r);
  480. }
  481. end
  482. r=r*2
  483. for i=0,m.tau,m.tau/10 do
  484. local alg=math.pi*(2*(r+(.1/2)))/10
  485. local p=Part(alg,.1,.1,'Black')Mesh(p,3,1.1,.5,.5)
  486. Create'Weld'{_P=p;
  487. Part0=p;Part1=c_mp;
  488. C1=cfn(0,0,0)*ang(math.pi/2,i);
  489. C0=cfn(0,0,r);
  490. }
  491. end
  492. end
  493. buton(.5+.1-.15)
  494. buton(-.15)
  495. buton(-.5-.1-.15)
  496.  
  497. Spawn(function()tilefy(to_tilefy,mage_pat,{})end)
  498. end
  499.  
  500.  
  501. RS=game:service'RunService'
  502. function reset()
  503. Anim'rw'(cfn())Anim'lw'(cfn())Anim'torw'(cfn())Anim'rw2'(cfn())Anim'lw2'(cfn())Anim'neck'(cfn())
  504. end
  505. function move()
  506. Anim'rw'(ang(md'120',md'5',md'-45'))
  507. Anim'lw'(ang(md'120',md'-5',md'45'))
  508. Anim'torw'(cfn(0,0,-.15)*ang(md'25'))Anim'rw2'(ang(md'25'))Anim'lw2'(ang(md'25'))
  509. Anim'neck'(ang(md'15'))
  510. ball=Part(1,1,1,'New Yeller',.5)Mesh(ball,'Spike',5,15,5)
  511. bw=Weld(ball,char.HumanoidRootPart,0,1.8)
  512. cloud=Part(1,1,1)Mesh(cloud,'http://www.roblox.com/asset/?id=1095708',4,4,4)
  513. Weld(cloud,ball,0,5)
  514.  
  515. wait(.5)
  516. Anim'neck'(ang(md'-15'))
  517. Anim'torw'(ang(md'-5'))
  518. Anim'rw2'(ang(md'-5'))Anim'lw2'(ang(md'-5'))
  519. Anim'rw'(ang(md'140',0,md'35'))Anim'lw'(ang(md'140',0,md'-35'))
  520. orgc=bw.C0
  521. for i=0,1,.1 do
  522. bw.C0=orgc:lerp(cfn(0,0,-7),i)
  523. bw.C1=cfn()*ang(md'-90'*i)
  524. wait()
  525. end wait(.5)
  526. reset()ball:destroy()cloud:Destroy()
  527. wait(.5)
  528. end
  529.  
  530. function move2()
  531. for _,v in pairs{{-45},{45,md'75'}}do
  532. z_ang=md(v[1])
  533. Anim'neck'(ang(md(-1*(v[1]*.75)),md'-25'))
  534. Anim'torw'(cfn(0,0,-.25)*ang(z_ang,md'45'))
  535. Anim'lw'(ang(v[2]or 0,0,md'-25'))
  536. Anim'rw'(ang(v[2] or md'45',0,md'-45'))
  537. Anim'lw2'(cfn(0,.5,0)*ang(z_ang,0,md'-45'))
  538. Anim'rw2'(ang(z_ang,0,md'-15'))
  539. wait(.5)
  540. Anim'neck'(ang(md(-1*(v[1]*.75)),md'25'))
  541. Anim'torw'(cfn(0,0,-.25)*ang(z_ang,md'-45'))
  542. Anim'lw'(ang(v[2] or md'45',0,md'45'))
  543. Anim'rw'(ang(v[2]or 0,0,md'25'))
  544. Anim'lw2'(ang(z_ang,0,md'15'))
  545. Anim'rw2'(cfn(0,.5,0)*ang(z_ang,0,md'45'))wait(.5)
  546. end
  547. reset()wait(.5)
  548. end
  549.  
  550. function move3()
  551. r=1.5
  552. holding=true
  553. local bpm=140*1.5 local bps=bpm/60
  554. -- bps=2.5
  555. local elapsedT,prevT=0,tick()
  556. Spawn(function()while holding do
  557. RS.Heartbeat:wait()
  558. local d=(tick()-prevT)
  559. elapsedT=elapsedT+d
  560. if elapsedT>1/bps then
  561. Spawn(function()
  562. Anim'torw'(cfn(0,0,3))wait()Anim'torw'(cfn())
  563. end)
  564. elapsedT=elapsedT-1/bps
  565. end
  566. prevT=tick()
  567. end
  568. end)
  569. while holding do
  570. for i=md'45',m.tau,(m.tau)/15 do
  571. if not holding then break end
  572. Anim'rw2'(ang(math.sin(i)*.25,0,math.cos(i)*.25))Anim'lw2'(ang(math.cos(i)*.25,0,math.sin(i)*.25))
  573. Anim'rw'(ang(math.pi/2+math.sin(i)*r,0,math.pi/2+math.cos(i)*r))
  574. Anim'lw'(ang(math.pi/2+math.sin(i)*r,0,-math.pi/2+math.cos(i)*r))
  575. wait(.1)
  576. end end reset()
  577. wait(.5)
  578. end
  579.  
  580. soundId={365531859,365532206}
  581.  
  582. function move4()
  583. local z_ang=45
  584. Anim'neck'(ang(md(-z_ang-10),0))
  585. Anim'torw'(cfn(0,0,-.5)*ang(z_ang,0))
  586. Anim'lw'(ang(75,0,md'45'))
  587. Anim'rw'(ang(75,0,md'-45'))
  588. Anim'lw2'(ang(md(z_ang),0))
  589. Anim'rw2'(ang(md(z_ang),0))
  590. wait(.5)
  591. torso['Left Hip'].C0=orig_lhip_c0*ang(0,0,-md(z_ang+15))
  592. torso['Right Hip'].C0=orig_rhip_c0*ang(0,0,md(z_ang+15))
  593. Lock'RR'Lock'LL'
  594. holding=true
  595. local r2=1.05
  596. while holding do
  597.  
  598. for i=0,1,.1 do
  599. z_ang=45+(i*25)
  600. Anim'neck'(ang(md(-z_ang-10),0))
  601. Anim'torw'(cfn(0,0,-.5-(.05*i))*ang(md(z_ang),0))
  602. -- Anim'lw2'(ang(md(z_ang+5)))Anim'rw2'(ang(md(z_ang+5)))
  603. torso['Left Hip'].C0=orig_lhip_c0*ang(0,0,-md(z_ang)*r2)
  604. torso['Right Hip'].C0=orig_rhip_c0*ang(0,0,md(z_ang)*r2)
  605. wait()
  606. end
  607. for i=1,0,-.1 do
  608. z_ang=45+(i*25)
  609. Anim'neck'(ang(md(-z_ang-10),0))
  610. Anim'torw'(cfn(0,0,-.5-(.05*i))*ang(md(z_ang),0))
  611. -- Anim'lw2'(ang(md(z_ang+5)))Anim'rw2'(ang(md(z_ang+5)))
  612. torso['Left Hip'].C0=orig_lhip_c0*ang(0,0,-md(z_ang)*r2)
  613. torso['Right Hip'].C0=orig_rhip_c0*ang(0,0,md(z_ang)*r2)
  614. wait()
  615. end
  616.  
  617. end
  618. torso['Left Hip'].C0=orig_lhip_c0
  619. torso['Right Hip'].C0=orig_rhip_c0
  620. reset()wait(.5)
  621. end
  622.  
  623. function freeze(a)
  624. local hum=getHum(char)
  625. local orig_spd=hum.WalkSpeed
  626. hum.WalkSpeed=a or 0
  627. return function()hum.WalkSpeed=orig_spd end
  628. end
  629.  
  630. function move5()
  631. local thaw=freeze()
  632. Anim'rw'(ang(md'65',md'-15',md'-25'))
  633. Anim'lw'(cfn(0,0,-.4)*ang(md'65',0,md'50'))
  634. Anim'neck'(ang(md'15',0,md'-15'))
  635. Anim'rw2'(ang(md'120'))
  636. wait(1)
  637. reset()wait(.5)
  638. Anim'rw'(cfn(0,0,-.4)*ang(md'65',0,md'-50'))
  639. Anim'lw'(ang(md'65',md'15',md'25'))
  640. Anim'neck'(ang(md'15',0,md'15'))
  641. Anim'lw2'(ang(md'120'))
  642. wait(1)reset()wait(.5)
  643. Anim'rw2'(ang(md'-120'))
  644. Anim'rw'(ang(md'-65',md'15',md'-25'))
  645. Anim'lw'(cfn(.2,0,.5)*ang(md'-65',0,md'50'))
  646. Anim'torw'(ang(md'25'))Anim'neck'(ang(md'45'))
  647. Anim'lw2'(ang(md'25'))
  648. wait(1)reset()wait(.5)
  649. Anim'lw2'(ang(md'-120'))
  650. Anim'rw2'(ang(md'25'))
  651. Anim'rw'(cfn(-.2,0,.5)*ang(md'-65',0,md'-50'))
  652. Anim'torw'(ang(md'25'))Anim'neck'(ang(md'45'))
  653. Anim'lw'(ang(md'-65',md'15',md'25'))
  654. wait(1)reset()wait(.5)
  655. Anim'torw'(cfn(0,0,-1))
  656. Anim'rw'(ang(0,0,md'25'))Anim'lw'(ang(0,0,md'-25'))
  657. Anim'rw2'(cfn(-.4,.5,0)*ang(0,0,md'75'))Anim'lw2'(cfn(.4,.5,0)*ang(0,0,md'-75'))
  658. wait(1)reset()wait(.5)
  659.  
  660. for i=1,2 do
  661. Anim'rw2'(cfn()*ang(md'15'))
  662. Anim'torw'(cfn(0,0,-.75)*ang(md'65',md'25'))
  663. Anim'lw'(ang(md'75',0,md'5'))
  664. Anim'neck'(ang(md'-45',md'5',md'-15'))
  665. Anim'rw'(cfn(0,0,0)*ang(md'75',0,md'45'))
  666. Anim'lw2'(ang(md'125',0,md'-25'))
  667.  
  668. wait(.5)
  669. reset()wait(.1)
  670. Anim'lw2'(cfn()*ang(md'15'))
  671. Anim'torw'(cfn(0,0,-.75)*ang(md'65',md'-25'))
  672. -- Anim'lw'(ang(md'75',0,md'-15'))
  673. Anim'neck'(ang(md'-45',md'-5',md'15'))
  674. Anim'rw'(ang(md'75',0,md'-5'))
  675. Anim'lw'(ang(md'75',0,md'-45'))
  676. Anim'rw2'(ang(md'125',0,md'25'))
  677. wait(.5)reset()wait(.1)
  678. end
  679. wait(.1)
  680.  
  681. Anim'torw'(cfn(0,0,-1.5)*ang(md'75'))
  682. Anim'rw'(ang(md'90')) Anim'lw'(ang(md'90'))
  683. Anim'rw2'(ang(md'15'))Anim'lw2'(ang(md'15'))
  684.  
  685. for i=1,3 do wait(.5)
  686. Anim'torw'(cfn(0,0,-1.75)*ang(md'85'))
  687. Anim'rw'(cfn(0,0,.4)*ang(md'90')) Anim'lw'(cfn(0,0,.4)*ang(md'90'))
  688. Anim'rw2'(ang(md'20'))Anim'lw2'(ang(md'20'))
  689.  
  690. wait(.5)
  691. Anim'torw'(cfn(0,0,-1.5)*ang(md'75'))
  692. Anim'rw'(ang(md'90')) Anim'lw'(ang(md'90'))
  693. Anim'rw2'(ang(md'15'))Anim'lw2'(ang(md'15'))
  694. end wait(.5)
  695.  
  696. reset()thaw()wait(.5)
  697. end
  698.  
  699. function move6()
  700. Anim'torw'(ang(md'15',md'-25',md'-75'))
  701. Anim'neck'(ang(md'-35',0,md'45'))
  702. Anim'lw'(ang(md'75',0,md'45'))
  703. Anim'rw'(ang(md'90',0,md'-25'))
  704. Anim'rw2'(ang(md'25',md'15'))
  705. Anim'lw2'(ang(md'25',0,md'-15'))
  706. wait(1)
  707. Anim'torw'(ang(0,0,md'45'))
  708. Anim'rw'(ang(md'90',0,md'45'))
  709. Anim'lw'(ang(md'-25',0,md'15'))
  710. Anim'rw2'(ang(md'5',0,md'10'))
  711. Anim'lw2'(ang(0,md'15',md'-15'))
  712. Anim'neck'(ang(0,md'-5',md'-45'))
  713. Anim'lw'(cfn())
  714. wait(1)
  715. reset()wait(.5)
  716. end
  717.  
  718. klist={
  719. f=move;
  720. q=move2;
  721. eq=move3;
  722. tq=move4;
  723. r=move5;
  724. cq=move6
  725. }
  726.  
  727.  
  728. do --CONNECTIONS
  729. local Cons={}
  730.  
  731. Sitting=false
  732. local Cons={}
  733. Replenishing=false
  734. attacking=false
  735.  
  736. function onKeyDown(key)
  737. if attacking or Replenishing then return end
  738. for i,v in pairs(klist) do
  739. local func=v
  740. if key == i:sub(1,1) then
  741. attacking = true
  742. if Sitting and v ~= sit_down then
  743. for o,val in pairs(Choises)do
  744. if key:sub(1,1)==o then
  745. val(mouse)
  746. end
  747. end
  748. else
  749. Lock'R'Lock'RR'Lock'L'Lock'LL'
  750. func(mouse)
  751. for i,v in pairs({ {rw,'R'},{lw,'L'},{rw2,'RR'},{lw2,'LL'} })do
  752. if v[1] then Lock(v[2]) end
  753. end
  754. end
  755. attacking = false
  756. end
  757. end
  758. end
  759. function onKeyUp(key)
  760. if not Sitting then
  761. for i,v in pairs(klist) do
  762. if key == i:sub(1,1) and i:sub(2,#i)=='q' then
  763. holding = false
  764. end
  765. end
  766. else
  767. for i,v in pairs(Choises) do
  768. if key == i:sub(1,1) and i:sub(2,#i)=='q' then
  769. holding = false
  770. end
  771. end
  772. end
  773. end
  774.  
  775. Cons.kup=mouse.KeyUp:connect(onKeyUp)
  776. Cons.kdo=mouse.KeyDown:connect(onKeyDown)
  777. Cons.mup=mouse.Button1Up:connect(function()m_down=false end)
  778.  
  779. local function disable(a)
  780. for i,v in pairs(a:children())do
  781. if v:IsA'BodyMover'then v:Destroy()
  782. else disable(v)end
  783. end
  784. end disable(char)
  785.  
  786. char.ChildAdded:connect(function(a)
  787. if a:IsA'BaseScript'then
  788. for i,v in pairs(Cons)do
  789. v:disconnect()
  790. end
  791. end
  792. end)
  793. prev_tim=tick() end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement