Advertisement
boss123

Untitled

Nov 29th, 2014
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.53 KB | None | 0 0
  1. cls()--swagmoney!!!!!
  2. currentFile=nil
  3. currentId=0
  4. canExecute=false
  5. bevel='rbxassetid://107683415'
  6. leftImage='rbxassetid://187746470'
  7. fileDimensions={
  8. ['X']=0.15;
  9. ['Y']=0.15
  10. }
  11. print(fileDimensions.X)
  12.  
  13. gateFileIcons={
  14. ['new_document']=187739380;
  15. }
  16.  
  17. extIcons={
  18. ['APP']=187745092;
  19. ['FLD']=187744912;
  20. ['SYS']=187745076;
  21. ['MUS']=187744995;
  22. ['HTP']=187745260
  23. }
  24.  
  25. onScreen={}
  26. mainFrame.BackgroundColor3=BrickColor.new('Bright bluish green').Color
  27. createImageButton=function(size,position,color,parent)
  28. local label=Instance.new('ImageButton',parent)
  29. label.Size=size
  30. label.Position=position
  31. label.BackgroundColor3=color
  32. return label
  33. end
  34. createImageLabel=function(size,position,color,parent)
  35. local label=Instance.new('ImageLabel',parent)
  36. label.Size=size
  37. label.Position=position
  38. label.BackgroundColor3=color
  39. return label
  40. end
  41. createTextLabel=function(size,position,color,parent)
  42. local label=Instance.new('TextLabel',parent)
  43. label.Size=size
  44. label.Position=position
  45. label.BackgroundColor3=color
  46. return label
  47. end
  48. taskBar=createImageButton(UDim2.new(1,0,0.15,0),UDim2.new(0,0,0.85,0),BrickColor.new('Medium stone grey').Color,mainFrame)
  49. taskBar.ZIndex=9
  50. taskBar.BorderSizePixel=0
  51. taskBar.Image=bevel
  52. local left=createImageButton(UDim2.new(0.14,0,0.14,0),UDim2.new(0,0,0.86,0),BrickColor.new('White').Color,mainFrame)
  53. left.BackgroundTransparency=1
  54. left.ZIndex=10
  55. left.Image=leftImage
  56.  
  57. files=fileSystem.Files
  58. currentX=0
  59. currentY=0
  60.  
  61. updatePositions=function()
  62. if currentY<0.6 then
  63. currentY=currentY+(fileDimensions.Y+0.055)
  64. else
  65. currentY=0
  66. currentX=currentX+(fileDimensions.X+0.05)
  67. end
  68. end
  69. local dragging=false
  70. local dicon=nil
  71. local dtext=nil
  72. local dicontype=''
  73. local df=nil
  74. local taskn=0.15
  75. windows={}
  76. createWindow=function(name,icon,size,position)
  77. local numwin=#windows
  78. local newnum=#windows+1
  79. local window=Instance.new('Frame',mainFrame)
  80. window.ZIndex=8
  81. window.BackgroundColor3=BrickColor.new('Mid gray').Color
  82. window.BorderSizePixel=0
  83. window.Size=size
  84. window.Position=position
  85. window.Active=true
  86. window.Draggable=true
  87. window.DragBegin:connect(function(UD2)
  88. end)
  89. window.DragStopped:connect(function(x,y)
  90. end)
  91. local winbar=createTextLabel(UDim2.new(1,0,0,40),UDim2.new(0,0,0,0),BrickColor.new('Bright blue').Color,window)
  92. winbar.ZIndex=9
  93. winbar.TextXAlignment='Left'
  94. winbar.BorderSizePixel=0
  95. winbar.TextColor3=BrickColor.new('White').Color
  96. winbar.Text=name
  97. winbar.Font='SourceSansBold'
  98. winbar.FontSize='Size18'
  99. local xbutton=createImageButton(UDim2.new(0,35,0,35),UDim2.new(0.87,0,0.01,0),BrickColor.new('White').Color,window)
  100. xbutton.ZIndex=10
  101. xbutton.BackgroundTransparency=1
  102. xbutton.Image='rbxassetid://187831040'
  103.  
  104. local taskicon=createImageButton(UDim2.new(0.14,0,0.14,0),UDim2.new(taskn,0,0.86,0),BrickColor.new('White').Color,mainFrame)
  105. taskicon.ZIndex=10
  106. taskicon.Image='rbxassetid://' .. tostring(tonumber(icon)-1)
  107. taskicon.BackgroundTransparency=1
  108. xbutton.MouseButton1Up:connect(function()
  109. window:Destroy()
  110. taskicon:Destroy()
  111. for _,v in pairs(windows) do
  112. if _>newnum then
  113. v.Position=v.Position-UDim2.new(0.15,0,0,0)
  114. end
  115. end
  116. taskn=taskn-0.15
  117. end)
  118. taskn=taskn+0.15
  119. table.insert(windows,taskicon)
  120. return window
  121. end
  122. local context=nil
  123. displayFiles=function()
  124. currentX=0
  125. currentY=0
  126. ypcall(function()
  127. for i=1,10 do
  128. for _,v in pairs(onScreen) do
  129. v:Destroy()
  130. table.remove(onScreen,_)
  131. end
  132. end
  133. end)
  134. for _,v in pairs(files) do
  135. if v.parentid==fileDiD then
  136. local icon=createImageButton(UDim2.new(fileDimensions.X,0,fileDimensions.Y,0),UDim2.new(currentX,0,currentY,0),BrickColor.new('White').Color,mainFrame)
  137. icon.Transparency=1
  138. icon.ZIndex=2
  139. local icopos=icon.Position
  140. local text=createTextLabel(UDim2.new(fileDimensions.X,0,0.03,0),UDim2.new(currentX,0,currentY+0.15,0),BrickColor.new('White').Color,mainFrame)
  141. text.Text=v.name
  142. text.FontSize='Size18'
  143. text.Font='SourceSansBold'
  144. text.BackgroundTransparency=1
  145. local ud=UDim2.new()
  146. icon.Draggable=true
  147. icon.DragBegin:connect(function(UD2)
  148. icon.ZIndex=icon.ZIndex-1
  149. ud=UD2
  150. dragging=true
  151. dicon=icon
  152. dtext=text
  153. df=v
  154. end)
  155. icon.DragStopped:connect(function(x,y)
  156. print'swag'
  157. icon.ZIndex=icon.ZIndex+1
  158. --dragging=false
  159. end)
  160. if v.icon then
  161. icon.Image='rbxassetid://'..tostring(tonumber(v.icon)-1)
  162. else
  163. icon.Image='rbxassetid://' .. tostring(gateFileIcons['new_document']-1)
  164. if extIcons[v.type] then
  165. icon.Image='rbxassetid://'..tostring(extIcons[v.type]-1)
  166. end
  167. end
  168. table.insert(onScreen,icon)
  169. table.insert(onScreen,text)
  170.  
  171. updatePositions()
  172. local clicknum=0
  173. icon.MouseButton1Up:connect(function()
  174. if dragging==true and dicon~=icon then
  175. if v.type=='FLD' then
  176. print('it has dragged: '..text.Text)
  177. dragging=false
  178. dicon.Draggable=false
  179. dicon:Destroy()
  180. dtext:Destroy()
  181. local swag=v.dir..v.name..'/'
  182. for a,b in pairs(files) do
  183. if string.sub(v.dir,1,string.len(swag))==swag then
  184. b.dir=v.dir..v.name..'/'
  185. end
  186. end
  187. df.parentid=v.id
  188. df.dir=v.dir..v.name..'/'
  189. end
  190. elseif dragging==true and dicon==icon then
  191. dragging=false
  192. icon.Position=icopos
  193. end
  194. ypcall(function()
  195. context:Destroy()
  196. end)
  197. if clicknum<1 then
  198. clicknum=clicknum+1
  199. Spawn(function()
  200. wait(0.45)
  201. if clicknum==1 then
  202. clicknum=0
  203. end
  204. end)
  205. elseif clicknum==1 then
  206. if v.type=='FLD' then
  207. fileDirectory=v.dir..v.name..'/'
  208. fileDiD=v.id
  209. currentId=v.parentid
  210. displayFiles()
  211. elseif v.type=='APP' then
  212. loadstring(v.contents[1])()
  213. elseif v.type=='MUS' then
  214. local sound=Instance.new('Sound',plg)
  215. sound.SoundId='rbxassetid://' .. tostring(v.contents[1])
  216. sound:Play()
  217. end
  218. clicknum=0
  219. end
  220. end)
  221. icon.MouseButton2Up:connect(function(x,y)
  222. ypcall(function()
  223. context:Destroy()
  224. end)
  225. context=Instance.new('Frame',mainFrame)
  226. context.ZIndex=13
  227. context.Size=UDim2.new(0.3,0,0.4,0)
  228. context.Position=UDim2.new(0,x,0,y)
  229. context.BorderSizePixel=0
  230. context.BackgroundColor3=BrickColor.new('Light stone grey').Color
  231. local delete=Instance.new('TextButton',context)
  232. delete.ZIndex=14
  233. delete.BorderSizePixel=0
  234. delete.BackgroundColor3=BrickColor.new('Medium stone grey').Color
  235. delete.Font='SourceSansBold'
  236. delete.FontSize='Size24'
  237. delete.Size=UDim2.new(1,0,0.2,0)
  238. delete.TextXAlignment='Left'
  239. delete.Text='Delete'
  240. delete.Position=UDim2.new(0,0,0,0)
  241. delete.MouseButton1Up:connect(function()
  242. icon:Destroy()
  243. text:Destroy()
  244. table.remove(files,_)
  245. context:Destroy()
  246. saveFiles()
  247. end)
  248. local ren=Instance.new('TextButton',context)
  249. ren.ZIndex=14
  250. ren.BorderSizePixel=0
  251. ren.BackgroundColor3=BrickColor.new('Medium stone grey').Color
  252. ren.Font='SourceSansBold'
  253. ren.FontSize='Size24'
  254. ren.Size=UDim2.new(1,0,0.2,0)
  255. ren.TextXAlignment='Left'
  256. ren.Text='Rename'
  257. ren.Position=UDim2.new(0,0,0.2,0)
  258. ren.MouseButton1Up:connect(function()
  259. context:Destroy()
  260. text.Visible=false
  261. local rename=Instance.new('TextBox',mainFrame)
  262. rename.Size=text.Size
  263. rename.Position=text.Position
  264. rename.Text=text.Text
  265. rename.BackgroundColor3=BrickColor.new('White').Color
  266. rename.BorderSizePixel=0
  267. rename.Font=text.Font
  268. rename.FontSize=text.FontSize
  269. rename.TextColor3=text.TextColor3
  270. local ent=Instance.new('TextButton',mainFrame)
  271. ent.ZIndex=2
  272. ent.Size=rename.Size
  273. ent.Position=rename.Position+UDim2.new(fileDimensions.X+0.01,0,0,0)
  274. ent.BackgroundColor3=rename.BackgroundColor3
  275. ent.BorderSizePixel=0
  276. ent.Text='Enter'
  277. ent.Font=rename.Font
  278. ent.TextColor3=rename.TextColor3
  279. ent.FontSize=rename.FontSize
  280. ent.MouseButton1Up:connect(function()
  281. local full=rename.Text
  282. local exte=false
  283. if string.sub(full,string.len(full)-3,string.len(full)-3)=='.' then
  284. local ext=string.sub(full,string.len(full)-2,string.len(full))
  285. full=string.sub(full,1,string.len(full)-4)
  286. v.type=ext
  287. if ext=='APP' then
  288. v.contents={game:service'HttpService':GetAsync(v.contents[1])}
  289. end
  290. exte=true
  291. end
  292. local fd=v.dir..v.name..'/'
  293. for a,b in pairs(files) do
  294. if string.sub(b.dir,1,string.len(fd))==fd then
  295. b.dir=v.dir..full..'/'
  296. end
  297. end
  298. v.name=full
  299. text.Text=full
  300. text.Visible=true
  301. rename:Destroy()
  302. ent:Destroy()
  303. if exte==true then
  304. displayFiles()
  305. end
  306.  
  307. saveFiles()
  308. end)
  309. context:Destroy()
  310. end)
  311. end)
  312. end
  313. end
  314. end
  315. left.MouseButton1Up:connect(function()
  316. print'down'
  317. if fileDirectory~=mainDirectory then
  318. local dir=fileDirectory
  319. local lastslash=string.sub(dir,string.len(dir),string.len(dir))
  320. local num=0
  321. for i=string.len(dir)-1,1,-1 do
  322. print(string.sub(dir,i,i))
  323. if string.sub(dir,i,i)=='/' then
  324. num=i
  325. break
  326. end
  327. end
  328. if currentId~=0 then
  329. for _,v in pairs(fileSystem.Files) do
  330. if v.id==currentId then
  331. print(currentId)
  332. print(fileDiD)
  333. currentId=v.parentid
  334. fileDiD=v.parentid
  335. else
  336. currentId=0
  337. fileDiD=0
  338. end
  339. end
  340. end
  341. local newdir=string.sub(dir,1,num)
  342. fileDirectory=newdir
  343. print(newdir)
  344. displayFiles()
  345. end
  346. end)
  347. taskBar.MouseButton2Up:connect(function(x,y)
  348. ypcall(function()
  349. context:Destroy()
  350. end)
  351. context=Instance.new('Frame',mainFrame)
  352. context.ZIndex=13
  353. context.Size=UDim2.new(0.3,0,0.4,0)
  354. context.Position=UDim2.new(0,x,-0.4,y)
  355. context.BorderSizePixel=0
  356. context.BackgroundColor3=BrickColor.new('Light stone grey').Color
  357. local delete=Instance.new('TextButton',context)
  358. delete.ZIndex=14
  359. delete.BorderSizePixel=0
  360. delete.BackgroundColor3=BrickColor.new('Medium stone grey').Color
  361. delete.Font='SourceSansBold'
  362. delete.FontSize='Size24'
  363. delete.Size=UDim2.new(1,0,0.2,0)
  364. delete.TextXAlignment='Left'
  365. delete.Text='New folder'
  366. delete.Position=UDim2.new(0,0,0,0)
  367. delete.MouseButton1Up:connect(function()
  368. addFile('FLD','New',fileDirectory,{})
  369. context:Destroy()
  370. saveFiles()
  371. displayFiles()
  372. end)
  373. end)
  374.  
  375. displayFiles()
  376. functionTable.createWindow=createWindow
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement