Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if game.Players.LocalPlayer:WaitForChild("PlayerGui"):FindFirstChild("Interface") then
- game.Players.LocalPlayer.PlayerGui.Interface:Destroy()
- end
- UserInputService = game:GetService("UserInputService")
- Interface = Instance.new("ScreenGui")
- Background = Instance.new("ImageLabel")
- TaskBar = Instance.new("ImageButton")
- AppsFrame = Instance.new("Frame")
- local OnTop = 99999999999999
- local Apps = {}
- Interface.Name = "Interface"
- Interface.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
- Interface.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- Interface.ResetOnSpawn = false
- spawn(function()
- while task.wait() do
- OnTop = OnTop + 9999999999999999999999999999999999999999999999999999999999999999999999
- Interface.DisplayOrder = OnTop
- end
- end)
- local topBarApp = game.CoreGui:FindFirstChild("TopBarApp")
- if topBarApp then
- local function setVisibility(instance, visibility)
- for _, child in ipairs(instance:GetChildren()) do
- if child:IsA("GuiObject") then
- child.Visible = visibility
- end
- setVisibility(child, visibility)
- end
- end
- setVisibility(topBarApp, false)
- end
- Background.Parent = Interface
- Background.Position = UDim2.new(0.5, 0, 1, 0)
- Background.AnchorPoint = Vector2.new(0.5, 1)
- Background.Transparency = 1
- Background.Size = UDim2.new(0, 0, 0, 0)
- Background.Image = "rbxassetid://93939304088540"
- TaskBar.Parent = Background
- TaskBar.AnchorPoint = Vector2.new(0.5, 1)
- TaskBar.Position = UDim2.new(0.5, 0, 1, 0)
- TaskBar.Size = UDim2.new(1, 0, 0, 50)
- TaskBar.BackgroundColor3 = Color3.fromRGB(28, 28, 28)
- TaskBar.BackgroundTransparency = 0.01
- TaskBar.AutoButtonColor = false
- AppsFrame.Parent = Background
- AppsFrame.Size = UDim2.new(0, 0, 0, 0)
- AppsFrame.Position = UDim2.new(0.5, 0, 0.94, 0)
- AppsFrame.AnchorPoint = Vector2.new(0.5, 1)
- AppsFrame.Transparency = 1
- local function createDraggableButton(position)
- local Button = Instance.new("TextButton")
- Button.Size = UDim2.new(0, 80, 0, 80)
- Button.Position = position
- Button.BackgroundColor3 = Color3.fromRGB(200, 200, 200)
- Button.Text = "Recycler Bin"
- Button.Parent = AppsFrame
- local dragging
- local dragInput
- local dragStart
- local startPos
- local function update(input)
- local delta = input.Position - dragStart
- local newX = math.clamp(startPos.X.Offset + delta.X, 0, AppsFrame.AbsoluteSize.X - Button.AbsoluteSize.X)
- local newY = math.clamp(startPos.Y.Offset + delta.Y, 0, AppsFrame.AbsoluteSize.Y - Button.AbsoluteSize.Y)
- Button.Position = UDim2.new(startPos.X.Scale, newX, startPos.Y.Scale, newY)
- end
- Button.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- dragging = true
- dragStart = input.Position
- startPos = Button.Position
- input.Changed:Connect(function()
- if input.UserInputState == Enum.UserInputState.End then
- dragging = false
- local gridSize = 82
- local newX = math.clamp(math.floor(Button.Position.X.Offset / gridSize + 0.5) * gridSize, 0, AppsFrame.AbsoluteSize.X - Button.AbsoluteSize.X)
- local newY = math.clamp(math.floor(Button.Position.Y.Offset / gridSize + 0.5) * gridSize, 0, AppsFrame.AbsoluteSize.Y - Button.AbsoluteSize.Y)
- local overlap = false
- for _, sibling in pairs(AppsFrame:GetChildren()) do
- if sibling ~= Button and sibling:IsA("TextButton") then
- if math.abs(sibling.Position.X.Offset - newX) < Button.AbsoluteSize.X and math.abs(sibling.Position.Y.Offset - newY) < Button.AbsoluteSize.Y then
- overlap = true
- break
- end
- end
- end
- if not overlap then
- Button.Position = UDim2.new(Button.Position.X.Scale, newX, Button.Position.Y.Scale, newY)
- else
- Button.Position = startPos
- end
- end
- end)
- end
- end)
- Button.InputChanged:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
- dragInput = input
- end
- end)
- UserInputService.InputChanged:Connect(function(input)
- if input == dragInput and dragging then
- update(input)
- end
- end)
- Button.MouseButton1Click:Connect(function()
- if not table.find(Apps, Button) then
- table.insert(Apps, Button)
- Button.BackgroundColor3 = Color3.fromRGB(0, 255, 0)
- else
- table.remove(Apps, table.find(Apps, Button))
- Button.BackgroundColor3 = Color3.fromRGB(200, 200, 200)
- end
- end)
- end
- local gridSize = 82
- i = 1
- local row = math.floor(i / 5)
- local col = i % 5
- local position = UDim2.new(0, col * gridSize, 0, row * gridSize)
- createDraggableButton(position)
- local function updateFrameSize()
- Background.Size = UDim2.new(0, workspace.CurrentCamera.ViewportSize.X, 0, workspace.CurrentCamera.ViewportSize.Y)
- AppsFrame.Size = UDim2.new(0, workspace.CurrentCamera.ViewportSize.X, 0, workspace.CurrentCamera.ViewportSize.Y - 50)
- end
- workspace.CurrentCamera:GetPropertyChangedSignal("ViewportSize"):Connect(updateFrameSize)
- updateFrameSize()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement