Advertisement
inspections

Untitled

May 20th, 2018
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.28 KB | None | 0 0
  1.  
  2. for i,v in next,game:children()do
  3. pcall(function()
  4. local c=v.className;
  5. rawset(getfenv(0),c:sub(1,1):lower()..c:sub(2),game:service(c));
  6. end);
  7. end;
  8.  
  9.  
  10. user=players.LocalPlayer;
  11. uname=user.Name;
  12. guis=user.PlayerGui;
  13. pack=user.Backpack;
  14.  
  15. keyDowns={};
  16. freeKeys={};
  17. shortcuts={};
  18.  
  19. _G.mine=_G.mine or{};
  20.  
  21. name='Draw3D';
  22. url='http://www.roblox.com/asset/?id=%d';
  23.  
  24. iconNormal=url:format(96578285);
  25. iconOnDown=url:format(96584484);
  26.  
  27. ver=0;
  28. drawPixel=0.10;
  29. _G.drawLimit=_G.drawLimit or 1000;
  30.  
  31. _G.drawColor=_G.drawColor or Color3.new();
  32.  
  33.  
  34.  
  35.  
  36.  
  37. destroy=game.remove;
  38. find=game.findFirstChild;
  39. new=Instance.new;
  40. with=function(c)
  41. return function(p)
  42. local o=type(c)=='string'and new(c)or c;
  43. local x=p.Parent;p.Parent=nil;
  44. for i,v in next,p do
  45. o[i]=v;
  46. end;
  47. if(x)then
  48. o.Parent=x;
  49. end;
  50. return o;
  51. end;
  52. end;
  53. getPlace=function()
  54. if(find(workspace,'draw')==nil)then
  55. new('Model',workspace).Name='draw';
  56. end;
  57. if(find(workspace.draw,uname)==nil)then
  58. new('Model',workspace.draw).Name=uname;
  59. end;
  60. return workspace.draw[uname];
  61. end;
  62. drawLine=function(start,target)
  63. local gui=with'BlockMesh'{
  64. Parent=with'Part'{
  65. CFrame=CFrame.new(start,target)*CFrame.new(0,0,-(start-target).magnitude/2);
  66. Size=Vector3.new(drawPixel,drawPixel,(start-target).magnitude+.325*drawPixel);
  67. Parent=getPlace();
  68. Color=_G.drawColor;
  69. BottomSurface=0;
  70. Anchored=true;
  71. TopSurface=0;
  72. formFactor=3;
  73. Name=name;
  74. }}.Parent;
  75. table.insert(_G.mine,gui);
  76. return gui;
  77. end;
  78. onDown=function()
  79. if(drawing)then
  80. return nil;
  81. end;
  82. if(selectGui.Adornee)then
  83. destroy(selectGui.Adornee);
  84. end;
  85.  
  86. drawing=true;
  87.  
  88. mouse.Icon=iconOnDown;
  89. ver=ver+1;
  90.  
  91.  
  92. local cVer,start,target=ver,mouse.hit.p;
  93.  
  94. local group={};
  95. repeat
  96. Wait(0.02);
  97.  
  98. if(mouse.target and mouse.target.Name~=name and mouse.hit.p~=start)then
  99.  
  100. target=mouse.hit.p;
  101.  
  102. table.insert(group,drawLine(start,target));
  103.  
  104. start=target;
  105. end;
  106. until ver~=cVer;
  107. drawing=false;
  108.  
  109. local groupM=new('Model',getPlace());
  110. for i,v in next,group do
  111. if(v:IsDescendantOf(Workspace))then
  112. v.Parent=groupM;
  113. end;
  114. end;
  115. if(next(groupM:children())==nil)then
  116. destroy(groupM);
  117. end;
  118. end;
  119. onUp=function()
  120. mouse.Icon=iconNormal;
  121. ver=ver+1;
  122. end;
  123. onKeyDown=function(k)
  124. if(freeKeys[k]==false)then
  125. return false;
  126. end;
  127. freeKeys[k]=false;
  128. Wait(0.01);
  129. if(keyDowns[k])then
  130. keyDowns[k]();
  131. elseif(shortcuts[k])then
  132. shortcuts[k]();
  133. end;
  134. end;
  135. onKeyUp=function(k)
  136. freeKeys[k]=true;
  137. end;
  138. onMove=function()
  139.  
  140. end;
  141. onSelect=function(lmouse)
  142. frame.Visible=true;
  143.  
  144. mouse=lmouse;
  145.  
  146. mouse.Icon=iconNormal;
  147.  
  148. mouse.Button1Down:connect(onDown);
  149. mouse.KeyDown:connect(onKeyDown);
  150. mouse.Button1Up:connect(onUp);
  151. mouse.KeyUp:connect(onKeyUp);
  152. mouse.Move:connect(onMove);
  153. end;
  154. onDeselect=function()
  155. ver=ver+1;
  156. frame.Visible=false;
  157. selectGui.Adornee=nil;
  158. mouse.Icon=iconNormal;
  159. for i,v in next,freeKeys do
  160. freeKeys[i]=true;
  161. end;
  162. end;
  163. addButton=function(title,shortcut,fun)
  164. with'TextButton'{
  165. Text=string.format(' %s (%s)',title,shortcut);
  166. TextXAlignment=0;
  167. Parent=frame;
  168. }.MouseButton1Up:connect(fun);
  169.  
  170. shortcuts[shortcut]=fun;
  171.  
  172. local c=#frame:children();
  173. for i,v in next,frame:children()do
  174. v.Position=UDim2.new(0,0,0,20*(i-1));
  175. v.Size=UDim2.new(1,0,0,20);
  176. end;
  177.  
  178. frame.Position=UDim2.new(1,-152,.5,-c*10);
  179. frame.Size=UDim2.new(0,150,0,c*20);
  180. end;
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189. for i,v in next,{guis;pack;}do
  190. pcall(function()
  191. repeat until destroy(v[name]);
  192. end);
  193. end;
  194.  
  195.  
  196.  
  197. tool=with'HopperBin'{
  198. Parent=pack;
  199. Name=name;
  200. };
  201. tool.Deselected:connect(onDeselect);
  202. tool.Selected:connect(onSelect);
  203.  
  204.  
  205.  
  206.  
  207. screen=with'ScreenGui'{
  208. Parent=guis;
  209. Name=name;
  210. };
  211. frame=with'Frame'{
  212. Parent=screen;
  213. Visible=false;
  214. };
  215. clframe=with'Frame'{
  216. Position=UDim2.new(.5,-50,.5,-50);
  217. Size=UDim2.new(0,100,0,100);
  218. Visible=false;
  219. Parent=screen;
  220. };
  221. selectGui=with'SelectionBox'{
  222. Parent=screen;
  223. };
  224.  
  225. local c=0;
  226. for y=0,7 do
  227. for x=0,7 do
  228. local color=BrickColor.palette(c).Color;
  229.  
  230. with'ImageButton'{
  231. Position=UDim2.new(.125*x,0,.125*y);
  232. Size=UDim2.new(.125,0,.125);
  233. BackgroundColor3=color;
  234. Parent=clframe;
  235. }.MouseButton1Up:connect(function()
  236. clframe.Visible=false;
  237. _G.drawColor=color;
  238. end);
  239.  
  240. c=c+1;
  241. end;
  242. end;
  243.  
  244. addButton('Color','c',function()
  245. clframe.Visible=true;
  246. end);
  247. addButton('Remove your draws','r',function()
  248. repeat
  249. destroy(_G.mine[1]);
  250. table.remove(_G.mine,1);
  251. Wait(0.01);
  252. until nil;
  253. end);
  254. addButton('Remove global draws','k',function()
  255. destroy(workspace.draw);
  256. while(_G.mine[1])do
  257. destroy(_G.mine[1]);
  258. table.remove(_G.mine,1);
  259. end;
  260. end);
  261. addButton('Remove selected','x',function()
  262. repeat
  263. if(find(workspace,'draw'))then
  264. local dt=mouse.target;
  265. if(dt and dt:IsDescendantOf(workspace.draw))then
  266. selectGui.Adornee=dt.Parent;
  267. else
  268. selectGui.Adornee=nil;
  269. end;
  270. else
  271. selectGui.Adornee=nil;
  272. end;
  273. Wait(0.01);
  274. until freeKeys.x;
  275. selectGui.Adornee=nil;
  276. end);
  277.  
  278.  
  279.  
  280.  
  281. repeat
  282. Wait(0.01);
  283. if(next(_G.mine)and _G.mine[_G.drawLimit])then
  284. destroy(_G.mine[1]);
  285. table.remove(_G.mine,1);
  286. end;
  287. until script.Parent==nil or tool.Parent==nil;
  288. script.Disabled=true;
  289. destroy(screen);
  290.  
  291.  
  292. --Dresmor Alakazard--
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement