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 LocalPlayer = Players.LocalPlayer
- -- Toggles
- local espEnabled = false
- local nameEspEnabled = false
- local crosshairEnabled = false
- -- Create the GUI
- local screenGui = Instance.new("ScreenGui")
- screenGui.Name = "SimpleFeatures_GUI"
- screenGui.Parent = LocalPlayer:WaitForChild("PlayerGui")
- screenGui.ResetOnSpawn = false -- Ensures the GUI doesn't disappear when the player respawns
- -- Main frame for the GUI
- local mainFrame = Instance.new("Frame")
- mainFrame.Size = UDim2.new(0, 200, 0, 300)
- mainFrame.Position = UDim2.new(0.1, 0, 0.1, 0)
- mainFrame.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
- mainFrame.BorderSizePixel = 0
- mainFrame.Parent = screenGui
- -- Title Label
- local title = Instance.new("TextLabel")
- title.Size = UDim2.new(1, 0, 0, 40)
- title.BackgroundTransparency = 1
- title.Text = "Simple Features"
- title.TextColor3 = Color3.fromRGB(255, 255, 255)
- title.Font = Enum.Font.SourceSansBold
- title.TextSize = 22
- title.Parent = mainFrame
- -- Toggle ESP Button
- local toggleESPButton = Instance.new("TextButton")
- toggleESPButton.Size = UDim2.new(1, 0, 0, 40)
- toggleESPButton.Position = UDim2.new(0, 0, 0, 50)
- toggleESPButton.Text = "Toggle ESP"
- toggleESPButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- toggleESPButton.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
- toggleESPButton.Font = Enum.Font.SourceSans
- toggleESPButton.TextSize = 18
- toggleESPButton.Parent = mainFrame
- -- Toggle Name ESP Button
- local toggleNameESPButton = Instance.new("TextButton")
- toggleNameESPButton.Size = UDim2.new(1, 0, 0, 40)
- toggleNameESPButton.Position = UDim2.new(0, 0, 0, 100)
- toggleNameESPButton.Text = "Toggle Name ESP"
- toggleNameESPButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- toggleNameESPButton.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
- toggleNameESPButton.Font = Enum.Font.SourceSans
- toggleNameESPButton.TextSize = 18
- toggleNameESPButton.Parent = mainFrame
- -- Toggle Crosshair Button
- local toggleCrosshairButton = Instance.new("TextButton")
- toggleCrosshairButton.Size = UDim2.new(1, 0, 0, 40)
- toggleCrosshairButton.Position = UDim2.new(0, 0, 0, 150)
- toggleCrosshairButton.Text = "Toggle Crosshair"
- toggleCrosshairButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- toggleCrosshairButton.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
- toggleCrosshairButton.Font = Enum.Font.SourceSans
- toggleCrosshairButton.TextSize = 18
- toggleCrosshairButton.Parent = mainFrame
- -- Close Button
- local closeButton = Instance.new("TextButton")
- closeButton.Size = UDim2.new(0, 40, 0, 40)
- closeButton.Position = UDim2.new(1, -50, 0, 10)
- closeButton.Text = "X"
- closeButton.TextColor3 = Color3.fromRGB(255, 0, 0)
- closeButton.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
- closeButton.Font = Enum.Font.SourceSans
- closeButton.TextSize = 18
- closeButton.Parent = mainFrame
- -- Crosshair elements
- local crosshairVertical = Instance.new("Frame")
- crosshairVertical.Size = UDim2.new(0, 2, 0, 20) -- Thin vertical line
- crosshairVertical.Position = UDim2.new(0.5, -1, 0.5, -10)
- crosshairVertical.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- crosshairVertical.Visible = false
- crosshairVertical.Parent = screenGui
- local crosshairHorizontal = Instance.new("Frame")
- crosshairHorizontal.Size = UDim2.new(0, 20, 0, 2) -- Thin horizontal line
- crosshairHorizontal.Position = UDim2.new(0.5, -10, 0.5, -1)
- crosshairHorizontal.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- crosshairHorizontal.Visible = false
- crosshairHorizontal.Parent = screenGui
- -- Functions for toggling ESP, Name ESP, and Crosshair
- local function toggleESP()
- espEnabled = not espEnabled
- if espEnabled then
- toggleESPButton.Text = "ESP: ON"
- toggleESPButton.BackgroundColor3 = Color3.fromRGB(0, 255, 0)
- print("ESP Enabled")
- -- ESP Logic
- for _, player in pairs(Players:GetPlayers()) do
- if player ~= LocalPlayer then
- local highlight = Instance.new("Highlight")
- highlight.FillColor = Color3.fromRGB(255, 0, 0)
- highlight.OutlineColor = Color3.fromRGB(255, 255, 255)
- highlight.Parent = player.Character
- end
- end
- else
- toggleESPButton.Text = "ESP: OFF"
- toggleESPButton.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
- print("ESP Disabled")
- -- Disable ESP
- for _, player in pairs(Players:GetPlayers()) do
- if player ~= LocalPlayer and player.Character then
- for _, v in pairs(player.Character:GetChildren()) do
- if v:IsA("Highlight") then
- v:Destroy()
- end
- end
- end
- end
- end
- end
- local function toggleNameESP()
- nameEspEnabled = not nameEspEnabled
- if nameEspEnabled then
- toggleNameESPButton.Text = "Name ESP: ON"
- toggleNameESPButton.BackgroundColor3 = Color3.fromRGB(0, 255, 0)
- print("Name ESP Enabled")
- -- Name ESP Logic
- for _, player in pairs(Players:GetPlayers()) do
- if player ~= LocalPlayer and player.Character and player.Character:FindFirstChild("Head") then
- local nameTag = Instance.new("BillboardGui", player.Character.Head)
- nameTag.Name = "NameTag"
- nameTag.Size = UDim2.new(0, 100, 0, 40)
- nameTag.AlwaysOnTop = true
- local nameLabel = Instance.new("TextLabel", nameTag)
- nameLabel.Size = UDim2.new(1, 0, 1, 0)
- nameLabel.Text = player.Name
- nameLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
- nameLabel.BackgroundTransparency = 1
- end
- end
- else
- toggleNameESPButton.Text = "Name ESP: OFF"
- toggleNameESPButton.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
- print("Name ESP Disabled")
- -- Disable Name ESP
- for _, player in pairs(Players:GetPlayers()) do
- if player.Character and player.Character:FindFirstChild("Head") then
- local nameTag = player.Character.Head:FindFirstChild("NameTag")
- if nameTag then
- nameTag:Destroy()
- end
- end
- end
- end
- end
- local function toggleCrosshair()
- crosshairEnabled = not crosshairEnabled
- if crosshairEnabled then
- toggleCrosshairButton.Text = "Crosshair: ON"
- toggleCrosshairButton.BackgroundColor3 = Color3.fromRGB(0, 255, 0)
- crosshairVertical.Visible = true
- crosshairHorizontal.Visible = true
- print("Crosshair Enabled")
- else
- toggleCrosshairButton.Text = "Crosshair: OFF"
- toggleCrosshairButton.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
- crosshairVertical.Visible = false
- crosshairHorizontal.Visible = false
- print("Crosshair Disabled")
- end
- end
- -- Button Connections
- toggleESPButton.MouseButton1Click:Connect(toggleESP)
- toggleNameESPButton.MouseButton1Click:Connect(toggleNameESP)
- toggleCrosshairButton.MouseButton1Click:Connect(toggleCrosshair)
- -- Close the GUI when the close button is pressed
- closeButton.MouseButton1Click:Connect(function()
- mainFrame.Visible = not mainFrame.Visible
- end)
Advertisement
Add Comment
Please, Sign In to add comment