local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local player = Players.LocalPlayer
local camera = workspace.CurrentCamera
local fovEnabled = false
local espEnabled = false
local AIM_RADIUS = 150
local AIM_STRENGTH = 0.15
-- GUI
local gui = Instance.new("ScreenGui")
gui.Parent = player:WaitForChild("PlayerGui")
gui.ResetOnSpawn = false
gui.IgnoreGuiInset = true
local frame = Instance.new("Frame")
frame.Size = UDim2.new(0,200,0,130)
frame.Position = UDim2.new(1,-220,0,20)
frame.BackgroundColor3 = Color3.fromRGB(35,35,35)
frame.Active = true
frame.Draggable = true
frame.Parent = gui
local title = Instance.new("TextLabel")
title.Size = UDim2.new(1,0,0,30)
title.BackgroundTransparency = 1
title.Text = "Hunt's Script"
title.TextColor3 = Color3.new(1,1,1)
title.TextScaled = true
title.Parent = frame
local fovLabel = Instance.new("TextLabel")
fovLabel.Size = UDim2.new(1,-10,0,40)
fovLabel.Position = UDim2.new(0,5,0,35)
fovLabel.BackgroundColor3 = Color3.fromRGB(50,50,50)
fovLabel.TextColor3 = Color3.new(1,1,1)
fovLabel.TextScaled = true
fovLabel.Text = "FOV : OFF (Press Y)"
fovLabel.Parent = frame
local espLabel = Instance.new("TextLabel")
espLabel.Size = UDim2.new(1,-10,0,40)
espLabel.Position = UDim2.new(0,5,0,80)
espLabel.BackgroundColor3 = Color3.fromRGB(50,50,50)
espLabel.TextColor3 = Color3.new(1,1,1)
espLabel.TextScaled = true
espLabel.Text = "ESP : OFF (Press U)"
espLabel.Parent = frame
-- FOV circle
local circle = Drawing.new("Circle")
circle.Thickness = 2
circle.Radius = AIM_RADIUS
circle.Filled = false
circle.Color = Color3.fromRGB(255,0,0)
circle.Visible = false
-- line of sight check
local function hasLineOfSight(target)
local origin = camera.CFrame.Position
local direction = target.Position - origin
local params = RaycastParams.new()
params.FilterDescendantsInstances = {player.Character}
params.FilterType = Enum.RaycastFilterType.Blacklist
local result = workspace:Raycast(origin, direction, params)
if result and result.Instance:IsDescendantOf(target.Parent) then
return true
end
return false
end
-- find closest player
local function getClosestPlayer()
local closest = nil
local shortest = AIM_RADIUS
local center = Vector2.new(camera.ViewportSize.X/2, camera.ViewportSize.Y/2)
for _,p in pairs(Players:GetPlayers()) do
if p ~= player and p.Character and p.Character:FindFirstChild("Head") then
local head = p.Character.Head
local pos, visible = camera:WorldToViewportPoint(head.Position)
if visible and hasLineOfSight(head) then
local dist = (Vector2.new(pos.X,pos.Y) - center).Magnitude
if dist < shortest then
shortest = dist
closest = p
end
end
end
end
return closest
end
-- ESP system
local function applyESP()
for _,p in pairs(Players:GetPlayers()) do
if p ~= player and p.Character then
local h = p.Character:FindFirstChild("Highlight")
if espEnabled then
if not h then
h = Instance.new("Highlight")
h.Parent = p.Character
end
h.FillColor = Color3.fromRGB(255,0,0)
h.OutlineColor = Color3.new(1,1,1)
else
if h then
h:Destroy()
end
end
end
end
end
-- respawn support
for _,p in pairs(Players:GetPlayers()) do
p.CharacterAdded:Connect(function()
task.wait(0.5)
applyESP()
end)
end
Players.PlayerAdded:Connect(function(p)
p.CharacterAdded:Connect(function()
task.wait(0.5)
applyESP()
end)
end)
-- keyboard controls
UserInputService.InputBegan:Connect(function(input, processed)
if processed then return end
if input.KeyCode == Enum.KeyCode.Y then
fovEnabled = not fovEnabled
fovLabel.Text = "FOV : "..(fovEnabled and "ON" or "OFF").." (Press Y)"
circle.Visible = fovEnabled
end
if input.KeyCode == Enum.KeyCode.U then
espEnabled = not espEnabled
espLabel.Text = "ESP : "..(espEnabled and "ON" or "OFF").." (Press U)"
applyESP()
end
end)
-- main loop
RunService.RenderStepped:Connect(function()
if fovEnabled then
circle.Position = Vector2.new(camera.ViewportSize.X/2, camera.ViewportSize.Y/2)
local target = getClosestPlayer()
if target and target.Character then
local head = target.Character.Head
local newLook = CFrame.new(camera.CFrame.Position, head.Position)
camera.CFrame = camera.CFrame:Lerp(newLook, AIM_STRENGTH)
end
end
if espEnabled then
applyESP()
end
end)
local discordButton = Instance.new("TextButton")
discordButton.Size = UDim2.new(1,-10,0,40)
discordButton.Position = UDim2.new(0,5,0,125)
discordButton.BackgroundColor3 = Color3.fromRGB(80,80,80)
discordButton.TextColor3 = Color3.new(1,1,1)
discordButton.TextScaled = true
discordButton.Text = "Join Discord"
discordButton.Parent = frame
local discordLink = "https://discord.gg/ThpY2qaWSd"
discordButton.MouseButton1Click:Connect(function()
-- try clipboard (works in some environments)
if setclipboard then
setclipboard(discordLink)
discordButton.Text = "Copied!"
task.wait(2)
discordButton.Text = "Join Discord"
else
-- fallback: show textbox so player can copy
local copyBox = Instance.new("TextBox")
copyBox.Size = UDim2.new(0,300,0,40)
copyBox.Position = UDim2.new(0.5,-150,0.5,-20)
copyBox.Text = discordLink
copyBox.TextScaled = true
copyBox.ClearTextOnFocus = false
copyBox.Parent = gui
copyBox:CaptureFocus()
end
end)
Comments
If Not Working In Any Executer Join The Discord And Ping Me In The Chat