Advertisement
Guest User

Untitled

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