Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Luna Scripts Legit Aimbot – Purple Edition (Full Fixed Keybinds + ESP + Scroll GUI)
- if not game:IsLoaded() then game.Loaded:Wait() end
- -- Services & Config
- local UIS = game:GetService("UserInputService")
- local RS = game:GetService("RunService")
- local PL = game:GetService("Players").LocalPlayer
- local Cam = workspace.CurrentCamera
- local HttpService = game:GetService("HttpService")
- local CONFIG_FILE = "LunaAimbotConfig.json"
- -- Settings defaults
- local Settings = {
- FOV = 150,
- Speed = 0.25,
- Prediction = 0.14,
- FOVVisible = true,
- VisibleCheck = true,
- AntiDetection = false,
- TargetBone = "Head",
- AimbotEnabled = false,
- KeybindAim = "MouseButton2",
- KeybindToggleUI = "RightControl",
- ESPEnabled = false,
- ESPBoxes = false,
- ESPNames = false,
- ESPHealth = false
- }
- -- Load / Save config
- local function saveConfig()
- if writefile then writefile(CONFIG_FILE, HttpService:JSONEncode(Settings)) end
- end
- local function loadConfig()
- if isfile and readfile and isfile(CONFIG_FILE) then
- local ok, t = pcall(function()
- return HttpService:JSONDecode(readfile(CONFIG_FILE))
- end)
- if ok and type(t) == "table" then
- for k,v in pairs(t) do
- if Settings[k] ~= nil then Settings[k] = t[k] end
- end
- end
- end
- end
- loadConfig()
- -- FOV circle
- local FOVCircle = Drawing.new("Circle")
- FOVCircle.Thickness = 1
- FOVCircle.Radius = Settings.FOV
- FOVCircle.Color = Color3.fromRGB(170, 0, 255)
- FOVCircle.Filled = false
- FOVCircle.Visible = Settings.FOVVisible
- local aiming = false
- local TOPBAR = 36
- -- Utility functions
- local function isEnemy(p)
- local c = p.Character
- return p ~= PL and c and c:FindFirstChild("Humanoid") and c.Humanoid.Health > 0
- end
- local function getBone(p)
- local c = p.Character
- if not c then return end
- if Settings.TargetBone == "Head" then
- return c:FindFirstChild("Head")
- elseif Settings.TargetBone == "Torso" then
- return c:FindFirstChild("UpperTorso") or c:FindFirstChild("Torso")
- else -- Realistic
- return (math.random() < 0.7 and c:FindFirstChild("Head")) or c:FindFirstChild("UpperTorso") or c:FindFirstChild("Torso")
- end
- end
- local function partVisible(part)
- local rp = RaycastParams.new()
- rp.FilterDescendantsInstances = {PL.Character}
- rp.FilterType = Enum.RaycastFilterType.Blacklist
- local res = workspace:Raycast(Cam.CFrame.Position, (part.Position - Cam.CFrame.Position).Unit * 1000, rp)
- return res and res.Instance and res.Instance:IsDescendantOf(part.Parent)
- end
- local function getClosest()
- local m = UIS:GetMouseLocation()
- local best, bestDist = nil, Settings.FOV
- for _,p in pairs(game:GetService("Players"):GetPlayers()) do
- if isEnemy(p) then
- local b = getBone(p)
- if b then
- local sp, ons = Cam:WorldToViewportPoint(b.Position)
- if ons then
- local d = (Vector2.new(sp.X, sp.Y) - Vector2.new(m.X, m.Y - TOPBAR)).Magnitude
- if d < bestDist then
- if not Settings.VisibleCheck or partVisible(b) then
- bestDist = d
- best = b
- end
- end
- end
- end
- end
- end
- return best
- end
- -- Helper: input matches keybind string (mouse or keyboard)
- local function inputMatchesKey(input, keybindStr)
- if not input or not keybindStr then return false end
- if keybindStr:match("^MouseButton%d$") then
- return input.UserInputType.Name == keybindStr
- else
- return input.KeyCode and input.KeyCode.Name == keybindStr
- end
- end
- -- Aimbot movement
- RS.RenderStepped:Connect(function()
- local m = UIS:GetMouseLocation()
- FOVCircle.Position = Vector2.new(m.X, m.Y - TOPBAR)
- FOVCircle.Radius = Settings.FOV
- FOVCircle.Visible = Settings.FOVVisible and Settings.AimbotEnabled
- if aiming and Settings.AimbotEnabled then
- local b = getClosest()
- if b then
- local pred = b.Position + b.Velocity * Settings.Prediction
- local sp, ons = Cam:WorldToViewportPoint(pred)
- if ons and sp.Z > 0 then
- local dx = sp.X - m.X
- local dy = sp.Y - (m.Y - TOPBAR)
- if Settings.AntiDetection then
- dx += math.random(-3,3)
- dy += math.random(-3,3)
- end
- mousemoverel(dx * Settings.Speed, dy * Settings.Speed)
- end
- end
- end
- end)
- -- GUI Setup
- local gui = Instance.new("ScreenGui", game.CoreGui)
- gui.Name = "LunaGui"
- gui.ResetOnSpawn = false
- gui.Enabled = true
- local bg = Instance.new("Frame", gui)
- bg.Size = UDim2.new(0, 350, 0, 500)
- bg.Position = UDim2.new(0, 50, 0, 50)
- bg.BackgroundColor3 = Color3.fromRGB(25, 0, 50)
- bg.BorderSizePixel = 0
- bg.ClipsDescendants = true
- local bar = Instance.new("Frame", bg)
- bar.Size = UDim2.new(1,0,0,TOPBAR)
- bar.BackgroundColor3 = Color3.fromRGB(120, 0, 255)
- bar.Active = true
- bar.Selectable = true
- -- Dragging logic for whole bg via bar
- local dragging, dragStart, startPos
- bar.InputBegan:Connect(function(i)
- if i.UserInputType == Enum.UserInputType.MouseButton1 then
- dragging = true
- dragStart = i.Position
- startPos = bg.Position
- i.Changed:Connect(function()
- if i.UserInputState == Enum.UserInputState.End then
- dragging = false
- end
- end)
- end
- end)
- bar.InputChanged:Connect(function(i)
- if dragging and i.UserInputType == Enum.UserInputType.MouseMovement then
- local delta = i.Position - dragStart
- bg.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X,
- startPos.Y.Scale, startPos.Y.Offset + delta.Y)
- end
- end)
- -- Title
- local title = Instance.new("TextLabel", bar)
- title.Size = UDim2.new(1, -60, 1, 0)
- title.Position = UDim2.new(0, 12, 0, 0)
- title.BackgroundTransparency = 1
- title.Font = Enum.Font.GothamSemibold
- title.Text = "LUNA SCRIPTS"
- title.TextSize = 20
- title.TextColor3 = Color3.new(1, 1, 1)
- title.TextXAlignment = Enum.TextXAlignment.Left
- title.TextYAlignment = Enum.TextYAlignment.Center
- -- Minimize button
- local minBtn = Instance.new("TextButton", bar)
- minBtn.Size = UDim2.new(0, 48, 0, TOPBAR - 8)
- minBtn.Position = UDim2.new(1, -52, 0, 4)
- minBtn.BackgroundColor3 = Color3.fromRGB(90, 0, 180)
- minBtn.Font = Enum.Font.GothamBold
- minBtn.TextSize = 20
- minBtn.Text = "─"
- minBtn.TextColor3 = Color3.new(1,1,1)
- minBtn.AutoButtonColor = false
- minBtn.MouseButton1Click:Connect(function()
- local hidden = bg.Size.Y.Offset > TOPBAR
- bg.Size = hidden and UDim2.new(0,350,0,TOPBAR) or UDim2.new(0,350,0,500)
- minBtn.Text = hidden and "▣" or "─"
- end)
- -- Tabs frame
- local tabs = Instance.new("Frame", bg)
- tabs.Size = UDim2.new(1, 0, 0, TOPBAR)
- tabs.Position = UDim2.new(0, 0, 0, TOPBAR)
- tabs.BackgroundColor3 = Color3.fromRGB(40, 0, 80)
- -- Scrolling frame for pages
- local pages = Instance.new("ScrollingFrame", bg)
- pages.Size = UDim2.new(1, 0, 1, -TOPBAR*2)
- pages.Position = UDim2.new(0, 0, 0, TOPBAR*2)
- pages.CanvasSize = UDim2.new(0, 0, 2, 0)
- pages.ScrollBarThickness = 6
- pages.BackgroundTransparency = 1
- pages.VerticalScrollBarInset = Enum.ScrollBarInset.Always
- -- Tab buttons creator
- local function createTab(name)
- local btn = Instance.new("TextButton", tabs)
- btn.Size = UDim2.new(0, 80, 1, 0)
- btn.Text = name
- btn.Font = Enum.Font.GothamBold
- btn.TextSize = 18
- btn.TextColor3 = Color3.fromRGB(220, 220, 220)
- btn.BackgroundColor3 = Color3.fromRGB(70, 0, 130)
- btn.AutoButtonColor = false
- btn.BorderSizePixel = 0
- btn.Name = name .. "Tab"
- btn.MouseEnter:Connect(function() btn.BackgroundColor3 = Color3.fromRGB(120, 0, 255) end)
- btn.MouseLeave:Connect(function()
- if not btn:GetAttribute("Selected") then
- btn.BackgroundColor3 = Color3.fromRGB(70, 0, 130)
- end
- end)
- return btn
- end
- -- Pages creator
- local function createPage()
- local frame = Instance.new("Frame", pages)
- frame.Size = UDim2.new(1, 0, 0, 440)
- frame.BackgroundTransparency = 1
- frame.Visible = false
- return frame
- end
- -- Create Tabs and Pages
- local aimTabBtn = createTab("Aim")
- local espTabBtn = createTab("ESP")
- local miscTabBtn = createTab("Misc")
- aimTabBtn.Position = UDim2.new(0, 0, 0, 0)
- espTabBtn.Position = UDim2.new(0, 80, 0, 0)
- miscTabBtn.Position = UDim2.new(0, 160, 0, 0)
- local aimPage = createPage()
- local espPage = createPage()
- local miscPage = createPage()
- aimPage.Position = UDim2.new(0, 0, 0, 0)
- espPage.Position = UDim2.new(0, 0, 0, 440)
- miscPage.Position = UDim2.new(0, 0, 0, 880)
- -- Tab switch logic
- local function selectTab(selectedBtn, selectedPage)
- for _, btn in pairs(tabs:GetChildren()) do
- if btn:IsA("TextButton") then
- btn.BackgroundColor3 = Color3.fromRGB(70, 0, 130)
- btn:SetAttribute("Selected", false)
- end
- end
- for _, page in pairs(pages:GetChildren()) do
- if page:IsA("Frame") then
- page.Visible = false
- end
- end
- selectedBtn.BackgroundColor3 = Color3.fromRGB(120, 0, 255)
- selectedBtn:SetAttribute("Selected", true)
- selectedPage.Visible = true
- pages.CanvasPosition = Vector2.new(0, selectedPage.Position.Y.Offset)
- end
- selectTab(aimTabBtn, aimPage)
- aimTabBtn.MouseButton1Click:Connect(function()
- selectTab(aimTabBtn, aimPage)
- end)
- espTabBtn.MouseButton1Click:Connect(function()
- selectTab(espTabBtn, espPage)
- end)
- miscTabBtn.MouseButton1Click:Connect(function()
- selectTab(miscTabBtn, miscPage)
- end)
- -- Slider creator for aim page
- local ypos = 10
- local function makeSlider(parent, labelTxt, min, max, settingKey)
- local lbl = Instance.new("TextLabel", parent)
- lbl.Size = UDim2.new(0, 300, 0, 22)
- lbl.Position = UDim2.new(0, 20, 0, ypos)
- lbl.BackgroundTransparency = 1
- lbl.Font = Enum.Font.Gotham
- lbl.TextSize = 16
- lbl.TextColor3 = Color3.fromRGB(220, 220, 220)
- lbl.Text = labelTxt .. ": " .. string.format("%.3f", Settings[settingKey])
- local barBg = Instance.new("Frame", parent)
- barBg.Size = UDim2.new(0, 300, 0, 16)
- barBg.Position = UDim2.new(0, 20, 0, ypos + 24)
- barBg.BackgroundColor3 = Color3.fromRGB(50, 30, 70)
- barBg.BorderSizePixel = 0
- barBg.ClipsDescendants = true
- Instance.new("UICorner", barBg).CornerRadius = UDim.new(0, 6)
- local fill = Instance.new("Frame", barBg)
- fill.BackgroundColor3 = Color3.fromRGB(170, 0, 255)
- fill.Size = UDim2.new((Settings[settingKey] - min) / (max - min), 0, 1, 0)
- Instance.new("UICorner", fill).CornerRadius = UDim.new(0,6)
- local draggingS = false
- barBg.InputBegan:Connect(function(i) if i.UserInputType == Enum.UserInputType.MouseButton1 then draggingS = true end end)
- barBg.InputEnded:Connect(function(i) if i.UserInputType == Enum.UserInputType.MouseButton1 then draggingS = false saveConfig() end end)
- UIS.InputChanged:Connect(function(i)
- if draggingS and i.UserInputType == Enum.UserInputType.MouseMovement then
- local pct = math.clamp((i.Position.X - barBg.AbsolutePosition.X) / barBg.AbsoluteSize.X, 0, 1)
- fill.Size = UDim2.new(pct,0,1,0)
- Settings[settingKey] = min + (max - min) * pct
- lbl.Text = labelTxt .. ": " .. string.format("%.3f", Settings[settingKey])
- end
- end)
- ypos += 60
- end
- makeSlider(aimPage, "FOV Radius", 50, 400, "FOV")
- makeSlider(aimPage, "Aim Speed", 0.05, 1, "Speed")
- makeSlider(aimPage, "Prediction", 0, 0.4, "Prediction")
- -- Toggle creator (generic)
- local function makeToggle(parent, onTxt, offTxt, key, posY)
- local btn = Instance.new("TextButton", parent)
- btn.Size = UDim2.new(0, 300, 0, 38)
- btn.Position = UDim2.new(0, 20, 0, posY)
- btn.BackgroundColor3 = Color3.fromRGB(170, 0, 255)
- btn.Font = Enum.Font.GothamSemibold
- btn.TextSize = 18
- btn.AutoButtonColor = false
- btn.TextColor3 = Color3.new(1,1,1)
- btn.Text = Settings[key] and onTxt or offTxt
- btn.MouseEnter:Connect(function() btn.BackgroundColor3 = Color3.fromRGB(200, 50, 255) end)
- btn.MouseLeave:Connect(function() btn.BackgroundColor3 = Color3.fromRGB(170, 0, 255) end)
- btn.MouseButton1Click:Connect(function()
- Settings[key] = not Settings[key]
- btn.Text = Settings[key] and onTxt or offTxt
- saveConfig()
- end)
- end
- -- Aim toggles
- makeToggle(aimPage, "Aimbot: ON", "Aimbot: OFF", "AimbotEnabled", ypos)
- ypos += 50
- makeToggle(aimPage, "FOV Circle: ON", "FOV Circle: OFF", "FOVVisible", ypos)
- ypos += 50
- makeToggle(aimPage, "Vis Check: ON", "Vis Check: OFF", "VisibleCheck", ypos)
- ypos += 50
- makeToggle(aimPage, "Anti-Detect: ON", "Anti-Detect: OFF", "AntiDetection", ypos)
- ypos += 50
- -- Target Bone selector
- local boneLbl = Instance.new("TextLabel", aimPage)
- boneLbl.Size = UDim2.new(0, 300, 0, 22)
- boneLbl.Position = UDim2.new(0, 20, 0, ypos)
- boneLbl.BackgroundTransparency = 1
- boneLbl.Font = Enum.Font.Gotham
- boneLbl.TextSize = 16
- boneLbl.TextColor3 = Color3.fromRGB(220,220,220)
- boneLbl.Text = "Target Bone: " .. Settings.TargetBone
- ypos += 28
- local boneBtn = Instance.new("TextButton", aimPage)
- boneBtn.Size = UDim2.new(0, 300, 0, 38)
- boneBtn.Position = UDim2.new(0, 20, 0, ypos)
- boneBtn.BackgroundColor3 = Color3.fromRGB(170,0,255)
- boneBtn.Font = Enum.Font.GothamSemibold
- boneBtn.TextSize = 18
- boneBtn.TextColor3 = Color3.new(1,1,1)
- boneBtn.AutoButtonColor = false
- boneBtn.Text = Settings.TargetBone
- boneBtn.MouseEnter:Connect(function() boneBtn.BackgroundColor3 = Color3.fromRGB(200,50,255) end)
- boneBtn.MouseLeave:Connect(function() boneBtn.BackgroundColor3 = Color3.fromRGB(170,0,255) end)
- boneBtn.MouseButton1Click:Connect(function()
- local options = {"Head", "Torso", "Realistic"}
- local i = table.find(options, Settings.TargetBone) or 1
- i = i % #options + 1
- Settings.TargetBone = options[i]
- boneLbl.Text = "Target Bone: " .. Settings.TargetBone
- boneBtn.Text = Settings.TargetBone
- saveConfig()
- end)
- ypos += 50
- -- Aim keybind changer
- local aimKeyLbl = Instance.new("TextLabel", aimPage)
- aimKeyLbl.Size = UDim2.new(0, 300, 0, 22)
- aimKeyLbl.Position = UDim2.new(0, 20, 0, ypos)
- aimKeyLbl.BackgroundTransparency = 1
- aimKeyLbl.Font = Enum.Font.Gotham
- aimKeyLbl.TextSize = 16
- aimKeyLbl.TextColor3 = Color3.fromRGB(220,220,220)
- aimKeyLbl.Text = "Aim Keybind: " .. Settings.KeybindAim
- ypos += 28
- local aimKeyBtn = Instance.new("TextButton", aimPage)
- aimKeyBtn.Size = UDim2.new(0, 300, 0, 38)
- aimKeyBtn.Position = UDim2.new(0, 20, 0, ypos)
- aimKeyBtn.BackgroundColor3 = Color3.fromRGB(170,0,255)
- aimKeyBtn.Font = Enum.Font.GothamSemibold
- aimKeyBtn.TextSize = 18
- aimKeyBtn.TextColor3 = Color3.new(1,1,1)
- aimKeyBtn.AutoButtonColor = false
- aimKeyBtn.Text = Settings.KeybindAim
- local waitingForKey = false
- aimKeyBtn.MouseEnter:Connect(function() aimKeyBtn.BackgroundColor3 = Color3.fromRGB(200,50,255) end)
- aimKeyBtn.MouseLeave:Connect(function() aimKeyBtn.BackgroundColor3 = Color3.fromRGB(170,0,255) end)
- aimKeyBtn.MouseButton1Click:Connect(function()
- if waitingForKey then return end
- waitingForKey = true
- aimKeyBtn.Text = "Press Key..."
- local conn
- conn = UIS.InputBegan:Connect(function(input, gp)
- if gp then return end
- if input.UserInputType == Enum.UserInputType.Keyboard then
- Settings.KeybindAim = input.KeyCode.Name
- aimKeyBtn.Text = Settings.KeybindAim
- saveConfig()
- waitingForKey = false
- conn:Disconnect()
- elseif input.UserInputType.Name:match("^MouseButton%d$") then
- Settings.KeybindAim = input.UserInputType.Name
- aimKeyBtn.Text = Settings.KeybindAim
- saveConfig()
- waitingForKey = false
- conn:Disconnect()
- end
- end)
- end)
- ypos += 60
- -- Toggle UI keybind changer (on misc page)
- local toggleKeyLbl = Instance.new("TextLabel", miscPage)
- toggleKeyLbl.Size = UDim2.new(0, 300, 0, 22)
- toggleKeyLbl.Position = UDim2.new(0, 20, 0, 10)
- toggleKeyLbl.BackgroundTransparency = 1
- toggleKeyLbl.Font = Enum.Font.Gotham
- toggleKeyLbl.TextSize = 16
- toggleKeyLbl.TextColor3 = Color3.fromRGB(220,220,220)
- toggleKeyLbl.Text = "Toggle UI Keybind: " .. Settings.KeybindToggleUI
- local toggleKeyBtn = Instance.new("TextButton", miscPage)
- toggleKeyBtn.Size = UDim2.new(0, 300, 0, 38)
- toggleKeyBtn.Position = UDim2.new(0, 20, 0, 40)
- toggleKeyBtn.BackgroundColor3 = Color3.fromRGB(170,0,255)
- toggleKeyBtn.Font = Enum.Font.GothamSemibold
- toggleKeyBtn.TextSize = 18
- toggleKeyBtn.TextColor3 = Color3.new(1,1,1)
- toggleKeyBtn.AutoButtonColor = false
- toggleKeyBtn.Text = Settings.KeybindToggleUI
- toggleKeyBtn.MouseEnter:Connect(function() toggleKeyBtn.BackgroundColor3 = Color3.fromRGB(200,50,255) end)
- toggleKeyBtn.MouseLeave:Connect(function() toggleKeyBtn.BackgroundColor3 = Color3.fromRGB(170,0,255) end)
- toggleKeyBtn.MouseButton1Click:Connect(function()
- if waitingForKey then return end
- waitingForKey = true
- toggleKeyBtn.Text = "Press Key..."
- local conn
- conn = UIS.InputBegan:Connect(function(input, gp)
- if gp then return end
- if input.UserInputType == Enum.UserInputType.Keyboard then
- Settings.KeybindToggleUI = input.KeyCode.Name
- toggleKeyBtn.Text = Settings.KeybindToggleUI
- toggleKeyLbl.Text = "Toggle UI Keybind: " .. Settings.KeybindToggleUI
- saveConfig()
- waitingForKey = false
- conn:Disconnect()
- elseif input.UserInputType.Name:match("^MouseButton%d$") then
- Settings.KeybindToggleUI = input.UserInputType.Name
- toggleKeyBtn.Text = Settings.KeybindToggleUI
- toggleKeyLbl.Text = "Toggle UI Keybind: " .. Settings.KeybindToggleUI
- saveConfig()
- waitingForKey = false
- conn:Disconnect()
- end
- end)
- end)
- -- ESP section (ESP page)
- local espY = 10
- local function makeESPToggle(text, key)
- local btn = Instance.new("TextButton", espPage)
- btn.Size = UDim2.new(0, 300, 0, 38)
- btn.Position = UDim2.new(0, 20, 0, espY)
- btn.BackgroundColor3 = Color3.fromRGB(170, 0, 255)
- btn.Font = Enum.Font.GothamSemibold
- btn.TextSize = 18
- btn.AutoButtonColor = false
- btn.TextColor3 = Color3.new(1,1,1)
- btn.Text = Settings[key] and text .. ": ON" or text .. ": OFF"
- btn.MouseEnter:Connect(function() btn.BackgroundColor3 = Color3.fromRGB(200, 50, 255) end)
- btn.MouseLeave:Connect(function() btn.BackgroundColor3 = Color3.fromRGB(170, 0, 255) end)
- btn.MouseButton1Click:Connect(function()
- Settings[key] = not Settings[key]
- btn.Text = Settings[key] and text .. ": ON" or text .. ": OFF"
- saveConfig()
- end)
- espY += 50
- end
- makeESPToggle("ESP Enabled", "ESPEnabled")
- makeESPToggle("ESP Boxes", "ESPBoxes")
- makeESPToggle("ESP Names", "ESPNames")
- makeESPToggle("ESP Health", "ESPHealth")
- -- ESP drawing tables
- local ESPDrawings = {}
- local function createESPForPlayer(p)
- if ESPDrawings[p] then return end
- local box = Drawing.new("Square")
- box.Color = Color3.fromRGB(170, 0, 255)
- box.Thickness = 2
- box.Filled = false
- local nameTag = Drawing.new("Text")
- nameTag.Color = Color3.fromRGB(255,255,255)
- nameTag.Outline = true
- nameTag.OutlineColor = Color3.new(0,0,0)
- nameTag.Size = 14
- nameTag.Font = 2
- local healthText = Drawing.new("Text")
- healthText.Color = Color3.fromRGB(0,255,0)
- healthText.Outline = true
- healthText.OutlineColor = Color3.new(0,0,0)
- healthText.Size = 14
- healthText.Font = 2
- ESPDrawings[p] = {Box=box, Name=nameTag, Health=healthText}
- end
- local function removeESPForPlayer(p)
- if ESPDrawings[p] then
- for _,v in pairs(ESPDrawings[p]) do
- v:Remove()
- end
- ESPDrawings[p] = nil
- end
- end
- -- ESP Update loop
- RS.RenderStepped:Connect(function()
- for _,p in pairs(game:GetService("Players"):GetPlayers()) do
- if p ~= PL and p.Character and p.Character:FindFirstChild("HumanoidRootPart") and Settings.ESPEnabled then
- createESPForPlayer(p)
- local drawings = ESPDrawings[p]
- local root = p.Character.HumanoidRootPart
- local screenPos, onScreen = Cam:WorldToViewportPoint(root.Position)
- if onScreen and screenPos.Z > 0 then
- local size = 1500 / screenPos.Z
- local x, y = screenPos.X, screenPos.Y
- -- Box
- if Settings.ESPBoxes then
- drawings.Box.Visible = true
- drawings.Box.Size = Vector2.new(size, size * 2)
- drawings.Box.Position = Vector2.new(x - size/2, y - size)
- drawings.Box.Color = Color3.fromRGB(170, 0, 255)
- else
- drawings.Box.Visible = false
- end
- -- Name
- if Settings.ESPNames then
- drawings.Name.Visible = true
- drawings.Name.Text = p.Name
- drawings.Name.Position = Vector2.new(x, y - size - 20)
- else
- drawings.Name.Visible = false
- end
- -- Health
- if Settings.ESPHealth then
- local hum = p.Character:FindFirstChild("Humanoid")
- if hum then
- drawings.Health.Visible = true
- drawings.Health.Text = string.format("%.0f", hum.Health)
- drawings.Health.Position = Vector2.new(x, y + size + 5)
- drawings.Health.Color = hum.Health > 50 and Color3.fromRGB(0,255,0) or Color3.fromRGB(255,0,0)
- else
- drawings.Health.Visible = false
- end
- else
- drawings.Health.Visible = false
- end
- else
- -- Not on screen, hide all
- drawings.Box.Visible = false
- drawings.Name.Visible = false
- drawings.Health.Visible = false
- end
- else
- -- Remove ESP drawings if player not valid or ESP off
- removeESPForPlayer(p)
- end
- end
- end)
- -- Input handlers
- UIS.InputBegan:Connect(function(input, gp)
- if gp then return end
- if inputMatchesKey(input, Settings.KeybindAim) and Settings.AimbotEnabled then
- aiming = true
- end
- if inputMatchesKey(input, Settings.KeybindToggleUI) then
- gui.Enabled = not gui.Enabled
- end
- end)
- UIS.InputEnded:Connect(function(input)
- if inputMatchesKey(input, Settings.KeybindAim) then
- aiming = false
- end
- end)
- -- Hint label
- local hint = Instance.new("TextLabel", bg)
- hint.Size = UDim2.new(1,0,0,26)
- hint.Position = UDim2.new(0,0,1,-26)
- hint.BackgroundTransparency = 1
- hint.Font = Enum.Font.GothamItalic
- hint.TextSize = 14
- hint.TextColor3 = Color3.fromRGB(200,200,200)
- hint.Text = "Hold Aim Key to aim • Change keys and settings in GUI"
- print("Luna Scripts loaded successfully.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement