Advertisement
Guest User

Untitled

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