Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --------------------------------------------------
- -- Player Blocker GUI (Resizable Scroll + Real-time Update)
- --------------------------------------------------
- local Players = game:GetService("Players")
- local StarterGui = game:GetService("StarterGui")
- local UserInputService = game:GetService("UserInputService")
- local LocalPlayer = Players.LocalPlayer
- local BLOCK_DELAY = 0.35
- local MAIN_WIDTH, MAIN_HEIGHT = 280, 300 -- slightly smaller main window
- -- BLOCK FUNCTION
- local function blockPlayer(player)
- if not player or player == LocalPlayer then return end
- pcall(function()
- StarterGui:SetCore("PromptBlockPlayer", player)
- end)
- task.wait(BLOCK_DELAY)
- end
- -- GUI
- local gui = Instance.new("ScreenGui")
- gui.Name = "VarsonhubautoBlocker"
- gui.ResetOnSpawn = false
- gui.Parent = LocalPlayer:WaitForChild("PlayerGui")
- -- Main frame
- local main = Instance.new("Frame")
- main.Size = UDim2.fromOffset(MAIN_WIDTH, MAIN_HEIGHT)
- main.Position = UDim2.fromScale(0.5, 0.5)
- main.AnchorPoint = Vector2.new(0.5, 0.5)
- main.BackgroundColor3 = Color3.fromRGB(18, 18, 22)
- main.BorderSizePixel = 0
- main.Parent = gui
- Instance.new("UICorner", main).CornerRadius = UDim.new(0, 14)
- -- Header
- local header = Instance.new("Frame")
- header.Size = UDim2.new(1, 0, 0, 35)
- header.BackgroundColor3 = Color3.fromRGB(24, 24, 30)
- header.Active = true
- header.Selectable = true
- header.Parent = main
- Instance.new("UICorner", header).CornerRadius = UDim.new(0, 14)
- local title = Instance.new("TextLabel")
- title.Size = UDim2.new(1, 0, 1, 0)
- title.Text = "varson hub blocker"
- title.Font = Enum.Font.GothamBold
- title.TextSize = 16
- title.TextColor3 = Color3.new(1, 1, 1)
- title.BackgroundTransparency = 1
- title.Parent = header
- -- Scroll frame for players
- local scroll = Instance.new("ScrollingFrame")
- scroll.Size = UDim2.new(1, -10, 1, -45)
- scroll.Position = UDim2.new(0, 5, 0, 40)
- scroll.BackgroundTransparency = 1
- scroll.ScrollBarThickness = 6
- scroll.Parent = main
- scroll.AutomaticCanvasSize = Enum.AutomaticSize.Y
- local uiList = Instance.new("UIListLayout")
- uiList.Padding = UDim.new(0, 6)
- uiList.Parent = scroll
- uiList.SortOrder = Enum.SortOrder.LayoutOrder
- -- Keep track of player frames
- local playerFrames = {}
- -- Function to remove a player frame
- local function removePlayerFrame(player)
- if playerFrames[player] then
- playerFrames[player]:Destroy()
- playerFrames[player] = nil
- end
- end
- -- Function to add a player
- local function addPlayerToList(player)
- local container = Instance.new("Frame")
- container.Size = UDim2.new(1, -10, 0, 50)
- container.BackgroundColor3 = Color3.fromRGB(30, 30, 35)
- container.Parent = scroll
- Instance.new("UICorner", container).CornerRadius = UDim.new(0, 10)
- local avatar = Instance.new("ImageLabel")
- avatar.Size = UDim2.fromOffset(40, 40)
- avatar.Position = UDim2.new(0, 5, 0.5, -20)
- avatar.BackgroundTransparency = 1
- avatar.Image = Players:GetUserThumbnailAsync(player.UserId, Enum.ThumbnailType.AvatarBust, Enum.ThumbnailSize.Size48x48)
- avatar.Parent = container
- local username = Instance.new("TextLabel")
- username.Size = UDim2.new(0, 180, 1, 0)
- username.Position = UDim2.new(0, 50, 0, 0)
- username.Text = player.Name
- username.TextColor3 = Color3.new(1, 1, 1)
- username.Font = Enum.Font.GothamBold
- username.TextSize = 14
- username.BackgroundTransparency = 1
- username.TextXAlignment = Enum.TextXAlignment.Left
- username.Parent = container
- local blockBtn = Instance.new("TextButton")
- blockBtn.Size = UDim2.fromOffset(70, 30)
- blockBtn.Position = UDim2.new(1, -75, 0.5, -15)
- blockBtn.Text = "Block"
- blockBtn.Font = Enum.Font.GothamBold
- blockBtn.TextSize = 14
- blockBtn.BackgroundColor3 = Color3.fromRGB(210, 60, 60)
- blockBtn.TextColor3 = Color3.new(1, 1, 1)
- blockBtn.Parent = container
- Instance.new("UICorner", blockBtn).CornerRadius = UDim.new(0, 6)
- blockBtn.MouseButton1Click:Connect(function()
- blockPlayer(player)
- removePlayerFrame(player) -- remove after blocked
- end)
- playerFrames[player] = container
- end
- -- Add existing players
- for _, p in ipairs(Players:GetPlayers()) do
- if p ~= LocalPlayer then
- addPlayerToList(p)
- end
- end
- -- Handle new players
- Players.PlayerAdded:Connect(function(p)
- if p ~= LocalPlayer then
- addPlayerToList(p)
- end
- end)
- -- Remove players when they leave
- Players.PlayerRemoving:Connect(function(p)
- removePlayerFrame(p)
- end)
- -- Dragging
- local dragging = false
- local dragStart
- local startPos
- local function startDrag(input)
- dragging = true
- dragStart = input.Position
- startPos = main.Position
- end
- local function updateDrag(input)
- if not dragging then return end
- local delta = input.Position - dragStart
- main.Position = UDim2.new(
- startPos.X.Scale,
- startPos.X.Offset + delta.X,
- startPos.Y.Scale,
- startPos.Y.Offset + delta.Y
- )
- end
- local function stopDrag()
- dragging = false
- end
- header.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
- startDrag(input)
- end
- end)
- UserInputService.InputChanged:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
- updateDrag(input)
- end
- end)
- UserInputService.InputEnded:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
- stopDrag()
- end
- end)
- print("Player List Blocker (Fixed + Real-time Update) Loaded ✅")
Advertisement
Add Comment
Please, Sign In to add comment