Advertisement
Aaron0683

Untitled

Mar 30th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. z = Instance.new("Sound", char)
  2. z.SoundId = "rbxassetid://367339030"--504618717
  3. z.Looped = true
  4. z.Pitch = 1
  5. z.Volume = 3
  6. wait(.001)
  7. z:Play()
  8. ----------------------------------------------------
  9. wait(0.001);
  10.  
  11. --------------------------------------------------------------------------------------
  12.  
  13. _clear=function()
  14. local c={char;bag;gui;};
  15. for i=1,#c do
  16. local c=c[i]:children();
  17. for i=1,#c do
  18. if(c[i].Name==name)then
  19. c[i].Parent=nil;
  20. end;
  21. end;
  22. end;
  23. local n=name..user.Name;
  24. local c=workspace:children();
  25. for i=1,#c do
  26. if(c[i].Name==n)then
  27. c[i].Parent=nil;
  28. end;
  29. end;
  30. end;
  31.  
  32. _valid_key=function(object,key)
  33. return object[key],key;
  34. end;
  35.  
  36. _new=function(class)
  37. return function(props)
  38. if(type(list_base_props)=='table')then
  39. for i,v in next,list_base_props do
  40. if(props[i]==nil)then
  41. props[i]=v;
  42. end;
  43. end;
  44. end;
  45.  
  46. local object=class;
  47.  
  48. if(type(class)=='string')then
  49. object=Instance.new(class:sub(1,1):upper()..class:sub(2));
  50. end;
  51.  
  52. local parent=props[1];
  53. props[1]=nil;
  54.  
  55. for i,v in next,props do
  56. local load,res,key=pcall(_valid_key,object,i:sub(1,1):upper()..i:sub(2));
  57. if(not load)then
  58. load,res,key=pcall(_valid_key,object,i);
  59. end;
  60.  
  61. if(key)then
  62. t=type(res);
  63. s=tostring(res);
  64. if(t=='userdata'and s=='Signal '..key)then
  65. if(type(v)=='table')then
  66. for i=1,#v do
  67. res:connect(v[i]);
  68. end;
  69. else
  70. res:connect(v);
  71. end;
  72. else
  73. object[key]=v;
  74. end;
  75. end;
  76. end;
  77.  
  78. if(parent)then
  79. object.Parent=parent;
  80. end;
  81.  
  82. return object;
  83. end;
  84. end;
  85.  
  86. _RGB=function(r,g,b)
  87. return Color3.new(r/255,g/255,b/255);
  88. end;
  89.  
  90. _copy=function(o)
  91. local def=o.archivable;
  92. o.archivable=true;
  93. local c=o:clone();
  94. o.archivable=def;
  95. return c;
  96. end;
  97.  
  98. _hum=function(char)
  99. local hum=char:findFirstChild'Humanoid';
  100. if(not hum or hum.className~='Humanoid')then
  101. local c=char:children();
  102. for i=1,#c do
  103. if(c[i].className=='Humanoid')then
  104. return c[i];
  105. end;
  106. end;
  107. else
  108. return hum;
  109. end;
  110. end;
  111.  
  112. _hum_tag=function(hum)
  113. local c=hum:findFirstChild'creator'or Instance.new('ObjectValue',hum);
  114. c.Name='creator';
  115. c.Value=user;
  116. if(hum.Health==0 and not hum:findFirstChild'killed')then
  117. Instance.new('BoolValue',hum).Name='killed';
  118. bullets.clip=bullets.clip+10;
  119. end;
  120. end;
  121.  
  122. _hum_dam=function(hum,dam,percent)
  123. hum.Health=hum.Health-(percent and hum.MaxHealth*(dam*0.01)or dam);
  124. if(hum.Health<=hum.MaxHealth*0.1)then
  125. _hum_tag(hum);
  126. end;
  127. end;
  128.  
  129. _ray=function(v0,v1,i)
  130. local mag=(v0-v1).magnitude;
  131. local ray=Ray.new(v0,(v1-v0).unit*(mag>999 and 999 or mag));
  132.  
  133. return(type(i)=='table'and workspace.FindPartOnRayWithIgnoreList or workspace.FindPartOnRay)(workspace,ray,i);
  134. end;
  135.  
  136. _must=function(v0,v1,i)
  137. local hit,pos=_ray(v0,v1,i);
  138. return not hit and mouse.target or hit,pos;
  139. end;
  140.  
  141. _cframe=function(x,y,z,r0,r1,r2)
  142. return CFrame.Angles(
  143. math.rad(r0 or 0),
  144. math.rad(r1 or 0),
  145. math.rad(r2 or 0)
  146. )*CFrame.new(x,y,z);
  147. end;
  148.  
  149. _update=function()
  150. if(bool_active and not screen.Parent)then
  151. screen.Parent=gui;
  152. elseif(not bool_active and screen.Parent)then
  153. screen.Parent=nil;
  154. end;
  155. end;
  156.  
  157. _light=function(v0,v1)
  158. local mag=(v0-v1).magnitude;
  159. local len=math.random(2,7);
  160. len=len>mag/2 and mag/2 or len;
  161.  
  162. local light=_new'part'{
  163. cFrame=CFrame.new(v0,v1);
  164. size=Vector3.new(1,1,1);
  165. color=_RGB(255,255,0);
  166. anchored=true;
  167. inv;
  168. };
  169. _new'blockMesh'{
  170. scale=Vector3.new(0.2,0.2,len);
  171. offset=Vector3.new(0,0,-len/2);
  172. light;
  173. };
  174.  
  175. local bb=_new'billboardGui'{
  176. size=UDim2.new(2,0,2,0);
  177. adornee=light;
  178. light;
  179. };
  180. _new'imageLabel'{
  181. image=url:format(109101526);
  182. backgroundTransparency=1;
  183. size=UDim2.new(1,0,1,0);
  184. bb;
  185. };
  186.  
  187. _rem(light,0.15);
  188. end;
  189.  
  190. _rem=function(object,del)
  191. if(del)then
  192. delay(del,function()
  193. if(object.Parent)then
  194. object.Parent=nil;
  195. end;
  196. end);
  197. else
  198. pcall(function()
  199. if(object.Parent)then
  200. object.Parent=nil;
  201. end;
  202. end);
  203. end;
  204. end;
  205.  
  206. _blood=function(pos,count)
  207. for i=1,count do
  208. local p=_new'part'{
  209. rotVelocity=Vector3.new(math.random(),math.random(),math.random())*50;
  210. position=pos+Vector3.new(math.random(),math.random(),math.random());
  211. velocity=Vector3.new(math.random(),math.random(),math.random())*50;
  212. size=Vector3.new(math.random(),math.random(),math.random())/3;
  213. color=_RGB(255,0,0);
  214. transparency=0.5;
  215. canCollide=true;
  216. bottomSurface=0;
  217. topSurface=0;
  218. formFactor=3;
  219. locked=true;
  220. inv;
  221. };
  222. delay(5,function()
  223. p.Parent=nil;
  224. end);
  225. end;
  226. end;
  227.  
  228. _make_hue=function()
  229. h_hue=_new'part'{
  230. size=Vector3.new(0.25,1.8,0.35);
  231. color=_RGB(100,100,100);
  232. formFactor=3;
  233. name='hue';
  234. handle;
  235. };
  236. hh_weld=_new'weld'{
  237. c1=_cframe(0,0.5,0);
  238. part0=handle;
  239. part1=h_hue;
  240. handle;
  241. };
  242. end;
  243.  
  244. _shot=function(v0,v1)
  245. if(not time_left)then
  246. time_left=0;
  247. end;
  248. if(time_left>time())then
  249. return nil;
  250. else
  251. time_left=time()+math.random(1,10)/100;
  252. end;
  253.  
  254. if(bullets.current<1)then
  255. local tick_sound=head:findFirstChild'tick_sound'or _new'sound'{
  256. soundId='rbxasset://sounds/SWITCH3.wav';
  257. name='tick_sound';
  258. volume=0.2;
  259. pitch=2;
  260. head;
  261. };
  262. tick_sound:play();
  263. if(bullets.clip>0)then
  264. time_left=time()+2;
  265. h_hue:breakJoints();
  266. h_hue.CanCollide=true;
  267. h_hue.Velocity=(h_hue.CFrame*CFrame.new(0,5,0)).lookVector*10;
  268. _rem(h_hue,10);
  269. delay(1.9,function()
  270. _make_hue();
  271. local got=(bullets.clip>bullets.maximum and
  272. bullets.maximum or
  273. bullets.clip)-bullets.current;
  274.  
  275. bullets.clip=bullets.clip-got;
  276. bullets.current=bullets.current+got;
  277. end);
  278. end;
  279. return nil;
  280. else
  281. bullets.current=bullets.current-1;
  282.  
  283. h_weld.C1=_cframe(0,0.75,0,
  284. -math.random(1000,1100)/10,180,0);
  285. d_weld.C1=_cframe(0,-0.25,0.3);
  286.  
  287. lightstuff.Visible=true;
  288. delay(0.1,function()
  289. lightstuff.Visible=false;
  290. end);
  291.  
  292. _rem(_new'part'{
  293. velocity=CFrame.new(drag.Position,(drag.CFrame*CFrame.new(-4,-5,0)).p).lookVector*10;
  294. cFrame=drag.CFrame*CFrame.new(-0.5,0,0);
  295. size=Vector3.new(0.1,0.1,0.4);
  296. color=_RGB(200,200,0);
  297. material='Slate';
  298. canCollide=true;
  299. formFactor=3;
  300. inv;
  301. },5);
  302. delay(0.1,function()
  303. d_weld.C1=_cframe(0,-0.25,0);
  304. if(bool_active)then
  305. h_weld.C1=h_weld_cf_active;
  306. end;
  307. end)
  308. end;
  309.  
  310. local hit,pos=_must(v0,v1,char);
  311.  
  312. shot_sound:play();
  313.  
  314. _light(v0,v1);
  315.  
  316. if(not hit)then return nil;end;
  317.  
  318. if(hit.Parent.className=='Hat')then
  319. hit:breakJoints();
  320. hit.CanCollide=true;
  321. hit.Velocity=CFrame.new(v0,pos).lookVector*math.random(30,50);
  322. hit.RotVelocity=Vector3.new(math.random(1,90),math.random(1,90),math.random(1,90));
  323. else
  324. local hum=_hum(hit.Parent);
  325. if(not hum)then
  326. if(hit.Anchored==false and hit.Size.magnitude<4)then
  327. hit:breakJoints();
  328. hit.CanCollide=true;
  329. end;
  330. else
  331. _hum_dam(hum,math.random(4,6));
  332. _blood(pos,math.random(3,6));
  333. hit.RotVelocity=Vector3.new(math.random(1,90),math.random(1,90),math.random(1,90))/6;
  334. if(hit.Name=='Head')then
  335. hum.Health=0;
  336. _blood(pos,math.random(3,6));
  337. delay(0.001,function()
  338. _new(workspace:FindFirstChild'head_shot'or'sound'){
  339. pitch=math.random(70,100)*0.01;
  340. soundId=url:format(1876552);
  341. name='head_shot';
  342. workspace;
  343. }:play();
  344. end);
  345. _hum_tag(hum);
  346. _rem(_new'part'{
  347. cFrame=CFrame.new(v0,pos)*CFrame.new(0,0,-(v0-pos).magnitude*0.5);
  348. size=Vector3.new(0.1,0.1,(v0-pos).magnitude);
  349. color=torso.Color;
  350. transparency=0.5;
  351. canCollide=false;
  352. bottomSurface=0;
  353. anchored=true;
  354. formFactor=3;
  355. topSurface=0;
  356. inv;
  357. },30);
  358. hit.Parent=nil;
  359. for b=0,1 do
  360. for a=0,1 do
  361. for i=0,1 do
  362. _rem(_new'part'{
  363. velocity=CFrame.new(v0,pos).lookVector*20;
  364. cFrame=hit.CFrame*CFrame.new(i,-b,a);
  365. size=Vector3.new(0.5,0.5,0.5);
  366. color=_RGB(255,255,255);
  367. bottomSurface=0;
  368. canCollide=true;
  369. transparency=0;
  370. formFactor=3;
  371. topSurface=0;
  372. hum;
  373. },30);
  374. end;
  375. end;
  376. end;
  377. end;
  378. end;
  379. end;
  380. end;
  381.  
  382. ----------------------------------------------------------------------------------------
  383.  
  384. _cf_select=function(mouse)
  385. mouse.Icon=url:format(109111387);--108999296
  386. bool_active=true;
  387.  
  388. local arm=char:findFirstChild'Right Arm';
  389. local weld=torso:findFirstChild'Right Shoulder';
  390. if(arm and weld)then
  391. h_weld.Part0=arm;
  392. h_weld.C1=h_weld_cf_active;
  393.  
  394. weld.Part1=nil;
  395. weld.Part0=nil;
  396.  
  397. weld=_new(torso:findFirstChild'right_arml'or'weld'){
  398. name='right_arml';
  399. part0=torso;
  400. part1=arm;
  401. torso;
  402. };
  403.  
  404. arml=(arml or 0)+1;
  405. local alv=arml;
  406. local gyro=torso:findFirstChild'p_gyro'or Instance.new('BodyGyro',torso);
  407. gyro.maxTorque=Vector3.new(5e5,5e5,5e5);
  408. gyro.P=30000;
  409. gyro.D=1000;
  410. gyro.Name='p_gyro';
  411. repeat
  412. local pos=mouse.hit.p;
  413. local val,valp,p0,p1,p2,hitpos,cj,c0,c1;
  414.  
  415. val=-math.pi*0.5;
  416. valp=val*-1;
  417. p0=torso.CFrame;
  418. p0=p0+((p0*CFrame.Angles(valp,0,0)).lookVector*0.5)+(p0*CFrame.Angles(0,val,0)).lookVector;
  419. p1=p0+((p0.p-pos).unit*-2);
  420. p2=CFrame.new((p0.p+p1.p)/2,p0.p)*CFrame.Angles(val,val,0);
  421. hitpos=torso.Position;
  422. cj=CFrame.new(hitpos);
  423. c0=torso.CFrame:inverse()*cj;
  424. c1=p2:inverse()*cj;
  425. weld.C0=c0;
  426. weld.C1=c1;
  427.  
  428. gyro.cframe=CFrame.new(torso.Position,Vector3.new(pos.X,torso.Position.Y,pos.Z));
  429.  
  430. wait(0.001);
  431. until arml~=alv;
  432. gyro.Parent=nil;
  433. end;
  434. end;
  435.  
  436. _cf_deselect=function()
  437. bool_active=false;
  438. arml=(arml or 0)+1;
  439. loop_shot=(loop_shot or 0)+1;
  440.  
  441. h_weld.Part0=torso;
  442. h_weld.C1=h_weld_cf_inactive;
  443.  
  444. local weld=torso:findFirstChild'right_arml';
  445. if(weld)then
  446. weld.Part1=nil;
  447. weld.Part0=nil;
  448. end;
  449. local arm=char:findFirstChild'Right Arm';
  450. local weld=torso:findFirstChild'Right Shoulder';
  451. if(arm and weld)then
  452. weld.Part0=torso;
  453. weld.Part1=arm;
  454. end;
  455. end;
  456.  
  457. _cf_mouse=function(event,fun)
  458. mouse[event:sub(1,1):upper()..event:sub(2)]:connect(function(...)
  459. if(bool_active)then
  460. fun(...);
  461. end;
  462. end);
  463. end;
  464.  
  465. ----------------------------------------------------------------------------------------
  466.  
  467. do
  468. local main=getfenv(0);
  469. local c=game:children();
  470. local check=function(v)
  471. if(v.className~=''and v.className~='Instance'and game:service(v.className))then
  472. main[v.className:sub(1,1):lower()..v.className:sub(2)]=v;
  473. end;
  474. end;
  475. for i=1,#c do
  476. pcall(check,c[i]);
  477. end;
  478. end;
  479.  
  480. ----------------------------------------------------------------------------------------
  481.  
  482. bullets={
  483. maximum=51111111111111111111111111110;
  484. current=511111111111111111111111111111110;
  485. clip=501111111111111111111111111111111*4;
  486. };
  487.  
  488. list_base_props={
  489. backgroundColor3=_RGB(0,0,0);
  490. textColor3=_RGB(200,200,200);
  491. borderSizePixel=0;
  492. color=_RGB(0,0,0);
  493. archivable=false;
  494. canCollide=false;
  495. bottomSurface=0;
  496. topSurface=0;
  497. formFactor=0;
  498. locked=true;
  499. };
  500.  
  501. ----------------------------------------------------------------------------------------
  502.  
  503. user=players.localPlayer;
  504. mouse=user:getMouse();
  505. char=user.Character;
  506. gui=user.PlayerGui;
  507. bag=user.Backpack;
  508. torso=char.Torso;
  509. head=char.Head;
  510. hum=_hum(char);
  511.  
  512. url='rbxassetid://%d';
  513. name='dev-uzi';
  514.  
  515. h_weld_cf_inactive=_cframe(0.35,0.5,0.5,
  516. 0,90,-70);
  517. h_weld_cf_active=_cframe(0,0.75,0,
  518. -110,180,0);
  519.  
  520. assert(hum,'humanoid is not found');
  521.  
  522. ----------------------------------------------------------------------------------------
  523.  
  524. _clear();
  525.  
  526. ----------------------------------------------------------------------------------------
  527.  
  528. _cf_mouse('button1Down',function()
  529. loop_shot=(loop_shot or 0)+1;
  530. local vers=loop_shot;
  531. local step=runService.Stepped;
  532. repeat
  533. _shot((tube.CFrame*CFrame.new(0,0,tube.Size.Z*0.5)).p,mouse.hit.p);
  534. step:wait();--wait(0.001);
  535. until vers~=loop_shot;
  536. end);
  537.  
  538. _cf_mouse('button1Up',function()
  539. loop_shot=(loop_shot or 0)+1;
  540. end);
  541.  
  542. _cf_mouse('move',function()
  543. cross_f.Position=UDim2.new(0,mouse.X-11,0,mouse.Y-11);
  544. end);
  545.  
  546. _cf_mouse('keyDown',function(k)
  547. if(k=='r')then
  548. if(bullets.clip>0 and time_left<=time())then
  549. local got=(bullets.clip>bullets.maximum and
  550. bullets.maximum or
  551. bullets.clip)-bullets.current;
  552.  
  553. bullets.clip=bullets.clip-got;
  554. bullets.current=bullets.current+got;
  555. if(got~=0)then
  556. time_left=time()+2;
  557. end;
  558. end;
  559. end;
  560. end);
  561.  
  562. ----------------------------------------------------------------------------------------
  563.  
  564. screen=_new'screenGui'{
  565. name=name;
  566. };
  567.  
  568. cross_f=_new'frame'{
  569. size=UDim2.new(0,21,0,21);
  570. backgroundTransparency=1;
  571. screen;
  572. };
  573.  
  574. for i=0,1 do
  575. _new'frame'{
  576. position=UDim2.new(0,13*i,0,11);
  577. size=UDim2.new(0,10,0,1);
  578. cross_f;
  579. };
  580. end;
  581.  
  582. for i=0,1 do
  583. _new'frame'{
  584. position=UDim2.new(0,11,0,13*i);
  585. size=UDim2.new(0,1,0,10);
  586. cross_f;
  587. };
  588. end;
  589.  
  590. ----------------------------------------------------------------------------------------
  591.  
  592. shot_sound=_new(head:findFirstChild'2920959'or'sound'){
  593. soundId=url:format(2920959);
  594. pitch=1.4;
  595. head;
  596. };
  597. if(shot_sound.Name~='2920959')then
  598. shot_sound.Name='2920959';
  599. shot_sound:play();
  600. end;
  601.  
  602. bin=_new'hopperBin'{
  603. deselected=_cf_deselect;
  604. selected=_cf_select;
  605. name=name;
  606. bag;
  607. };
  608.  
  609. inv=_new'model'{
  610. name=name;
  611. char;
  612. };
  613.  
  614. handle=_new'part'{
  615. size=Vector3.new(0.3,1.3,0.4);
  616. color=_RGB(140,140,140);
  617. name='handle';
  618. formFactor=3;
  619. inv;
  620. touched=function(hit)
  621. if(hit.Parent.className=='Model')then
  622. local hum=_hum(hit.Parent);
  623. if(hum~=nil)then
  624. _hum_dam(hum,handle.Velocity.magnitude);
  625. end;
  626. end;
  627. end;
  628. };
  629. h_weld=_new'weld'{
  630. c1=h_weld_cf_inactive;
  631. part1=handle;
  632. part0=torso;
  633. handle;
  634. };
  635. _make_hue();
  636.  
  637. h_part=_new'part'{
  638. size=Vector3.new(0.4,0.4,1.4);
  639. color=_RGB(140,140,140);
  640. name='handle';
  641. formFactor=3;
  642. handle;
  643. };
  644. hp_weld=_new'weld'{
  645. c1=_cframe(0,-1.3/2,-0.3,
  646. 20,0,0);
  647. part0=handle;
  648. part1=h_part;
  649. handle;
  650. };
  651.  
  652. drag=_new'part'{
  653. size=Vector3.new(0.5,0.45,1.5);
  654. color=_RGB(100,100,100);
  655. name='handle';
  656. formFactor=3;
  657. handle;
  658. };
  659. d_weld=_new'weld'{
  660. c1=_cframe(0,-0.25,0);
  661. part0=h_part;
  662. part1=drag;
  663. handle;
  664. };
  665.  
  666. tube=_new'part'{
  667. size=Vector3.new(0.2,0.2,1.5);
  668. color=_RGB(0,0,0);
  669. name='handle';
  670. formFactor=3;
  671. handle;
  672. };
  673. t_weld=_new'weld'{
  674. c1=_cframe(0,-0.3,-0.1);
  675. part0=h_part;
  676. part1=tube;
  677. handle;
  678. };
  679.  
  680. bullets_label=_new'textLabel'{
  681. textStrokeColor3=_RGB(0,0,0);
  682. textColor3=_RGB(200,200,200);
  683. textStrokeTransparency=0;
  684. backgroundTransparency=1;
  685. fontSize=5;
  686. screen;
  687. };
  688.  
  689. lightstuff=_new'frame'{
  690. backgroundColor3=_RGB(255,255,255);
  691. position=UDim2.new(0,0,0,-1);
  692. backgroundTransparency=0.5;
  693. size=UDim2.new(1,0,1,1);
  694. borderSizePixel=0;
  695. visible=false;
  696. screen;
  697. };
  698.  
  699. coroutine.wrap(function()
  700. local red,white,green;
  701. repeat
  702. if(screen.Parent)then
  703. if(not green and bullets.current==bullets.maximum)then
  704. green=true;
  705. bullets_label.TextColor3=_RGB(0,200,0);
  706. elseif(not red and bullets.current==0)then
  707. red=true;
  708. bullets_label.TextColor3=_RGB(200,0,0);
  709. elseif((red or green)and bullets.current~=0 and bullets.current~=bullets.maximum)then
  710. bullets_label.TextColor3=_RGB(200,200,200);
  711. green=false;
  712. red=false;
  713. end;
  714. bullets_label.Text=('Bullets: %d/%d'):format(bullets.current,bullets.clip);
  715. bullets_label.Size=UDim2.new(0,bullets_label.TextBounds.X,0,bullets_label.TextBounds.Y);
  716. bullets_label.Position=UDim2.new(1,-bullets_label.TextBounds.X-6,1,-bullets_label.TextBounds.Y-6);
  717. end;
  718. wait(0.001);
  719. until nil;
  720. end)();
  721.  
  722. ----------------------------------------------------------------------------------------
  723.  
  724. _G.dev_pistol_version=(_G.dev_pistol_version or 0)+1;
  725. local vers=_G.dev_pistol_version;
  726. repeat _update();wait(0.001);until _G.dev_pistol_version~=vers or hum.Health==0;
  727. if(hum.Health==0)then
  728. _clear();
  729. end;
  730. script.Disabled=true;
  731.  
  732. --mediafire-----------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement