
KeylessUniversal

local RunService = game:GetService("RunService")
local PathfindingService = game:GetService("PathfindingService")
local Players = game:GetService("Players")
local CoreGui = game:GetService("CoreGui")
local Teams = game:GetService("Teams")
local Terrain = workspace.Terrain
local MarketplaceService = game:GetService("MarketplaceService")
repeat task.wait() until game:IsLoaded()
if _G.HosterBot then
warn("Bot already running.")
return
end
_G.HosterBot = true
-- Settings
local Settings = { Enabled = false }
local Team = #Teams:GetChildren() > 0 and Players.LocalPlayer.Team or nil
Players.LocalPlayer:GetPropertyChangedSignal("Team"):Connect(function()
Team = Players.LocalPlayer.Team
end)
-- Core Targets & Character Variables
local Player = Players.LocalPlayer
local Backpack = Player:WaitForChild("Backpack")
local Bot = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Bot:WaitForChild("Humanoid")
local HumanoidRootPart = Bot:WaitForChild("HumanoidRootPart")
Player.CharacterAdded:Connect(function(c)
Bot = c
Humanoid = Bot:WaitForChild("Humanoid")
HumanoidRootPart = Bot:WaitForChild("HumanoidRootPart")
Backpack = Player:WaitForChild("Backpack")
end)
-- Raycasting Params
local rayParams = RaycastParams.new()
rayParams.FilterType = Enum.RaycastFilterType.Exclude
rayParams.FilterDescendantsInstances = {Bot}
-- Minimalist Toggle UI
local UI = Instance.new("ScreenGui")
UI.Name = "SimpleBot_UI"
UI.ResetOnSpawn = false
UI.Parent = CoreGui or Player:WaitForChild("PlayerGui")
local ToggleBtn = Instance.new("TextButton")
ToggleBtn.Size = UDim2.new(0, 120, 0, 40)
ToggleBtn.Position = UDim2.new(0, 10, 0, 10)
ToggleBtn.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
ToggleBtn.TextColor3 = Color3.new(1, 1, 1)
ToggleBtn.Font = Enum.Font.SourceSansBold
ToggleBtn.TextSize = 16
ToggleBtn.Text = "Bot: OFF"
ToggleBtn.Parent = UI
local UICorner = Instance.new("UICorner")
UICorner.CornerRadius = UDim.new(0, 8)
UICorner.Parent = ToggleBtn
-- Pathfinding variables
local path = PathfindingService:CreatePath({
AgentRadius = 2,
AgentHeight = 5,
AgentCanJump = true
})
local waypoints = {}
local nextWaypointIndex = 1
local reachedConnection
local PathBlocked = false
local TargetLastPos = nil
local function DisconnectPath()
if reachedConnection then
reachedConnection:Disconnect()
reachedConnection = nil
end
waypoints = {}
end
ToggleBtn.MouseButton1Click:Connect(function()
Settings.Enabled = not Settings.Enabled
if Settings.Enabled then
ToggleBtn.Text = "Bot: ON"
ToggleBtn.BackgroundColor3 = Color3.fromRGB(46, 204, 113)
else
ToggleBtn.Text = "Bot: OFF"
ToggleBtn.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
DisconnectPath()
Humanoid.AutoRotate = true
end
end)
-- Core Target Acquisition
local function GetNearestTarget()
local nearest, maxDist = nil, math.huge
for _, v in pairs(workspace:GetChildren()) do
if v:IsA("Model") and v ~= Bot and not v:FindFirstChildOfClass("ForceField") then
local hum = v:FindFirstChildOfClass("Humanoid")
local hrp = v:FindFirstChild("HumanoidRootPart")
if hum and hum.Health > 0 and hrp and hum.Health ~= math.huge then
local player = Players:GetPlayerFromCharacter(v)
if player and Team and player.Team == Team then continue end
local dist = (HumanoidRootPart.Position - hrp.Position).Magnitude
if dist < maxDist then
nearest = v
maxDist = dist
end
end
end
end
return nearest
end
local function PathfindTo(startPos, goalPos)
DisconnectPath()
pcall(function()
path:ComputeAsync(startPos, goalPos)
if path.Status == Enum.PathStatus.Success then
waypoints = path:GetWaypoints()
nextWaypointIndex = 1
reachedConnection = RunService.Heartbeat:Connect(function()
if not Settings.Enabled or not waypoints[nextWaypointIndex] then
DisconnectPath()
return
end
local wpPos = waypoints[nextWaypointIndex].Position
Humanoid:MoveTo(wpPos)
if waypoints[nextWaypointIndex].Action == Enum.PathWaypointAction.Jump then
Humanoid.Jump = true
end
if (HumanoidRootPart.Position - wpPos).Magnitude < 2 then
nextWaypointIndex += 1
end
end)
end
end)
end
-- Core Engine Loop
local StrafeTimer = tick()
local StrafeTime = 0.5
local CrossProduct = 1
local StrafeOffset = Vector3.zero
while true do
RunService.RenderStepped:Wait()
if not Settings.Enabled or not HumanoidRootPart or not Humanoid or Humanoid.Health <= 0 then
continue
end
local target = GetNearestTarget()
if target then
local hrp = target:FindFirstChild("HumanoidRootPart")
local tool = Bot:FindFirstChildOfClass("Tool")
-- Automatically Equip Tool
if not tool then
tool = Backpack:FindFirstChildOfClass("Tool")
if tool then Humanoid:EquipTool(tool) end
end
if hrp then
local diff = (hrp.Position - HumanoidRootPart.Position)
local dist = diff.Magnitude
local unit = diff.Unit
-- Keep looking at target (Shiftlock behavior)
Humanoid.AutoRotate = false
HumanoidRootPart.CFrame = HumanoidRootPart.CFrame:Lerp(CFrame.new(HumanoidRootPart.Position, HumanoidRootPart.Position + unit * Vector3.new(1,0,1)) * CFrame.Angles(0, math.rad(10), 0), 0.7)
if tool then tool:Activate() end
if Humanoid.Sit then Humanoid.Jump = true end
-- Visibility Check
local ray = workspace:Raycast(HumanoidRootPart.Position, unit * dist, rayParams)
local canSee = not ray or (ray.Instance and ray.Instance:IsDescendantOf(target))
if not canSee then
-- Target is hidden; fallback to pathfinding
if not TargetLastPos or (TargetLastPos - hrp.Position).Magnitude > 5 then
TargetLastPos = hrp.Position
PathfindTo(HumanoidRootPart.Position, hrp.Position)
end
else
-- Line of sight clear; engage combat movement (Strafing / Flanking)
DisconnectPath()
TargetLastPos = nil
if tick() - StrafeTimer >= StrafeTime then
StrafeTimer = tick()
StrafeTime = math.random(4, 9) / 10
CrossProduct = (math.random(0, 1) == 1) and 1 or -1
StrafeOffset = Vector3.new(math.random(-5, 5), 0, math.random(-5, 5))
end
if dist > 15 then
-- Close the gap directly
Humanoid:MoveTo(hrp.Position)
else
-- Flank and weave inside weapon striking distance
local side = unit:Cross(Vector3.new(0, 1, 0)) * CrossProduct
local combatPos = hrp.Position + (side * 6) + StrafeOffset
Humanoid:MoveTo(combatPos)
if math.random(1, 40) == 1 then
Humanoid.Jump = true
end
end
end
end
else
-- Idle safely if no target exists
Humanoid.AutoRotate = true
DisconnectPath()
end
endNo comments yet for this script.

![[KEYLESS] Moondiety Script | 17+ supported Games](https://scriptblox.com/images/sb/0-1753093706828.png)

