jhuvauni34

ScriptRoblox

Jul 13th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.57 KB | None | 0 0
  1. -- pcall(function()
  2. -- script.DSource.Value = ""
  3. -- script.DSource:Destroy()
  4. -- end)
  5. -- script.Parent = nil
  6.  
  7. game:service'RunService':UnbindFromRenderStep('Mug_Anims')
  8. ply=game:service'Players'.LocalPlayer
  9.  
  10. repeat wait()until ply~=nil
  11.  
  12. char=ply.Character
  13. torso=char.Torso
  14.  
  15. rarm,larm=char['Right Arm'],char['Left Arm']
  16. rleg,lleg=char['Right Leg'],char['Left Leg']
  17. rshl,lshl=torso['Right Shoulder'],torso['Left Shoulder']
  18. rhip,lhip=torso['Right Hip'],torso['Left Hip']
  19.  
  20. bcol=BrickColor.new
  21. cfn,md,mr,v3n=CFrame.new,math.rad,math.random,Vector3.new
  22. ang=function(x,y,z)return CFrame.Angles(x or 0,y or 0,z or 0)end
  23. Debris=game:service'Debris'
  24. m={}
  25. m.tau=math.pi*2
  26. m.floatforce = 196.25
  27. numkp=NumberSequenceKeypoint.new
  28.  
  29. hum_root=char.HumanoidRootPart
  30.  
  31. mouse=ply:GetMouse()
  32.  
  33. function l(a,x,y,z,xx,yy,zz)
  34. if string.find(tostring(a),',') == nil then
  35. 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)
  36. 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)
  37. end
  38. end
  39.  
  40. pcall(function() char.Stick:Destroy() end) --- Destroys Physical Tool
  41. Weapon = Instance.new("Model",char) Weapon.Name = 'Stick'
  42. Instance.new('BoolValue',Weapon).Name='Mug_Did'
  43. do --UTILITIES
  44.  
  45. function Create(ClassName)
  46. local obj=Instance.new(ClassName)
  47. return function(props)
  48. obj.Parent=Weapon
  49. for key,val in pairs(props)do
  50. if key=='_P'then
  51. obj['Parent']=val
  52. elseif i=='_C'then
  53. obj[val[1]]:connect(val[2])
  54. else
  55. obj[key]=val
  56. end
  57. end
  58. return obj
  59. end
  60. end
  61.  
  62. do --CREATION
  63.  
  64. Weld = function(p0,p1,x,y,z,rx,ry,rz,par)
  65. p0.Position = p1.Position
  66. local w = Instance.new('Motor',game:service'JointsService')
  67. w.Part0 = p1
  68. w.Part1 = p0
  69. w.C0 = CFrame.new(x or 0,y or 0,z or 0)*CFrame.Angles(rx or 0,ry or 0,rz or 0)
  70. w.MaxVelocity = .1
  71. return w
  72. end
  73. Cur_Parent=nil
  74. current_mat=nil
  75. anchor=false
  76. Part = function(x,y,z,color,tr,cc,an,parent)
  77. local p = Instance.new('Part',parent or Cur_Parent or Weapon)
  78. p.formFactor = 'Custom'
  79. p.Locked = true
  80. p.Position=torso.Position
  81. p.Size = Vector3.new(x,y,z)
  82. p.BrickColor = BrickColor.new(color or 'White')
  83. p.CanCollide = cc or false
  84. p.Anchored = an or anchor or false
  85. p.Transparency = tr or 0
  86. p.Material=current_mat or'SmoothPlastic'
  87. for i,v in pairs{'TopSurface','BottomSurface','FrontSurface','BackSurface','LeftSurface','RightSurface'}do
  88. p[v]=10
  89. end
  90. return p
  91. end
  92. Wedge = function(x,y,z,color,tr,cc,an,parent)
  93. local p = Instance.new('WedgePart',parent or Cur_Parent or Weapon)
  94. p.formFactor = 'Custom'
  95. p.Size = Vector3.new(x,y,z)
  96. p.BrickColor = BrickColor.new(color or 'White')
  97. p.CanCollide = cc or false
  98. p.Anchored = an or false
  99. p.Transparency = tr or 0
  100. p.Material=current_mat or'SmoothPlastic'
  101. for i,v in pairs{'TopSurface','BottomSurface','FrontSurface','BackSurface','LeftSurface','RightSurface'}do
  102. p[v]=10
  103. end
  104. return p
  105. end
  106.  
  107. Meshes = {Diamond='9756362';Spikeball='9982590';Table='111868131';
  108. Egg='1527559';Ring='3270017';Bullet='2697549';Grass='1080954';
  109. Shark='82821384';Sword='12221720';Crown='10688643';Spike='1033714';
  110. Leaf='48100239';Fist='65322375';Chakram='19251107';Crown='20329976';Spring='9753878';
  111. Tree='8564125';Fireball='10587413';DiamondBall='10917418'}
  112.  
  113. Textures = {Leaf='rbxassetid://48047287';White='rbxassetid://5736319'}
  114.  
  115. Mesh = function(par,num,x,y,z,tex)
  116. local msh = _
  117. if num == 1 then msh = Instance.new("CylinderMesh",par)
  118. elseif num == 2 then msh = Instance.new("SpecialMesh",par) msh.MeshType = 3
  119. elseif num == 3 then msh = Instance.new("SpecialMesh",par) msh.MeshType = 6
  120. elseif num == 4 then msh = Instance.new("SpecialMesh",par) msh.MeshType = 'Wedge'
  121. elseif type(num) == 'string' then msh = Instance.new("SpecialMesh",par)
  122. if num=='Torso'then msh.MeshType=1 else
  123. msh.MeshId = string.find(num,'://') == nil and 'rbxassetid://'..Meshes[num] or num end
  124. end
  125. msh.Scale = Vector3.new(x or 1,y or 1,z or 1)
  126. if tex then
  127. msh.TextureId = Textures[tex] or tex or ''
  128. end
  129. return msh
  130. end
  131.  
  132. end
  133.  
  134. function HSVtoRGB(h, s, v)
  135. h = (h % 1) * 6
  136. local f = h % 1
  137. local p = v * (1 - s)
  138. local q = v * (1 - s * f)
  139. local t = v * (1 - s * (1 - f))
  140. if h < 1 then
  141. return v, t, p
  142. elseif h < 2 then
  143. return q, v, p
  144. elseif h < 3 then
  145. return p, v, t
  146. elseif h < 4 then
  147. return p, q, v
  148. elseif h < 5 then
  149. return t, p, v
  150. else
  151. return v, p, q
  152. end
  153. end
  154.  
  155. function Edit(obj,props)
  156. local objects={}
  157. if type(obj)=='table'then objects=obj
  158. return function(props)
  159. obj.Parent=Weapon
  160. for _,obj in pairs(objects)do
  161. for key,val in pairs(props)do
  162. if key=='_P'then
  163. obj['Parent']=val
  164. elseif i=='_F'then
  165. val(objects)()
  166. else
  167. succes,err=pcall(function()return obj[key]end)
  168. if succes then
  169. obj[key]=val
  170. end
  171. end
  172. end
  173. end
  174. end
  175. end
  176.  
  177. end
  178.  
  179. function calcgrav(obj)
  180. local total=0
  181. local function add(a)
  182. for i,v in pairs(a:children())do
  183. if v:IsA'BasePart'then
  184. total=total+v:GetMass()*m.floatforce
  185. elseif v:IsA'Hat'then
  186. total=total+v.Handle:GetMass()*m.floatforce
  187. else add(v)end
  188. end
  189. end
  190. add(obj or char)
  191. return total
  192. end
  193.  
  194. function findHum(pos,rad,hum2)
  195. local hums={}
  196. function check(a)
  197. local res=false
  198. for i,ho in pairs(hums)do
  199. if a==ho then res=true end
  200. end
  201. return res
  202. end
  203. for i,v in pairs(Workspace:children())do
  204. if v:IsA'Model'and v~=char and v~=(hum2 or char) then
  205. for i,q in pairs(v:children())do
  206. if q:IsA'Humanoid' and q.Parent:FindFirstChild'Torso'and(q.Torso.Position-pos).magnitude < rad then
  207. if not check(q)then
  208. table.insert(hums,q)
  209. end
  210. end
  211. end
  212. end
  213. end
  214. return hums,pos
  215. end
  216.  
  217. udim=function(a,b,c,d)
  218. if type(a)=='string'then
  219. x,y=tostring(a):match('(%d*%.*%d*),(%d*%.*%d*)')
  220. return UDim2.new(x or 0,x2 or 0,y or 0,y2 or 0)
  221. else
  222. return UDim2.new(a or 0,c or 0,b or 0,d or 0)
  223. end end
  224.  
  225. function getHum(what,b)local res
  226. for i,v in pairs(what:children())do
  227. if v:IsA'Humanoid' then
  228. res=v
  229. end
  230. end
  231. return res
  232. end
  233.  
  234. end
  235.  
  236. do --ANIMATIONSYSTEM DECLARATIONS
  237. cont_anim=true
  238.  
  239. rarm,larm=char['Right Arm'],char['Left Arm']
  240. rleg,lleg=char['Right Leg'],char['Left Leg']
  241.  
  242. torw=char.HumanoidRootPart.RootJoint
  243. neck=torso.Neck
  244. rs,ls=torso['Right Shoulder'],torso['Left Shoulder']
  245. rh,lh=torso['Right Hip'],torso['Left Hip']
  246.  
  247. ort=cfn(0,0,0,-1,0,0,0,0,1,0,1,-0)
  248. norig=cfn(0,1,0,-1,-0,-0,0,0,1,0,1,0)
  249.  
  250. rw,lw=nil,nil
  251. arms=nil
  252.  
  253. r_shl_c0=cfn(1,0.5,0)--,0,0,1,0,1,0,-1,-0,-0)
  254. r_shl_c1=cfn(-0.5,0.5,0)--,0,0,1,0,1,0,-1,-0,-0)
  255.  
  256. l_shl_c0=cfn(-1,0.5,0)--,0,0,1,0,1,0,-1,-0,-0)
  257. l_shl_c1=cfn(0.5,0.5,0)--,0,0,1,0,1,0,-1,-0,-0)
  258.  
  259. -- l_shl_c0=cfn(-1,0.5,0)--,-0,-0,-1,0,1,0,1,0,0)
  260. -- l_shl_c1=cfn(0.5,0.5,0)--,-0,-0,-1,0,1,0,1,0,0)
  261.  
  262. r_hip_c0=cfn(1,-1,0)--,0,0,1,0,1,0,-1,-0,-0)
  263. r_hip_c1=cfn(0.5,1,0)--,0,0,1,0,1,0,-1,-0,-0)
  264.  
  265. l_hip_c0=cfn(-1,-1,0)--,-0,-0,-1,0,1,0,1,0,0)
  266. l_hip_c1=cfn(-0.5,1,0)--,-0,-0,-1,0,1,0,1,0,0)
  267.  
  268.  
  269. orig_rhip_c0=cfn(1,-1,0,0,0,1,0,1,0,-1,-0,-0)
  270. orig_lhip_c0=cfn(-1,-1,0,-0,-0,-1,0,1,0,1,0,0)
  271.  
  272. rw_cf=r_shl_c0
  273. lw_cf=l_shl_c0
  274.  
  275. rw2_cf=r_hip_c0
  276. lw2_cf=l_hip_c0
  277. end
  278.  
  279. do ---ANIMATIONSYSTEM
  280. function Lock(which)
  281. arms={char:FindFirstChild'Right Arm',char:FindFirstChild'Left Arm'}
  282. legs={char:FindFirstChild'Right Leg',char:FindFirstChild'Left Leg'}
  283. local sh={torso:FindFirstChild'Right Shoulder',torso:FindFirstChild'Left Shoulder'}
  284. local sh2={torso:FindFirstChild'Right Hip',torso:FindFirstChild'Left Hip'}
  285. -- print(unpack(sh),unpack(arms))
  286. if arms and torso and sh and legs and sh2 then
  287. if which=='R'then
  288. if not rw then
  289. sh[1].Part1=nil
  290. rw=Instance.new('Weld')
  291. rw.Part0=torso
  292. rw.Parent=torso
  293. rw.Part1=arms[1]
  294. rw.C0=rw_cf
  295. rw.C1=r_shl_c1
  296. else
  297. rw:Destroy() rw=nil
  298. sh[1].Part0=torso sh[1].Part1=arms[1]
  299. end
  300. elseif which=='L'then
  301. if not lw then
  302. sh[2].Part1=nil
  303. lw=Instance.new('Weld')
  304. lw.Part0=torso
  305. lw.Parent=torso
  306. lw.Part1=arms[2]
  307. lw.C0=lw_cf
  308. lw.C1=l_shl_c1
  309. else
  310. lw:Destroy()lw=nil
  311. sh[2].Part0=torso sh[2].Part1=arms[2]
  312. end
  313. end
  314. if which=='RR'then
  315. if not rw2 then
  316. sh2[1].Part1=nil
  317. rw2=Instance.new('Weld')
  318. rw2.Part0=torso
  319. rw2.Parent=torso
  320. rw2.Part1=legs[1]
  321. rw2.C0=rw2_cf
  322. rw2.C1=r_hip_c1
  323. else
  324. rw2.Parent=nil rw2=nil
  325. sh2[1].Part0=torso sh2[1].Part1=legs[1]
  326. end
  327. elseif which=='LL'then
  328. if not lw2 then
  329. sh2[2].Part1=nil
  330. lw2=Instance.new('Weld')
  331. lw2.Part0=torso
  332. lw2.Parent=torso
  333. lw2.Part1=legs[2]
  334. lw2.C0=lw2_cf
  335. lw2.C1=l_hip_c1
  336. else
  337. lw2.Parent=nil lw2=nil
  338. sh2[2].Part0=torso sh2[2].Part1=legs[2]
  339. end
  340. end
  341. end
  342. end
  343.  
  344. function Anim(what)
  345. local weld=getfenv()[what]
  346. return function(where)
  347. if weld then
  348. target_pos[what]=def_pos[what]*where
  349. -- waitfor(weld,where)
  350. end
  351. end
  352. end
  353.  
  354. char_hum=getHum(char)
  355.  
  356. spd={
  357. rw=.1;lw=.1;rw2=.1;lw2=.1;torw=.1;neck=.1;hw=.1;
  358. }
  359. setmetatable(spd,{
  360. __newindex=function(tab,i,v)
  361. if i=='all'then
  362. for o,q in pairs(spd)do
  363. spd[o]=v
  364. end
  365. end end
  366. })
  367. def_pos={
  368. rw=rw_cf;
  369. lw=lw_cf;
  370. rw2=rw2_cf;
  371. lw2=lw2_cf;
  372. torw=ort;
  373. neck=norig;
  374. hw=cfn();
  375. -- shield_w=cfn(-.25,0,0)*ang(math.pi,math.pi/2);
  376. }
  377. target_pos={
  378. rw=rw_cf;
  379. lw=lw_cf;
  380. rw2=def_pos.rw2;
  381. lw2=def_pos.lw2;
  382. torw=def_pos.torw;
  383. neck=def_pos.neck;
  384. hw=cfn();
  385. }
  386. can_anim={
  387. rw=true;lw=true;rw2=true;lw2=true;torw=true;neck=true;
  388. }
  389. game:service'RunService':BindToRenderStep('Mug_Anims',5,function()
  390. if cont_anim then
  391. if rw and can_anim.rw then
  392. rw.C0=rw.C0:lerp(target_pos.rw,spd.rw)
  393. end
  394. if lw and can_anim.lw then
  395. lw.C0=lw.C0:lerp(target_pos.lw,spd.lw)
  396. end
  397. if rw2 and can_anim.rw2 then
  398. rw2.C0=rw2.C0:lerp(target_pos.rw2,spd.rw2)
  399. end
  400. if lw2 and can_anim.lw2 then
  401. lw2.C0=lw2.C0:lerp(target_pos.lw2,spd.lw2)
  402. end
  403. if torw and can_anim.torw then
  404. torw.C0=torw.C0:lerp(target_pos.torw,spd.torw)
  405. end
  406. if neck and can_anim.neck then
  407. neck.C0=neck.C0:lerp(target_pos.neck,spd.neck)
  408. end
  409. if hw then
  410. hw.C1=hw.C1:lerp(target_pos.hw,spd.hw)
  411. end
  412. end
  413. end)
  414. end
  415.  
  416. function tag(a,b)
  417. if type(b)=='string'then
  418. if not getfenv()[b]then
  419. getfenv()[b]={}
  420. end
  421. table.insert(getfenv()[b],a)
  422. else
  423. table.insert(b,a)
  424. end
  425. end
  426. hinge=Part(.25,.5,.25)Mesh(hinge,1)
  427. hw=Weld(hinge,torso,.9,-.85,0,0,-math.pi/2,math.pi/2)
  428. restpos=hw.C0
  429.  
  430. d=Part(.1,.1,.1,'Black')Weld(d,hinge,0,.25)Mesh(d,1,1,.1)
  431. d=Part(.1,.1,.1,'Black')Weld(d,hinge,0,-.25)Mesh(d,1,1,.1)
  432.  
  433. p=Part(.75,.5,.1)Mesh(p,3,1,1,.75)
  434. Create'Motor'{_P=p;Part0=p;Part1=hinge;
  435. C0=cfn(.75/2,0,0)*ang(math.pi/2);
  436. C1=cfn(0,0,0)*ang(math.pi/2);
  437. MaxVelocity=.1
  438. }
  439.  
  440. p=Part(.75,.5,.1)Mesh(p,3,1,1,.5)
  441. mo=Create'Motor'{_P=p;Part0=p;Part1=hinge;
  442. C0=cfn(-.75/2,0,0)*ang(-math.pi/2,0);
  443. C1=cfn(0,0,-.15/2)*ang(-math.pi/2,0,md'45'+md'135');
  444. MaxVelocity=.15
  445. }
  446.  
  447. local tas={}
  448.  
  449. Spawn(function()
  450. while wait()do
  451. for e,o in ipairs(tas)do
  452. if o[2].Parent~=nil then
  453. o[1]=o[1]*ang(0,md'5')
  454. for i,v in ipairs(o[2]:children())do
  455. if v:IsA'Part'then
  456. v.CFrame=l(o[1],math.cos(i*m.tau/6)*o[2].MVal.Value,0,math.sin(i*m.tau/6)*o[2].MVal.Value)
  457. end
  458. end
  459. else
  460. table.remove(tas,e)
  461. end
  462. end
  463. end
  464. end)
  465. whirr_snd=Create'Sound'{_P=Weapn;SoundId='rbxassetid://278329638';Pitch=1.5;Volume=1}
  466. droning_snd=Create'Sound'{_P=Weapon;SoundId='rbxassetid://275641634';Pitch=1.75;Volume=.1;Looped=true}
  467. function lol()
  468. Lock'R'
  469.  
  470. whirr_snd:Play()
  471. Anim'rw'(ang(md'75')*ang(0,md'90'))
  472. hw.Part0=rarm hw.C0=cfn(0,-1.1,0)*ang(-math.pi/2,md'25')
  473. mo.DesiredAngle=md'-135'
  474. wait'.25'
  475. cone=Part(1,1,1,'Cyan',.5)msh=Mesh(cone,'Spike',0,0,0)
  476. w=Weld(cone,p,0,0,0,math.pi/2)
  477. for i=0,1,.1 do
  478. w.C0=cfn(0,0,-1.75*i)*ang(math.pi/2)
  479. msh.Scale=v3n(i*.75,i*4.5,i*.75)
  480. wait()
  481. end
  482. wait()
  483. local obj,pos=Workspace:FindPartOnRay(Ray.new(l(cone).p,v3n(0,-10,0)),char)
  484. if obj and pos then
  485. local r=.75
  486. local ps={}
  487. local center=cfn(pos)
  488. local model=Create'Model'{_P=Weapon}
  489. for i=0,m.tau,m.tau/6 do
  490. local p=Part(.1,.1,.1) p.Anchored=true Mesh(p,2).Name='m'
  491. p.Color=Color3.new(HSVtoRGB(0,0,1))
  492. p.Parent=model
  493. p.CFrame=l(center,math.cos(i)*r,0,math.sin(i)*r)
  494.  
  495. end
  496. local rv=Create'NumberValue'{_P=model;Name='MVal'}rv.Value=r
  497. local t={center,model}
  498. local snd=Create'Sound'{_P=model;SoundId='http://www.roblox.com/Asset/?id=15666462';
  499. Pitch=.5;Looped=true}
  500. local snd2=Create'Sound'{_P=model;SoundId='http://www.roblox.com/Asset/?id=2101157';Pitch=1.15}
  501. local snd3=Create'Sound'{_P=model;SoundId='http://www.roblox.com/Asset/?id=2974249';Pitch=2}
  502.  
  503. Edit{snd,snd2,snd3}{Volume=.25}
  504.  
  505. Spawn(function()
  506. snd:Play()
  507. local ptick=tick()
  508. repeat
  509. snd.Pitch=snd.Pitch+(.05*3)
  510. wait()
  511. until (tick()-ptick)>1
  512. snd:Stop()snd3:Play()
  513. for i=0,1,.1 do
  514. for _,v in pairs(model:children())do
  515. if v:IsA'Part'then
  516. -- v.Transparency=i
  517. v.Color=Color3.new(HSVtoRGB(.5,0,1-i))
  518. end
  519. end
  520. wait()
  521. end
  522. snd2:Play()
  523. for i=0,1,.05 do
  524. rv.Value=rv.Value+.5
  525. local pillar=Part(rv.Value,1,rv.Value,'Black',.75)local msh=Mesh(pillar,1)pillar.Anchored=true
  526. local cf=center*ang(mr(-5,5),mr(-5,5),mr(-5,5))
  527. pillar.CFrame=cf
  528. Spawn(function()
  529. for i=0,1,.1 do
  530. pillar.Size=v3n(rv.Value,10*i,rv.Value)
  531. pillar.CFrame=cf*cfn(0,pillar.Size.y/2,0)
  532. pillar.Transparency=.75+i*(1-.75)
  533. wait()
  534. end
  535. end)
  536. for _,v in pairs(model:children())do
  537. if v:IsA'Part'then
  538. v.Transparency=i
  539. v.m.Scale=v3n(1+i*30,1+i*30,1+i*30)
  540. -- v.Color=Color3.new(HSVtoRGB(0,.5,1-i*.5))
  541. end
  542. end
  543. for i,v in pairs(findHum(center.p,rv.Value))do
  544. v:TakeDamage'10'
  545. end
  546. wait()
  547. end
  548. model:Destroy()
  549. end)
  550. table.insert(tas,t)
  551. end
  552. wait(.15)
  553. for i=1,0,-.1 do
  554. w.C0=cfn(0,0,-1.75*i)*ang(math.pi/2)
  555. msh.Scale=v3n(i*.75,i*4.5,i*.75)
  556. wait()
  557. end cone:destroy()
  558. whirr_snd:Play()
  559. Anim'rw'(cfn())
  560. mo.DesiredAngle=0
  561. wait'.25'
  562. hw.Part0=torso hw.C0=cfn(.9,-.85,0)*ang(0,-math.pi/2,math.pi/2)
  563. Lock'R'
  564. end
  565.  
  566. local pd_snd=Create'Sound'{_P=Weapon;SoundId='http://www.roblox.com/Asset/?id=2785493';Pitch=1.35}
  567. function lol2()
  568. Lock'R'
  569. Anim'rw'(ang(md'135',0,md'15')*ang(0,md'15'))
  570. hw.Part0=rarm hw.C0=cfn(0,-1.1,0)*ang(math.pi,md'-10')
  571. wait'.15'
  572. mo.DesiredAngle=md'-90'
  573. wait'.5'
  574. local laz=Part(.5,1,.5,'Cyan',.5)laz.Material='Neon'local msh=Mesh(laz,2)
  575. pd_snd:Play()
  576.  
  577. laz.Anchored=true
  578. spos=l(hinge,0,0)
  579. laz.CFrame=spos
  580.  
  581. local ignorelist={}
  582. for i=0,1,.25 do spos=l(hinge,0,0)
  583. table.insert(ignorelist,char)
  584. local hit,pos=Workspace:FindPartOnRayWithIgnoreList(Ray.new(l(laz,0,0,-laz.Size.z/2).p,l(laz).lookVector*4),ignorelist)
  585. if hit and pos then
  586. for lo=1,1 do
  587. if hit:IsDescendantOf(char)then break end
  588. local sx,sy,sz=hit.Size.X,hit.Size.y,hit.Size.z
  589. local as=(sx+sy+sz)/3
  590. if as>20 then break end
  591. table.insert(ignorelist,hit)
  592. Create'ParticleEmitter'{_P=hit;
  593. Size=NumberSequence.new{numkp(0,as*.1);numkp(1,as*.5)};
  594. Transparency=NumberSequence.new{numkp(0,0);numkp(1,1)};
  595. Color=ColorSequence.new(bcol'Cyan'.Color,bcol'Deep blue'.Color);
  596. Lifetime=NumberRange.new(.1,.4);
  597. VelocitySpread=360;
  598. Speed=NumberRange.new(as*.5);
  599. }
  600. Spawn(function()
  601. for i=hit.Transparency,1,.05 do
  602. hit.Transparency=i wait()
  603. end hit:Destroy()end)
  604. end
  605. end
  606.  
  607. tpos=l(torso,0,0,-7)
  608. local mag=(spos.p-tpos.p).magnitude
  609. laz.Size=v3n(.5,.5,mag*i)
  610. laz.CFrame=cfn(spos.p,tpos.p)*cfn(0,0,(-mag/2)*i)
  611. wait()
  612. end
  613. local cf=laz.CFrame
  614. for i=0,1,.1 do
  615. msh.Scale=v3n(1-i,1-i,1)
  616. laz.Transparency=.5+i*.5
  617. wait()
  618. end laz:Destroy()
  619. mo.DesiredAngle=0
  620. wait'.25'
  621. Anim'rw'(cfn())
  622. wait'.25'
  623. hw.Part0=torso hw.C0=restpos
  624. Lock'R'
  625. end
  626.  
  627. shoot_snd=Create'Sound'{_P=Weapon;SoundId='rbxassetid://384105511';Pitch=1.15}
  628. function kiball()
  629. holding=true
  630. local ptick=tick()
  631. local bg=Create'BodyGyro'{_P=torso;maxTorque=v3n(1,1,1)*9e+008;P=9e+006}
  632. Lock'L'Anim'lw'(ang(0,0,md'-90'))wait'.25'
  633. while holding do
  634. bg.cframe=cfn(l(torso).p,v3n(mouse.hit.x,l(torso).y,mouse.hit.z))*ang(0,-math.pi/2,0)
  635.  
  636. if (tick()-ptick)>.25 then shoot_snd:Play()
  637. local ki=Part(1,1,1)ki.Anchored=true ki.CFrame=l(bl) local msh=Mesh(ki,3)
  638. tar=mouse.hit
  639. local dir=mr(-1,1)
  640. Spawn(function()
  641. for i=0,1,.1 do
  642. ki.CFrame=ki.CFrame*cfn(-math.abs(math.sin((tick()+1)))*3,0,0)
  643. ki.CFrame=ki.CFrame:lerp(tar,i)
  644. wait()
  645. end
  646. for i=0,1,.1 do
  647. Edit{msh,ki}{Transparency=i;Size=v3n(1+i*3,1+i*3,1+i*3)}
  648. wait()
  649. end ki:destroy()
  650. end)
  651. ptick=tick()
  652. end
  653. wait()
  654. end bg:Destroy() Anim'lw'(cfn())wait'.5'Lock'L'
  655. end
  656.  
  657. function getAverageSize(val)
  658. local value_is_object=pcall(function()return val.className end)
  659. local x,y,z
  660. if value_is_object then
  661. x,y,z=val.Size.x,val.Size.y,val.Size.z
  662. else
  663. x,y,z=val.x,val.y,val.z
  664. end
  665. return (x+y+z)/3
  666. end
  667.  
  668. bl=Part(.1,.1,.1,'New Yeller')Mesh(bl,2)Weld(bl,larm,-.25,-.6)
  669. function lol3()
  670. Lock'L'
  671. Anim'lw'(cfn(.2,0,-.15)*ang(md'25',0,md'65')*ang(0,md'-75'))
  672. wait'.25'bl.Material='Neon'
  673. local shield=Part(5,5,.1,'New Yeller',.75)shield.Material='Neon'shield.Anchored=true
  674. shield.CanCollide=true
  675. -- shield.Parent=Workspace.CurrentCamera
  676. shield.Touched:connect(function(a)
  677. if a.Parent and (not a:IsDescendantOf(char)) then
  678. -- a:BreakJoints()
  679. for i,v in pairs(a:children())do
  680. if v:IsA'BodyMover'then v:Destroy()end
  681. end
  682.  
  683. end
  684. end)
  685.  
  686. local msh=Mesh(shield,3,0,0,0)
  687. shield.CFrame=l(torso)
  688. droning_snd:Play()
  689. for i=0,1,.1 do
  690. shield.CFrame=shield.CFrame:lerp(l(torso,0,0,-3),.8)
  691. shield.Velocity=shield.CFrame.lookVector*400
  692. msh.Scale=v3n(i,i,i)
  693. wait()
  694. end
  695. holding=true
  696. local ptick=tick()
  697. local dir=1
  698. local bol=false
  699.  
  700. while holding do
  701. if (tick()-ptick)>.5 then dir=dir*-1 ptick=tick()end
  702. shield.Transparency=shield.Transparency+dir*.005
  703. shield.CFrame=shield.CFrame:lerp(l(torso,0,0,-3),.8)
  704. shield.Velocity=shield.CFrame.lookVector*400
  705. local pp=Part(.1,.1,.1,'New Yeller',.75)pp.Material='Neon'Mesh(pp,3,.5,.5,.5)
  706. pp.CFrame=l(bl)
  707. Create'BodyPosition'{_P=pp;position=l(shield,mr(-2.5,2.5),mr(-2.5,2.5),0).p}
  708. Debris:AddItem(pp,.4)
  709.  
  710. wait()
  711. end
  712. droning_snd:Stop()
  713. for i=1,0,-.1 do
  714. shield.CFrame=shield.CFrame:lerp(l(torso,0,0,-3),.8)
  715. msh.Scale=v3n(i,i,i)
  716. wait()
  717. end
  718. shield:Destroy()
  719. bl.Material='Plastic'
  720. Anim'lw'(cfn())
  721. wait'.25'Lock'L'
  722. end
  723.  
  724. klist={
  725. f=lol2;
  726. e=lol;
  727. cq=lol3;
  728. rq=kiball;
  729. }
  730.  
  731. local con,con2
  732. con=mouse.KeyUp:connect(function(key)
  733. for i,v in pairs(klist)do
  734. if key==i:sub(1,1) and i:sub(2,2)=='q'then
  735. holding=false
  736. end
  737. end
  738. end)
  739. con2=mouse.KeyDown:connect(function(key)
  740. if attacking then return end
  741. attacking=true
  742. for i,v in pairs(klist)do
  743. if key==i:sub(1,1) then
  744. v()
  745. end
  746. end
  747. attacking=false
  748. end)
  749. tag(con,'cons')tag(con2,'cons')
  750.  
  751. char.ChildAdded:connect(function(a)
  752. if a:IsA'Script'then for i,v in pairs(cons)do v:disconnect()end end end)
Add Comment
Please, Sign In to add comment