Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Services
- local Players = game:GetService("Players")
- local RunService = game:GetService("RunService")
- local Camera = workspace.CurrentCamera
- -- Variables
- local espData = {}
- local playerColors = {}
- local isESPEnabled = false
- local spectatingPlayer = nil
- local playerListVisible = false
- -- Utility: Generate unique bright colors
- local function getUniqueColor()
- return Color3.fromHSV(math.random(), 1, 1)
- end
- -- GUI Setup
- local ScreenGui = Instance.new("ScreenGui")
- ScreenGui.Parent = Players.LocalPlayer:WaitForChild("PlayerGui")
- -- Main Frame
- local MainFrame = Instance.new("Frame")
- MainFrame.Size = UDim2.new(0, 250, 0, 400)
- MainFrame.Position = UDim2.new(0, 10, 0, 10)
- MainFrame.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
- MainFrame.Draggable = true
- MainFrame.Active = true
- MainFrame.Selectable = true
- MainFrame.Parent = ScreenGui
- -- ESP Button
- local ESPButton = Instance.new("TextButton")
- ESPButton.Size = UDim2.new(0, 230, 0, 40)
- ESPButton.Position = UDim2.new(0, 10, 0, 10)
- ESPButton.BackgroundColor3 = Color3.fromRGB(100, 255, 100)
- ESPButton.Text = "ESP: OFF"
- ESPButton.Font = Enum.Font.GothamBold
- ESPButton.TextSize = 14
- ESPButton.Parent = MainFrame
- -- Spectate Button
- local SpectateButton = Instance.new("TextButton")
- SpectateButton.Size = UDim2.new(0, 230, 0, 40)
- SpectateButton.Position = UDim2.new(0, 10, 0, 60)
- SpectateButton.BackgroundColor3 = Color3.fromRGB(100, 100, 255)
- SpectateButton.Text = "Spectate"
- SpectateButton.Font = Enum.Font.GothamBold
- SpectateButton.TextSize = 14
- SpectateButton.Parent = MainFrame
- -- Un-Spectate Button
- local UnSpectateButton = Instance.new("TextButton")
- UnSpectateButton.Size = UDim2.new(0, 230, 0, 40)
- UnSpectateButton.Position = UDim2.new(0, 10, 0, 110)
- UnSpectateButton.BackgroundColor3 = Color3.fromRGB(255, 100, 100)
- UnSpectateButton.Text = "Un-Spectate"
- UnSpectateButton.Font = Enum.Font.GothamBold
- UnSpectateButton.TextSize = 14
- UnSpectateButton.Parent = MainFrame
- -- Toggle Player List Button
- local PlayerListToggleButton = Instance.new("TextButton")
- PlayerListToggleButton.Size = UDim2.new(0, 230, 0, 40)
- PlayerListToggleButton.Position = UDim2.new(0, 10, 0, 160)
- PlayerListToggleButton.BackgroundColor3 = Color3.fromRGB(255, 200, 100)
- PlayerListToggleButton.Text = "Show Player List"
- PlayerListToggleButton.Font = Enum.Font.GothamBold
- PlayerListToggleButton.TextSize = 14
- PlayerListToggleButton.Parent = MainFrame
- -- Walk Speed Button
- local WalkSpeedButton = Instance.new("TextButton")
- WalkSpeedButton.Size = UDim2.new(0, 230, 0, 40)
- WalkSpeedButton.Position = UDim2.new(0, 10, 0, 210)
- WalkSpeedButton.BackgroundColor3 = Color3.fromRGB(100, 200, 255)
- WalkSpeedButton.Text = "Set Walk Speed"
- WalkSpeedButton.Font = Enum.Font.GothamBold
- WalkSpeedButton.TextSize = 14
- WalkSpeedButton.Parent = MainFrame
- -- Player List Frame
- local PlayerListFrame = Instance.new("ScrollingFrame")
- PlayerListFrame.Size = UDim2.new(0, 230, 0, 140)
- PlayerListFrame.Position = UDim2.new(0, 10, 0, 260)
- PlayerListFrame.BackgroundColor3 = Color3.fromRGB(70, 70, 70)
- PlayerListFrame.ScrollBarThickness = 8
- PlayerListFrame.Visible = false
- PlayerListFrame.Parent = MainFrame
- local UIListLayout = Instance.new("UIListLayout")
- UIListLayout.Parent = PlayerListFrame
- UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
- -- Function to create ESP
- local function createESP(player)
- if not playerColors[player] then
- playerColors[player] = getUniqueColor()
- end
- local color = playerColors[player]
- local highlight = Instance.new("Highlight")
- highlight.Adornee = player.Character
- highlight.FillColor = color
- highlight.FillTransparency = 0.5
- highlight.OutlineColor = color
- highlight.OutlineTransparency = 0
- highlight.Parent = player.Character
- espData[player] = highlight
- end
- -- Function to remove ESP
- local function removeESP(player)
- if espData[player] then
- espData[player]:Destroy()
- espData[player] = nil
- end
- playerColors[player] = nil
- end
- -- Function to update the player list
- local function updatePlayerList()
- for _, child in pairs(PlayerListFrame:GetChildren()) do
- if child:IsA("TextButton") then
- child:Destroy()
- end
- end
- for _, player in ipairs(Players:GetPlayers()) do
- if player ~= Players.LocalPlayer then
- local button = Instance.new("TextButton")
- button.Size = UDim2.new(1, 0, 0, 30)
- button.Text = player.Name
- button.Font = Enum.Font.GothamBold
- button.TextSize = 14
- button.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
- button.TextColor3 = Color3.fromRGB(255, 255, 255)
- button.Parent = PlayerListFrame
- button.MouseButton1Click:Connect(function()
- spectatingPlayer = player
- Camera.CameraSubject = player.Character:FindFirstChild("Humanoid")
- end)
- end
- end
- end
- -- Function to toggle ESP
- local function toggleESP()
- isESPEnabled = not isESPEnabled
- ESPButton.Text = "ESP: " .. (isESPEnabled and "ON" or "OFF")
- if isESPEnabled then
- for _, player in ipairs(Players:GetPlayers()) do
- if player ~= Players.LocalPlayer then
- createESP(player)
- end
- end
- else
- for _, player in ipairs(Players:GetPlayers()) do
- if player ~= Players.LocalPlayer then
- removeESP(player)
- end
- end
- end
- end
- -- Function to set walk speed
- local function setWalkSpeed()
- local speedInput = tonumber(game:GetService("Players").LocalPlayer:RequestStream({ "InputDialog" }, "Set Walk Speed (1-800): "))
- if speedInput and speedInput >= 1 and speedInput <= 800 then
- if Players.LocalPlayer.Character and Players.LocalPlayer.Character:FindFirstChild("Humanoid") then
- Players.LocalPlayer.Character.Humanoid.WalkSpeed = speedInput
- end
- else
- warn("Invalid speed entered!")
- end
- end
- -- Button Events
- ESPButton.MouseButton1Click:Connect(toggleESP)
- PlayerListToggleButton.MouseButton1Click:Connect(function()
- playerListVisible = not playerListVisible
- PlayerListFrame.Visible = playerListVisible
- PlayerListToggleButton.Text = playerListVisible and "Hide Player List" or "Show Player List"
- if playerListVisible then
- updatePlayerList()
- end
- end)
- SpectateButton.MouseButton1Click:Connect(function()
- if not spectatingPlayer then
- warn("Select a player to spectate from the Player List.")
- end
- end)
- UnSpectateButton.MouseButton1Click:Connect(function()
- spectatingPlayer = nil
- Camera.CameraSubject = Players.LocalPlayer.Character:FindFirstChild("Humanoid")
- end)
- WalkSpeedButton.MouseButton1Click:Connect(setWalkSpeed)
Advertisement
Add Comment
Please, Sign In to add comment