Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cls()--swagmoney!!!!!
- currentFile=nil
- currentId=0
- canExecute=false
- bevel='rbxassetid://107683415'
- leftImage='rbxassetid://187746470'
- fileDimensions={
- ['X']=0.15;
- ['Y']=0.15
- }
- print(fileDimensions.X)
- gateFileIcons={
- ['new_document']=187739380;
- }
- extIcons={
- ['APP']=187745092;
- ['FLD']=187744912;
- ['SYS']=187745076;
- ['MUS']=187744995;
- ['HTP']=187745260
- }
- onScreen={}
- mainFrame.BackgroundColor3=BrickColor.new('Bright bluish green').Color
- createImageButton=function(size,position,color,parent)
- local label=Instance.new('ImageButton',parent)
- label.Size=size
- label.Position=position
- label.BackgroundColor3=color
- return label
- end
- createImageLabel=function(size,position,color,parent)
- local label=Instance.new('ImageLabel',parent)
- label.Size=size
- label.Position=position
- label.BackgroundColor3=color
- return label
- end
- createTextLabel=function(size,position,color,parent)
- local label=Instance.new('TextLabel',parent)
- label.Size=size
- label.Position=position
- label.BackgroundColor3=color
- return label
- end
- taskBar=createImageButton(UDim2.new(1,0,0.15,0),UDim2.new(0,0,0.85,0),BrickColor.new('Medium stone grey').Color,mainFrame)
- taskBar.ZIndex=9
- taskBar.BorderSizePixel=0
- taskBar.Image=bevel
- local left=createImageButton(UDim2.new(0.14,0,0.14,0),UDim2.new(0,0,0.86,0),BrickColor.new('White').Color,mainFrame)
- left.BackgroundTransparency=1
- left.ZIndex=10
- left.Image=leftImage
- files=fileSystem.Files
- currentX=0
- currentY=0
- updatePositions=function()
- if currentY<0.6 then
- currentY=currentY+(fileDimensions.Y+0.055)
- else
- currentY=0
- currentX=currentX+(fileDimensions.X+0.05)
- end
- end
- local dragging=false
- local dicon=nil
- local dtext=nil
- local dicontype=''
- local df=nil
- local taskn=0.15
- windows={}
- createWindow=function(name,icon,size,position)
- local numwin=#windows
- local newnum=#windows+1
- local window=Instance.new('Frame',mainFrame)
- window.ZIndex=8
- window.BackgroundColor3=BrickColor.new('Mid gray').Color
- window.BorderSizePixel=0
- window.Size=size
- window.Position=position
- window.Active=true
- window.Draggable=true
- window.DragBegin:connect(function(UD2)
- end)
- window.DragStopped:connect(function(x,y)
- end)
- local winbar=createTextLabel(UDim2.new(1,0,0,40),UDim2.new(0,0,0,0),BrickColor.new('Bright blue').Color,window)
- winbar.ZIndex=9
- winbar.TextXAlignment='Left'
- winbar.BorderSizePixel=0
- winbar.TextColor3=BrickColor.new('White').Color
- winbar.Text=name
- winbar.Font='SourceSansBold'
- winbar.FontSize='Size18'
- local xbutton=createImageButton(UDim2.new(0,35,0,35),UDim2.new(0.87,0,0.01,0),BrickColor.new('White').Color,window)
- xbutton.ZIndex=10
- xbutton.BackgroundTransparency=1
- xbutton.Image='rbxassetid://187831040'
- local taskicon=createImageButton(UDim2.new(0.14,0,0.14,0),UDim2.new(taskn,0,0.86,0),BrickColor.new('White').Color,mainFrame)
- taskicon.ZIndex=10
- taskicon.Image='rbxassetid://' .. tostring(tonumber(icon)-1)
- taskicon.BackgroundTransparency=1
- xbutton.MouseButton1Up:connect(function()
- window:Destroy()
- taskicon:Destroy()
- for _,v in pairs(windows) do
- if _>newnum then
- v.Position=v.Position-UDim2.new(0.15,0,0,0)
- end
- end
- taskn=taskn-0.15
- end)
- taskn=taskn+0.15
- table.insert(windows,taskicon)
- return window
- end
- local context=nil
- displayFiles=function()
- currentX=0
- currentY=0
- ypcall(function()
- for i=1,10 do
- for _,v in pairs(onScreen) do
- v:Destroy()
- table.remove(onScreen,_)
- end
- end
- end)
- for _,v in pairs(files) do
- if v.parentid==fileDiD then
- local icon=createImageButton(UDim2.new(fileDimensions.X,0,fileDimensions.Y,0),UDim2.new(currentX,0,currentY,0),BrickColor.new('White').Color,mainFrame)
- icon.Transparency=1
- icon.ZIndex=2
- local icopos=icon.Position
- local text=createTextLabel(UDim2.new(fileDimensions.X,0,0.03,0),UDim2.new(currentX,0,currentY+0.15,0),BrickColor.new('White').Color,mainFrame)
- text.Text=v.name
- text.FontSize='Size18'
- text.Font='SourceSansBold'
- text.BackgroundTransparency=1
- local ud=UDim2.new()
- icon.Draggable=true
- icon.DragBegin:connect(function(UD2)
- icon.ZIndex=icon.ZIndex-1
- ud=UD2
- dragging=true
- dicon=icon
- dtext=text
- df=v
- end)
- icon.DragStopped:connect(function(x,y)
- print'swag'
- icon.ZIndex=icon.ZIndex+1
- --dragging=false
- end)
- if v.icon then
- icon.Image='rbxassetid://'..tostring(tonumber(v.icon)-1)
- else
- icon.Image='rbxassetid://' .. tostring(gateFileIcons['new_document']-1)
- if extIcons[v.type] then
- icon.Image='rbxassetid://'..tostring(extIcons[v.type]-1)
- end
- end
- table.insert(onScreen,icon)
- table.insert(onScreen,text)
- updatePositions()
- local clicknum=0
- icon.MouseButton1Up:connect(function()
- if dragging==true and dicon~=icon then
- if v.type=='FLD' then
- print('it has dragged: '..text.Text)
- dragging=false
- dicon.Draggable=false
- dicon:Destroy()
- dtext:Destroy()
- local swag=v.dir..v.name..'/'
- for a,b in pairs(files) do
- if string.sub(v.dir,1,string.len(swag))==swag then
- b.dir=v.dir..v.name..'/'
- end
- end
- df.parentid=v.id
- df.dir=v.dir..v.name..'/'
- end
- elseif dragging==true and dicon==icon then
- dragging=false
- icon.Position=icopos
- end
- ypcall(function()
- context:Destroy()
- end)
- if clicknum<1 then
- clicknum=clicknum+1
- Spawn(function()
- wait(0.45)
- if clicknum==1 then
- clicknum=0
- end
- end)
- elseif clicknum==1 then
- if v.type=='FLD' then
- fileDirectory=v.dir..v.name..'/'
- fileDiD=v.id
- currentId=v.parentid
- displayFiles()
- elseif v.type=='APP' then
- loadstring(v.contents[1])()
- elseif v.type=='MUS' then
- local sound=Instance.new('Sound',plg)
- sound.SoundId='rbxassetid://' .. tostring(v.contents[1])
- sound:Play()
- end
- clicknum=0
- end
- end)
- icon.MouseButton2Up:connect(function(x,y)
- ypcall(function()
- context:Destroy()
- end)
- context=Instance.new('Frame',mainFrame)
- context.ZIndex=13
- context.Size=UDim2.new(0.3,0,0.4,0)
- context.Position=UDim2.new(0,x,0,y)
- context.BorderSizePixel=0
- context.BackgroundColor3=BrickColor.new('Light stone grey').Color
- local delete=Instance.new('TextButton',context)
- delete.ZIndex=14
- delete.BorderSizePixel=0
- delete.BackgroundColor3=BrickColor.new('Medium stone grey').Color
- delete.Font='SourceSansBold'
- delete.FontSize='Size24'
- delete.Size=UDim2.new(1,0,0.2,0)
- delete.TextXAlignment='Left'
- delete.Text='Delete'
- delete.Position=UDim2.new(0,0,0,0)
- delete.MouseButton1Up:connect(function()
- icon:Destroy()
- text:Destroy()
- table.remove(files,_)
- context:Destroy()
- saveFiles()
- end)
- local ren=Instance.new('TextButton',context)
- ren.ZIndex=14
- ren.BorderSizePixel=0
- ren.BackgroundColor3=BrickColor.new('Medium stone grey').Color
- ren.Font='SourceSansBold'
- ren.FontSize='Size24'
- ren.Size=UDim2.new(1,0,0.2,0)
- ren.TextXAlignment='Left'
- ren.Text='Rename'
- ren.Position=UDim2.new(0,0,0.2,0)
- ren.MouseButton1Up:connect(function()
- context:Destroy()
- text.Visible=false
- local rename=Instance.new('TextBox',mainFrame)
- rename.Size=text.Size
- rename.Position=text.Position
- rename.Text=text.Text
- rename.BackgroundColor3=BrickColor.new('White').Color
- rename.BorderSizePixel=0
- rename.Font=text.Font
- rename.FontSize=text.FontSize
- rename.TextColor3=text.TextColor3
- local ent=Instance.new('TextButton',mainFrame)
- ent.ZIndex=2
- ent.Size=rename.Size
- ent.Position=rename.Position+UDim2.new(fileDimensions.X+0.01,0,0,0)
- ent.BackgroundColor3=rename.BackgroundColor3
- ent.BorderSizePixel=0
- ent.Text='Enter'
- ent.Font=rename.Font
- ent.TextColor3=rename.TextColor3
- ent.FontSize=rename.FontSize
- ent.MouseButton1Up:connect(function()
- local full=rename.Text
- local exte=false
- if string.sub(full,string.len(full)-3,string.len(full)-3)=='.' then
- local ext=string.sub(full,string.len(full)-2,string.len(full))
- full=string.sub(full,1,string.len(full)-4)
- v.type=ext
- if ext=='APP' then
- v.contents={game:service'HttpService':GetAsync(v.contents[1])}
- end
- exte=true
- end
- local fd=v.dir..v.name..'/'
- for a,b in pairs(files) do
- if string.sub(b.dir,1,string.len(fd))==fd then
- b.dir=v.dir..full..'/'
- end
- end
- v.name=full
- text.Text=full
- text.Visible=true
- rename:Destroy()
- ent:Destroy()
- if exte==true then
- displayFiles()
- end
- saveFiles()
- end)
- context:Destroy()
- end)
- end)
- end
- end
- end
- left.MouseButton1Up:connect(function()
- print'down'
- if fileDirectory~=mainDirectory then
- local dir=fileDirectory
- local lastslash=string.sub(dir,string.len(dir),string.len(dir))
- local num=0
- for i=string.len(dir)-1,1,-1 do
- print(string.sub(dir,i,i))
- if string.sub(dir,i,i)=='/' then
- num=i
- break
- end
- end
- if currentId~=0 then
- for _,v in pairs(fileSystem.Files) do
- if v.id==currentId then
- print(currentId)
- print(fileDiD)
- currentId=v.parentid
- fileDiD=v.parentid
- else
- currentId=0
- fileDiD=0
- end
- end
- end
- local newdir=string.sub(dir,1,num)
- fileDirectory=newdir
- print(newdir)
- displayFiles()
- end
- end)
- taskBar.MouseButton2Up:connect(function(x,y)
- ypcall(function()
- context:Destroy()
- end)
- context=Instance.new('Frame',mainFrame)
- context.ZIndex=13
- context.Size=UDim2.new(0.3,0,0.4,0)
- context.Position=UDim2.new(0,x,-0.4,y)
- context.BorderSizePixel=0
- context.BackgroundColor3=BrickColor.new('Light stone grey').Color
- local delete=Instance.new('TextButton',context)
- delete.ZIndex=14
- delete.BorderSizePixel=0
- delete.BackgroundColor3=BrickColor.new('Medium stone grey').Color
- delete.Font='SourceSansBold'
- delete.FontSize='Size24'
- delete.Size=UDim2.new(1,0,0.2,0)
- delete.TextXAlignment='Left'
- delete.Text='New folder'
- delete.Position=UDim2.new(0,0,0,0)
- delete.MouseButton1Up:connect(function()
- addFile('FLD','New',fileDirectory,{})
- context:Destroy()
- saveFiles()
- displayFiles()
- end)
- end)
- displayFiles()
- functionTable.createWindow=createWindow
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement