Advertisement
ERROR_CODE

OS

Nov 28th, 2024 (edited)
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.74 KB | None | 0 0
  1. if game.Players.LocalPlayer:WaitForChild("PlayerGui"):FindFirstChild("Interface") then
  2. game.Players.LocalPlayer.PlayerGui.Interface:Destroy()
  3. end
  4. UserInputService = game:GetService("UserInputService")
  5. Interface = Instance.new("ScreenGui")
  6. Background = Instance.new("ImageLabel")
  7. TaskBar = Instance.new("ImageButton")
  8. AppsFrame = Instance.new("Frame")
  9.  
  10. local OnTop = 99999999999999
  11. local Apps = {}
  12.  
  13. Interface.Name = "Interface"
  14. Interface.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  15. Interface.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  16. Interface.ResetOnSpawn = false
  17. spawn(function()
  18. while task.wait() do
  19. OnTop = OnTop + 9999999999999999999999999999999999999999999999999999999999999999999999
  20. Interface.DisplayOrder = OnTop
  21. end
  22. end)
  23.  
  24. local topBarApp = game.CoreGui:FindFirstChild("TopBarApp")
  25.  
  26. if topBarApp then
  27. local function setVisibility(instance, visibility)
  28. for _, child in ipairs(instance:GetChildren()) do
  29. if child:IsA("GuiObject") then
  30. child.Visible = visibility
  31. end
  32. setVisibility(child, visibility)
  33. end
  34. end
  35. setVisibility(topBarApp, false)
  36. end
  37.  
  38. Background.Parent = Interface
  39. Background.Position = UDim2.new(0.5, 0, 1, 0)
  40. Background.AnchorPoint = Vector2.new(0.5, 1)
  41. Background.Transparency = 1
  42. Background.Size = UDim2.new(0, 0, 0, 0)
  43. Background.Image = "rbxassetid://93939304088540"
  44.  
  45. TaskBar.Parent = Background
  46. TaskBar.AnchorPoint = Vector2.new(0.5, 1)
  47. TaskBar.Position = UDim2.new(0.5, 0, 1, 0)
  48. TaskBar.Size = UDim2.new(1, 0, 0, 50)
  49. TaskBar.BackgroundColor3 = Color3.fromRGB(28, 28, 28)
  50. TaskBar.BackgroundTransparency = 0.01
  51. TaskBar.AutoButtonColor = false
  52.  
  53. AppsFrame.Parent = Background
  54. AppsFrame.Size = UDim2.new(0, 0, 0, 0)
  55. AppsFrame.Position = UDim2.new(0.5, 0, 0.94, 0)
  56. AppsFrame.AnchorPoint = Vector2.new(0.5, 1)
  57. AppsFrame.Transparency = 1
  58.  
  59. local function createDraggableButton(position)
  60. local Button = Instance.new("TextButton")
  61. Button.Size = UDim2.new(0, 80, 0, 80)
  62. Button.Position = position
  63. Button.BackgroundColor3 = Color3.fromRGB(200, 200, 200)
  64. Button.Text = "Recycler Bin"
  65.  
  66. Button.Parent = AppsFrame
  67.  
  68. local dragging
  69. local dragInput
  70. local dragStart
  71. local startPos
  72.  
  73. local function update(input)
  74. local delta = input.Position - dragStart
  75. local newX = math.clamp(startPos.X.Offset + delta.X, 0, AppsFrame.AbsoluteSize.X - Button.AbsoluteSize.X)
  76. local newY = math.clamp(startPos.Y.Offset + delta.Y, 0, AppsFrame.AbsoluteSize.Y - Button.AbsoluteSize.Y)
  77. Button.Position = UDim2.new(startPos.X.Scale, newX, startPos.Y.Scale, newY)
  78. end
  79.  
  80. Button.InputBegan:Connect(function(input)
  81. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  82. dragging = true
  83. dragStart = input.Position
  84. startPos = Button.Position
  85. input.Changed:Connect(function()
  86. if input.UserInputState == Enum.UserInputState.End then
  87. dragging = false
  88. local gridSize = 82
  89. local newX = math.clamp(math.floor(Button.Position.X.Offset / gridSize + 0.5) * gridSize, 0, AppsFrame.AbsoluteSize.X - Button.AbsoluteSize.X)
  90. local newY = math.clamp(math.floor(Button.Position.Y.Offset / gridSize + 0.5) * gridSize, 0, AppsFrame.AbsoluteSize.Y - Button.AbsoluteSize.Y)
  91.                    
  92. local overlap = false
  93. for _, sibling in pairs(AppsFrame:GetChildren()) do
  94. if sibling ~= Button and sibling:IsA("TextButton") then
  95. if math.abs(sibling.Position.X.Offset - newX) < Button.AbsoluteSize.X and math.abs(sibling.Position.Y.Offset - newY) < Button.AbsoluteSize.Y then
  96. overlap = true
  97. break
  98. end
  99. end
  100. end
  101.  
  102. if not overlap then
  103. Button.Position = UDim2.new(Button.Position.X.Scale, newX, Button.Position.Y.Scale, newY)
  104. else
  105. Button.Position = startPos
  106. end
  107. end
  108. end)
  109. end
  110. end)
  111.  
  112. Button.InputChanged:Connect(function(input)
  113. if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
  114. dragInput = input
  115. end
  116. end)
  117.  
  118. UserInputService.InputChanged:Connect(function(input)
  119. if input == dragInput and dragging then
  120. update(input)
  121. end
  122. end)
  123.  
  124. Button.MouseButton1Click:Connect(function()
  125. if not table.find(Apps, Button) then
  126. table.insert(Apps, Button)
  127. Button.BackgroundColor3 = Color3.fromRGB(0, 255, 0)
  128. else
  129. table.remove(Apps, table.find(Apps, Button))
  130. Button.BackgroundColor3 = Color3.fromRGB(200, 200, 200)
  131. end
  132. end)
  133. end
  134.  
  135. local gridSize = 82
  136.  
  137.  i = 1
  138.     local row = math.floor(i / 5)
  139.     local col = i % 5
  140.     local position = UDim2.new(0, col * gridSize, 0, row * gridSize)
  141.     createDraggableButton(position)
  142.  
  143.  
  144.  
  145. local function updateFrameSize()
  146. Background.Size = UDim2.new(0, workspace.CurrentCamera.ViewportSize.X, 0, workspace.CurrentCamera.ViewportSize.Y)
  147. AppsFrame.Size = UDim2.new(0, workspace.CurrentCamera.ViewportSize.X, 0, workspace.CurrentCamera.ViewportSize.Y - 50)
  148. end
  149.  
  150. workspace.CurrentCamera:GetPropertyChangedSignal("ViewportSize"):Connect(updateFrameSize)
  151. updateFrameSize()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement