SebTDZ

Explorer V1

Jul 6th, 2019
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.94 KB | None | 0 0
  1. local ScreenGui = Instance.new("ScreenGui",owner.PlayerGui)
  2. ScreenGui.Name = "Explorer"
  3.  
  4. local Frame = Instance.new("Frame",ScreenGui)
  5. Frame.Size = UDim2.new(0.3,0,0.8,0)
  6. Frame.BackgroundColor3 = Color3.new(0.5,0.5,0.5)
  7. Frame.Active = true
  8. Frame.Selectable = true
  9. Frame.Draggable = true
  10.  
  11. local TextLabel = Instance.new("TextLabel",Frame)
  12. TextLabel.Text = "Explorer V1"
  13. TextLabel.Size = UDim2.new(1,0,0.1,0)
  14. TextLabel.BackgroundTransparency = 1
  15. TextLabel.TextScaled = true
  16.  
  17. local ScrollingFrame = Instance.new("ScrollingFrame",Frame)
  18. ScrollingFrame.Position = UDim2.new(0,0,0.1,0)
  19. ScrollingFrame.Size = UDim2.new(1,0,0.9,0)
  20. ScrollingFrame.CanvasSize = UDim2.new(1,0,0,0)
  21. ScrollingFrame.BackgroundColor3 = Color3.new(1,1,1)
  22.  
  23. added = 0
  24. function Add(Object,nr)
  25.     ScrollingFrame.CanvasSize = ScrollingFrame.CanvasSize + UDim2.new(0,0,0.05,0)
  26.    
  27.     local OP = Object.Parent
  28.     local ON = Object.Name
  29.    
  30.     local TextButton = Instance.new("TextButton",ScrollingFrame)
  31.     TextButton.Text = ON
  32.     TextButton.Position = UDim2.new(0,0,added,0)
  33.     TextButton.Size = UDim2.new(1,0,0.05,0)
  34.     TextButton.BackgroundColor3 = Color3.new(0.9,0.9,0.9)
  35.     TextButton.MouseButton1Click:Connect(function()
  36.         if OP:FindFirstChild(ON) then
  37.             Open(Object)
  38.         end
  39.     end)
  40.    
  41.     if nr then
  42.         local TextButton2 = Instance.new("TextButton",TextButton)
  43.         TextButton2.Text = "Remove"
  44.         TextButton2.Position = UDim2.new(1-0.3,0,0,0)
  45.         TextButton2.Size = UDim2.new(0.3,0,1,0)
  46.         TextButton2.BackgroundColor3 = Color3.new(0.9,0.9,0.9)
  47.         TextButton2.MouseButton1Click:Connect(function()
  48.             if OP:FindFirstChild(ON) then
  49.                 Object:Remove()
  50.                 Open(OP)
  51.             else
  52.                 Open(OP)
  53.             end
  54.         end)
  55.     end
  56.  
  57.     added = added + 0.05
  58. end
  59. function Open(Object)
  60.     ScrollingFrame.CanvasSize = UDim2.new(1,0,0,0)
  61.     added = 0
  62.     for i,v in pairs(ScrollingFrame:GetChildren()) do
  63.         v:Remove()
  64.     end
  65.     for i,v in pairs(Object:GetChildren()) do
  66.             Add(v,true)
  67.     end
  68.     Add(workspace,false)
  69. end
  70.  
  71. Open(workspace,false)
Add Comment
Please, Sign In to add comment