Advertisement
Chxp

Untitled

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