Загрузка данных
-- // BoatHelper | Premium Script
-- // Создано для Roblox
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local UserInputService = game:GetService("UserInputService")
local TweenService = game:GetService("TweenService")
local RunService = game:GetService("RunService")
local Workspace = game:GetService("Workspace")
-- // Функции, которые будут отключаться при уничтожении GUI
local ActiveFunctions = {
ESP = {
Enabled = false,
Connection = nil,
PlayersData = {},
Name = "ESP Игроков",
Description = "Подсвечивает игроков через стены и показывает их ник, расстояние и здоровье."
},
Aimbot = {
Enabled = false,
Connection = nil,
Target = nil,
Name = "Aimbot",
Description = "Автоматически наводится на ближайшего игрока. Прицеливается в голову."
}
}
-- // Очистка ESP для конкретного игрока
local function CleanupPlayerESP(player)
local data = ActiveFunctions.ESP.PlayersData[player]
if not data then return end
if data.Highlight then
data.Highlight:Destroy()
data.Highlight = nil
end
if data.Billboard then
data.Billboard:Destroy()
data.Billboard = nil
end
if data.UpdateConnection then
data.UpdateConnection:Disconnect()
data.UpdateConnection = nil
end
if data.CharacterConnection then
data.CharacterConnection:Disconnect()
data.CharacterConnection = nil
end
ActiveFunctions.ESP.PlayersData[player] = nil
end
-- // Создание ESP для игрока
local function SetupPlayerESP(player)
if player == Player then return end
CleanupPlayerESP(player)
ActiveFunctions.ESP.PlayersData[player] = {
Highlight = nil,
Billboard = nil,
UpdateConnection = nil,
CharacterConnection = nil
}
local function CreateESPVisuals(character)
if not character or not ActiveFunctions.ESP.Enabled then return end
local data = ActiveFunctions.ESP.PlayersData[player]
if not data then return end
if data.Highlight then
data.Highlight:Destroy()
data.Highlight = nil
end
if data.Billboard then
data.Billboard:Destroy()
data.Billboard = nil
end
if data.UpdateConnection then
data.UpdateConnection:Disconnect()
data.UpdateConnection = nil
end
local humanoidRootPart = character:WaitForChild("HumanoidRootPart", 5)
local humanoid = character:WaitForChild("Humanoid", 5)
if not humanoidRootPart or not humanoid then return end
local highlight = Instance.new("Highlight")
highlight.Name = "ESP_Highlight"
highlight.FillColor = Color3.fromRGB(255, 255, 255)
highlight.FillTransparency = 0.5
highlight.OutlineColor = Color3.fromRGB(255, 255, 255)
highlight.OutlineTransparency = 0
highlight.Adornee = character
highlight.Parent = character
data.Highlight = highlight
local billboard = Instance.new("BillboardGui")
billboard.Name = "ESP_Billboard"
billboard.Adornee = humanoidRootPart
billboard.Parent = character
billboard.Size = UDim2.new(0, 300, 0, 30)
billboard.StudsOffset = Vector3.new(0, 3, 0)
billboard.AlwaysOnTop = true
billboard.MaxDistance = 1000
local textLabel = Instance.new("TextLabel")
textLabel.Parent = billboard
textLabel.Size = UDim2.new(1, 0, 1, 0)
textLabel.BackgroundTransparency = 1
textLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
textLabel.Font = Enum.Font.GothamBold
textLabel.TextSize = 14
textLabel.TextStrokeTransparency = 0.3
textLabel.TextStrokeColor3 = Color3.fromRGB(0, 0, 0)
textLabel.Text = "Загрузка..."
data.Billboard = billboard
local function UpdateInfo()
if not ActiveFunctions.ESP.Enabled then return end
if not player.Parent then return end
local localPlayer = Player
local localCharacter = localPlayer.Character
if not localCharacter then return end
local localRoot = localCharacter:FindFirstChild("HumanoidRootPart")
if not localRoot then return end
local targetCharacter = player.Character
if not targetCharacter then return end
local targetRoot = targetCharacter:FindFirstChild("HumanoidRootPart")
local targetHumanoid = targetCharacter:FindFirstChild("Humanoid")
if not targetRoot or not targetHumanoid then
textLabel.Text = player.DisplayName or player.Name
return
end
local distance = (targetRoot.Position - localRoot.Position).Magnitude
local health = math.floor(targetHumanoid.Health)
textLabel.Text = string.format("%s | %.0fstuds | %dHP",
player.DisplayName or player.Name,
distance,
health
)
end
data.UpdateConnection = RunService.Heartbeat:Connect(function()
if not ActiveFunctions.ESP.Enabled then
if data.UpdateConnection then
data.UpdateConnection:Disconnect()
data.UpdateConnection = nil
end
return
end
UpdateInfo()
end)
end
local function OnCharacterAdded(character)
if ActiveFunctions.ESP.Enabled then
CreateESPVisuals(character)
end
end
if player.Character then
CreateESPVisuals(player.Character)
end
local data = ActiveFunctions.ESP.PlayersData[player]
if data then
data.CharacterConnection = player.CharacterAdded:Connect(OnCharacterAdded)
end
end
-- // Сканирование всех игроков для ESP
local function ScanAllPlayers()
for _, player in pairs(Players:GetPlayers()) do
if player ~= Player then
SetupPlayerESP(player)
end
end
end
-- // Очистка всего ESP
local function ClearAllESP()
for player, _ in pairs(ActiveFunctions.ESP.PlayersData) do
CleanupPlayerESP(player)
end
ActiveFunctions.ESP.PlayersData = {}
end
-- // Aimbot - поиск ближайшего игрока
local function GetClosestPlayer()
local closestPlayer = nil
local shortestDistance = math.huge
local localCharacter = Player.Character
if not localCharacter then return nil end
local localRoot = localCharacter:FindFirstChild("HumanoidRootPart")
if not localRoot then return nil end
for _, targetPlayer in pairs(Players:GetPlayers()) do
if targetPlayer ~= Player and targetPlayer.Character then
local targetHumanoid = targetPlayer.Character:FindFirstChild("Humanoid")
local targetRoot = targetPlayer.Character:FindFirstChild("HumanoidRootPart")
if targetHumanoid and targetRoot and targetHumanoid.Health > 0 then
local distance = (localRoot.Position - targetRoot.Position).Magnitude
if distance < shortestDistance then
shortestDistance = distance
closestPlayer = targetPlayer
end
end
end
end
return closestPlayer
end
-- // Aimbot - наведение на цель
local function AimAtTarget()
local target = GetClosestPlayer()
if not target then return end
local localCharacter = Player.Character
if not localCharacter then return end
local localRoot = localCharacter:FindFirstChild("HumanoidRootPart")
local targetCharacter = target.Character
if not localCharacter or not targetCharacter then return end
local targetHead = targetCharacter:FindFirstChild("Head")
if not targetHead then return end
-- Получаем позицию головы цели
local targetPosition = targetHead.Position
-- Вычисляем направление
local camera = Workspace.CurrentCamera
if not camera then return end
local cameraPosition = camera.CFrame.Position
local lookAt = CFrame.new(cameraPosition, targetPosition)
-- Плавно поворачиваем камеру
camera.CFrame = camera.CFrame:Lerp(lookAt, 0.3)
end
-- // Создание GUI
local function CreateBoatHelper()
local ScreenGui = Instance.new("ScreenGui")
ScreenGui.Name = "BoatHelper"
ScreenGui.Parent = Player:WaitForChild("PlayerGui")
ScreenGui.ResetOnSpawn = false
ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
local MainFrame = Instance.new("Frame")
MainFrame.Name = "MainFrame"
MainFrame.Parent = ScreenGui
MainFrame.Size = UDim2.new(0, 320, 0, 200)
MainFrame.Position = UDim2.new(0.5, -160, 0.5, -100)
MainFrame.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
MainFrame.BorderSizePixel = 1
MainFrame.BorderColor3 = Color3.fromRGB(60, 60, 60)
MainFrame.Active = true
local TitleBar = Instance.new("Frame")
TitleBar.Name = "TitleBar"
TitleBar.Parent = MainFrame
TitleBar.Size = UDim2.new(1, 0, 0, 30)
TitleBar.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
TitleBar.BorderSizePixel = 1
TitleBar.BorderColor3 = Color3.fromRGB(60, 60, 60)
local TitleText = Instance.new("TextLabel")
TitleText.Parent = TitleBar
TitleText.Size = UDim2.new(1, -10, 1, 0)
TitleText.Position = UDim2.new(0, 10, 0, 0)
TitleText.BackgroundTransparency = 1
TitleText.Text = "BoatHelper"
TitleText.TextColor3 = Color3.fromRGB(200, 200, 200)
TitleText.Font = Enum.Font.GothamBold
TitleText.TextSize = 14
TitleText.TextXAlignment = Enum.TextXAlignment.Left
local Divider1 = Instance.new("Frame")
Divider1.Parent = MainFrame
Divider1.Size = UDim2.new(1, 0, 0, 1)
Divider1.Position = UDim2.new(0, 0, 0, 30)
Divider1.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
Divider1.BorderSizePixel = 0
-- // Функция создания строки с функцией
local function CreateFunctionRow(yPos, funcData, toggleCallback)
local Container = Instance.new("Frame")
Container.Parent = MainFrame
Container.Size = UDim2.new(1, -20, 0, 40)
Container.Position = UDim2.new(0, 10, 0, yPos)
Container.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
Container.BorderSizePixel = 1
Container.BorderColor3 = Color3.fromRGB(60, 60, 60)
local FuncInfo = Instance.new("TextLabel")
FuncInfo.Parent = Container
FuncInfo.Size = UDim2.new(1, -60, 1, 0)
FuncInfo.Position = UDim2.new(0, 10, 0, 0)
FuncInfo.BackgroundTransparency = 1
FuncInfo.Text = funcData.Name .. "\n" .. funcData.Description
FuncInfo.TextColor3 = Color3.fromRGB(180, 180, 180)
FuncInfo.Font = Enum.Font.Gotham
FuncInfo.TextSize = 11
FuncInfo.TextXAlignment = Enum.TextXAlignment.Left
FuncInfo.TextYAlignment = Enum.TextYAlignment.Center
FuncInfo.TextWrapped = true
local ToggleButton = Instance.new("TextButton")
ToggleButton.Name = "ToggleButton"
ToggleButton.Parent = Container
ToggleButton.Size = UDim2.new(0, 40, 0, 20)
ToggleButton.Position = UDim2.new(1, -50, 0.5, -10)
ToggleButton.BackgroundColor3 = Color3.fromRGB(150, 30, 30)
ToggleButton.BorderSizePixel = 1
ToggleButton.BorderColor3 = Color3.fromRGB(100, 100, 100)
ToggleButton.Text = "OFF"
ToggleButton.TextColor3 = Color3.fromRGB(255, 255, 255)
ToggleButton.Font = Enum.Font.GothamBold
ToggleButton.TextSize = 11
ToggleButton.AutoButtonColor = false
local function UpdateButtonState()
if funcData.Enabled then
ToggleButton.BackgroundColor3 = Color3.fromRGB(30, 150, 30)
ToggleButton.Text = "ON"
else
ToggleButton.BackgroundColor3 = Color3.fromRGB(150, 30, 30)
ToggleButton.Text = "OFF"
end
end
ToggleButton.MouseButton1Click:Connect(function()
funcData.Enabled = not funcData.Enabled
UpdateButtonState()
if toggleCallback then
toggleCallback(funcData.Enabled)
end
end)
return Container, ToggleButton, UpdateButtonState
end
-- // Создаем строку для ESP
local espContainer, espToggle, espUpdate = CreateFunctionRow(45, ActiveFunctions.ESP, function(enabled)
if enabled then
print("BoatHelper: ESP ВКЛЮЧЕН")
ScanAllPlayers()
ActiveFunctions.ESP.Connection = Players.PlayerAdded:Connect(function(newPlayer)
if ActiveFunctions.ESP.Enabled and newPlayer ~= Player then
SetupPlayerESP(newPlayer)
end
end)
Players.PlayerRemoving:Connect(function(leavingPlayer)
if ActiveFunctions.ESP.PlayersData[leavingPlayer] then
CleanupPlayerESP(leavingPlayer)
end
end)
else
print("BoatHelper: ESP ВЫКЛЮЧЕН")
if ActiveFunctions.ESP.Connection then
ActiveFunctions.ESP.Connection:Disconnect()
ActiveFunctions.ESP.Connection = nil
end
ClearAllESP()
end
end)
-- // Разделитель между функциями
local DividerBetween = Instance.new("Frame")
DividerBetween.Parent = MainFrame
DividerBetween.Size = UDim2.new(1, 0, 0, 1)
DividerBetween.Position = UDim2.new(0, 0, 0, 95)
DividerBetween.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
DividerBetween.BorderSizePixel = 0
-- // Создаем строку для Aimbot
local aimbotContainer, aimbotToggle, aimbotUpdate = CreateFunctionRow(105, ActiveFunctions.Aimbot, function(enabled)
if enabled then
print("BoatHelper: Aimbot ВКЛЮЧЕН")
ActiveFunctions.Aimbot.Connection = RunService.RenderStepped:Connect(function()
if ActiveFunctions.Aimbot.Enabled then
AimAtTarget()
end
end)
else
print("BoatHelper: Aimbot ВЫКЛЮЧЕН")
if ActiveFunctions.Aimbot.Connection then
ActiveFunctions.Aimbot.Connection:Disconnect()
ActiveFunctions.Aimbot.Connection = nil
end
end
end)
-- // Разделитель перед кнопкой Destroy
local Divider2 = Instance.new("Frame")
Divider2.Parent = MainFrame
Divider2.Size = UDim2.new(1, 0, 0, 1)
Divider2.Position = UDim2.new(0, 0, 0, 155)
Divider2.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
Divider2.BorderSizePixel = 0
-- // Кнопка DestroyGUI
local DestroyButton = Instance.new("TextButton")
DestroyButton.Name = "DestroyButton"
DestroyButton.Parent = MainFrame
DestroyButton.Size = UDim2.new(1, -20, 0, 30)
DestroyButton.Position = UDim2.new(0, 10, 1, -40)
DestroyButton.BackgroundColor3 = Color3.fromRGB(120, 20, 20)
DestroyButton.BorderSizePixel = 1
DestroyButton.BorderColor3 = Color3.fromRGB(60, 60, 60)
DestroyButton.Text = "DestroyGUI"
DestroyButton.TextColor3 = Color3.fromRGB(255, 255, 255)
DestroyButton.Font = Enum.Font.GothamBold
DestroyButton.TextSize = 13
DestroyButton.AutoButtonColor = false
DestroyButton.MouseEnter:Connect(function()
DestroyButton.BackgroundColor3 = Color3.fromRGB(160, 30, 30)
end)
DestroyButton.MouseLeave:Connect(function()
DestroyButton.BackgroundColor3 = Color3.fromRGB(120, 20, 20)
end)
-- // Логика перетаскивания
local dragging = false
local dragInput, dragStart, startPos
TitleBar.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
dragging = true
dragStart = input.Position
startPos = MainFrame.Position
input.Changed:Connect(function()
if input.UserInputState == Enum.UserInputState.End then
dragging = false
end
end)
end
end)
TitleBar.InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement and dragging then
local delta = input.Position - dragStart
MainFrame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
end
end)
-- // Открытие/закрытие по Insert
local function ToggleVisibility()
MainFrame.Visible = not MainFrame.Visible
end
UserInputService.InputBegan:Connect(function(input, gameProcessed)
if gameProcessed then return end
if input.KeyCode == Enum.KeyCode.Insert then
ToggleVisibility()
end
end)
-- // Логика уничтожения GUI и всех функций
DestroyButton.MouseButton1Click:Connect(function()
for funcName, funcData in pairs(ActiveFunctions) do
if funcData.Connection then
funcData.Connection:Disconnect()
funcData.Connection = nil
end
if funcName == "ESP" then
ClearAllESP()
end
funcData.Enabled = false
print("BoatHelper: Функция '" .. funcName .. "' отключена при уничтожении GUI.")
end
ScreenGui:Destroy()
print("BoatHelper: GUI успешно уничтожен.")
end)
espUpdate()
aimbotUpdate()
print("BoatHelper: Меню загружено и готово к работе.")
print("BoatHelper: Используйте Insert для открытия/закрытия меню.")
end
CreateBoatHelper()