Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Echam ESP GUI Full Script
- local Players = game:GetService("Players")
- local RunService = game:GetService("RunService")
- local LocalPlayer = Players.LocalPlayer
- local CoreGui = game:GetService("CoreGui")
- -- Settings
- local ESPEnabled = true
- local ChamEnabled = true
- local OutlineEnabled = true
- local ShowNameHealth = true
- local ShowDistance = true
- local ChamTransparency = 0.6
- local DefaultColor = Color3.fromRGB(0,255,0)
- -- Health color function
- local function getColor(health)
- if health < 2 then
- return Color3.fromRGB(128,0,128)
- elseif health < 25 then
- return Color3.fromRGB(255,0,0)
- elseif health < 75 then
- return Color3.fromRGB(255,255,0)
- else
- return DefaultColor
- end
- end
- -- Main ScreenGui
- local screenGui = Instance.new("ScreenGui")
- screenGui.Name = "EchamGUI"
- screenGui.Parent = CoreGui
- -- Main Frame
- local mainFrame = Instance.new("Frame")
- mainFrame.Size = UDim2.new(0,200,0,220)
- mainFrame.Position = UDim2.new(0,50,0,50)
- mainFrame.BackgroundColor3 = Color3.fromRGB(40,40,40)
- mainFrame.BorderSizePixel = 0
- mainFrame.Parent = screenGui
- -- Top bar for dragging
- local topBar = Instance.new("Frame")
- topBar.Size = UDim2.new(1,0,0,30)
- topBar.BackgroundColor3 = Color3.fromRGB(20,20,20)
- topBar.BorderSizePixel = 0
- topBar.Parent = mainFrame
- local title = Instance.new("TextLabel")
- title.Size = UDim2.new(1,0,1,0)
- title.Text = "Echam"
- title.TextColor3 = Color3.new(1,1,1)
- title.BackgroundTransparency = 1
- title.Font = Enum.Font.SourceSansBold
- title.TextScaled = true
- title.Parent = topBar
- -- Close button
- local closeBtn = Instance.new("TextButton")
- closeBtn.Size = UDim2.new(0,25,0,25)
- closeBtn.Position = UDim2.new(1,-30,0,2)
- closeBtn.Text = "X"
- closeBtn.BackgroundColor3 = Color3.fromRGB(200,0,0)
- closeBtn.TextColor3 = Color3.new(1,1,1)
- closeBtn.Font = Enum.Font.SourceSansBold
- closeBtn.TextScaled = true
- closeBtn.Parent = topBar
- -- Minimize button
- local minimizeBtn = Instance.new("TextButton")
- minimizeBtn.Size = UDim2.new(0,25,0,25)
- minimizeBtn.Position = UDim2.new(1,-60,0,2)
- minimizeBtn.Text = "_"
- minimizeBtn.BackgroundColor3 = Color3.fromRGB(150,150,150)
- minimizeBtn.TextColor3 = Color3.new(0,0,0)
- minimizeBtn.Font = Enum.Font.SourceSansBold
- minimizeBtn.TextScaled = true
- minimizeBtn.Parent = topBar
- -- Toggle buttons frame
- local togglesFrame = Instance.new("Frame")
- togglesFrame.Size = UDim2.new(1,0,1,-30)
- togglesFrame.Position = UDim2.new(0,0,0,30)
- togglesFrame.BackgroundTransparency = 1
- togglesFrame.Parent = mainFrame
- -- Function to create toggle buttons
- local function createToggleButton(text,pos,callback,getState)
- local btn = Instance.new("TextButton")
- btn.Size = UDim2.new(0,160,0,30)
- btn.Position = pos
- btn.Text = text..": ON"
- btn.BackgroundColor3 = Color3.fromRGB(50,50,50)
- btn.TextColor3 = Color3.new(1,1,1)
- btn.Font = Enum.Font.SourceSansBold
- btn.TextScaled = true
- btn.Parent = togglesFrame
- btn.MouseButton1Click:Connect(function()
- callback()
- local state = getState() and "ON" or "OFF"
- btn.Text = text..": "..state
- end)
- return btn
- end
- -- Create toggles
- local toggleButtons = {}
- toggleButtons.ESP = createToggleButton("ESP", UDim2.new(0,20,0,10), function() ESPEnabled = not ESPEnabled end, function() return ESPEnabled end)
- toggleButtons.Cham = createToggleButton("Cham", UDim2.new(0,20,0,50), function() ChamEnabled = not ChamEnabled end, function() return ChamEnabled end)
- toggleButtons.Outline = createToggleButton("Outline", UDim2.new(0,20,0,90), function() OutlineEnabled = not OutlineEnabled end, function() return OutlineEnabled end)
- toggleButtons.NameHealth = createToggleButton("Name/Health", UDim2.new(0,20,0,130), function() ShowNameHealth = not ShowNameHealth end, function() return ShowNameHealth end)
- toggleButtons.Distance = createToggleButton("Distance", UDim2.new(0,20,0,170), function() ShowDistance = not ShowDistance end, function() return ShowDistance end)
- -- Draggable function for a handle dragging a target
- local function makeDraggable(handle, target)
- local dragging, dragInput, dragStart, startPos
- handle.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- dragging = true
- dragStart = input.Position
- startPos = target.Position
- input.Changed:Connect(function()
- if input.UserInputState == Enum.UserInputState.End then
- dragging = false
- end
- end)
- end
- end)
- handle.InputChanged:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseMovement then
- dragInput = input
- end
- end)
- RunService.RenderStepped:Connect(function()
- if dragging and dragInput then
- local delta = dragInput.Position - dragStart
- target.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X,
- startPos.Y.Scale, startPos.Y.Offset + delta.Y)
- end
- end)
- end
- -- Apply draggable to top bar dragging the main frame
- makeDraggable(topBar, mainFrame)
- -- Minimize / restore
- local minimized = false
- local smallCircle
- local function restoreGUI()
- minimized = false
- mainFrame.Visible = true
- if smallCircle then
- smallCircle:Destroy()
- smallCircle = nil
- end
- end
- minimizeBtn.MouseButton1Click:Connect(function()
- minimized = true
- mainFrame.Visible = false
- smallCircle = Instance.new("TextButton")
- smallCircle.Size = UDim2.new(0,50,0,50)
- smallCircle.Position = UDim2.new(0,10,0,10)
- smallCircle.Text = "EC"
- smallCircle.BackgroundColor3 = Color3.fromRGB(50,50,50)
- smallCircle.TextColor3 = Color3.new(1,1,1)
- smallCircle.Font = Enum.Font.SourceSansBold
- smallCircle.TextScaled = true
- smallCircle.Parent = screenGui
- -- Make draggable
- makeDraggable(smallCircle, smallCircle)
- smallCircle.MouseButton1Click:Connect(function()
- restoreGUI()
- end)
- end)
- closeBtn.MouseButton1Click:Connect(function()
- screenGui:Destroy()
- end)
- -- ESP Implementation
- local ESPObjects = {}
- local function createESP(player)
- if player == LocalPlayer then return end
- if ESPObjects[player] then return end
- local char = player.Character
- if not char then return end
- local hrp = char:FindFirstChild("HumanoidRootPart")
- local hum = char:FindFirstChildOfClass("Humanoid")
- if not hrp or not hum then return end
- local bill = Instance.new("BillboardGui")
- bill.Name = "ESPBillboard"
- bill.Adornee = hrp
- bill.Size = UDim2.new(0,150,0,50)
- bill.StudsOffset = Vector3.new(0,3,0)
- bill.AlwaysOnTop = true
- local nameLabel = Instance.new("TextLabel")
- nameLabel.Size = UDim2.new(1,0,0.5,0)
- nameLabel.BackgroundTransparency = 1
- nameLabel.Font = Enum.Font.SourceSansBold
- nameLabel.TextScaled = true
- nameLabel.Text = player.Name
- nameLabel.Parent = bill
- local healthLabel = Instance.new("TextLabel")
- healthLabel.Size = UDim2.new(1,0,0.5,0)
- healthLabel.Position = UDim2.new(0,0,0.5,0)
- healthLabel.BackgroundTransparency = 1
- healthLabel.Font = Enum.Font.SourceSansBold
- healthLabel.TextScaled = true
- healthLabel.Text = tostring(math.floor(hum.Health))
- healthLabel.Parent = bill
- local distanceLabel = Instance.new("TextLabel")
- distanceLabel.Size = UDim2.new(1,0,0,20)
- distanceLabel.Position = UDim2.new(0,0,1,0)
- distanceLabel.BackgroundTransparency = 1
- distanceLabel.Font = Enum.Font.SourceSans
- distanceLabel.TextScaled = true
- distanceLabel.Text = ""
- distanceLabel.TextColor3 = Color3.new(1,1,1)
- distanceLabel.Parent = bill
- bill.Parent = CoreGui
- local highlight = Instance.new("Highlight")
- highlight.Adornee = char
- highlight.FillTransparency = ChamTransparency
- highlight.OutlineTransparency = 0
- highlight.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop
- highlight.Parent = CoreGui
- ESPObjects[player] = {bill=bill, highlight=highlight, hum=hum, nameLabel=nameLabel, healthLabel=healthLabel, distanceLabel=distanceLabel}
- RunService.RenderStepped:Connect(function()
- if not char.Parent then
- bill:Destroy()
- highlight:Destroy()
- ESPObjects[player] = nil
- return
- end
- local currentHealth = math.max(0, hum.Health)
- local color = getColor(currentHealth)
- -- Toggle elements properly
- bill.Enabled = ESPEnabled and not minimized
- highlight.Enabled = ChamEnabled and not minimized
- highlight.OutlineTransparency = OutlineEnabled and 0 or 1
- nameLabel.Visible = ShowNameHealth
- healthLabel.Visible = ShowNameHealth
- distanceLabel.Visible = ShowDistance
- if ShowDistance and LocalPlayer.Character and LocalPlayer.Character:FindFirstChild("HumanoidRootPart") then
- local dist = (LocalPlayer.Character.HumanoidRootPart.Position - hrp.Position).Magnitude
- distanceLabel.Text = string.format("%.1f studs", dist)
- else
- distanceLabel.Text = ""
- end
- nameLabel.TextColor3 = color
- healthLabel.TextColor3 = color
- highlight.FillColor = color
- highlight.OutlineColor = color
- healthLabel.Text = tostring(math.floor(currentHealth))
- end)
- end
- Players.PlayerAdded:Connect(function(player)
- player.CharacterAdded:Connect(function()
- createESP(player)
- end)
- end)
- for _,player in pairs(Players:GetPlayers()) do
- if player.Character then
- createESP(player)
- end
- end
Advertisement