Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
337 views14 pages

Mod Menu Roblox

The document outlines a Lua script for a Roblox GUI that allows players to control various movement features such as speed, flying, and swimming. It includes functionalities for creating draggable GUI elements, toggling features on and off, and adjusting settings through a user-friendly interface. Additionally, it implements visual effects and manages player interactions with the game environment, including multi-jump and multi-floor capabilities.

Uploaded by

windowsvinix.id
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
337 views14 pages

Mod Menu Roblox

The document outlines a Lua script for a Roblox GUI that allows players to control various movement features such as speed, flying, and swimming. It includes functionalities for creating draggable GUI elements, toggling features on and off, and adjusting settings through a user-friendly interface. Additionally, it implements visual effects and manages player interactions with the game environment, including multi-jump and multi-floor capabilities.

Uploaded by

windowsvinix.id
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 14

-- ================== [ LAYANAN & VARIABEL UTAMA ] ==================

local Players = game:GetService("Players")


local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local PhysicsService = game:GetService("PhysicsService")
local CoreGui = game:GetService("CoreGui")
local HttpService = game:GetService("HttpService")

local player = Players.LocalPlayer

-- ================== [ FLAGS & PENGATURAN AWAL ] ==================


local flags = {
SpeedMove = false,
Fly = false,
Swim = false,
Vehicle = false,
}

local DEFAULTS = {
SpeedMove = 16,
Fly = 50,
Vehicle = 50,
Swim = 50,
}

-- ================== [ FUNGSI UTILITAS: GESER & RGB ] ==================


-- Fungsi untuk membuat elemen GUI bisa digeser
local function makeDraggable(trigger, target)
local dragging = false
local dragInput = nil
local dragStart = nil
local startPos = nil

trigger.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 or
input.UserInputType == Enum.UserInputType.Touch 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)

trigger.InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement or
input.UserInputType == Enum.UserInputType.Touch then
dragInput = input
end
end)

UserInputService.InputChanged:Connect(function(input)
if input == dragInput and dragging then
local newPos = UDim2.new(
startPos.X.Scale, startPos.X.Offset + (input.Position.X -
dragStart.X),
startPos.Y.Scale, startPos.Y.Offset + (input.Position.Y -
dragStart.Y)
)
target.Position = newPos
end
end)
end

-- ================== [ SETUP GUI UTAMA ] ==================


local gui = Instance.new("ScreenGui", player:WaitForChild("PlayerGui"))
gui.Name = "ARVnnxzyz_Menu"
gui.ResetOnSpawn = false
gui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling

-- LOGO BULAT BARU (PENGGANTI TOMBOL SHOW/HIDE)


local logoToggle = Instance.new("TextButton", gui)
logoToggle.Size = UDim2.new(0, 50, 0, 50)
logoToggle.Position = UDim2.new(0, 20, 0, 20)
logoToggle.BackgroundColor3 = Color3.fromRGB(15, 15, 15)
logoToggle.Text = "AR"
logoToggle.Font = Enum.Font.SourceSansBold
logoToggle.TextColor3 = Color3.fromRGB(255, 255, 255)
logoToggle.TextScaled = true
logoToggle.ZIndex = 3

local logoCorner = Instance.new("UICorner", logoToggle)


logoCorner.CornerRadius = UDim.new(0.5, 0) -- Membuatnya bulat sempurna

local logoStroke = Instance.new("UIStroke", logoToggle)


logoStroke.Thickness = 2
logoStroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border

-- FRAME MENU UTAMA


local menu = Instance.new("ScrollingFrame", gui)
menu.Visible = false -- Menu disembunyikan saat awal
menu.Active = true
menu.Size = UDim2.new(0, 260, 0, 350)
menu.Position = UDim2.new(0, 20, 0, 80)
menu.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
menu.BorderSizePixel = 0
menu.ScrollBarThickness = 6
menu.CanvasSize = UDim2.new(0, 0, 0, 0)
menu.ZIndex = 2

local menuCorner = Instance.new("UICorner", menu)


menuCorner.CornerRadius = UDim.new(0, 8) -- Sudut melengkung

local menuStroke = Instance.new("UIStroke", menu)


menuStroke.Thickness = 2
menuStroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border

-- JUDUL MENU
local titleBar = Instance.new("TextLabel", menu)
titleBar.Size = UDim2.new(1, -10, 0, 30)
titleBar.Position = UDim2.new(0, 5, 0, 5)
titleBar.BackgroundTransparency = 1
titleBar.Text = "AR Vnnxzyz Menu"
titleBar.Font = Enum.Font.SourceSansBold
titleBar.TextScaled = true
titleBar.TextColor3 = Color3.fromRGB(255, 255, 255)
titleBar.ZIndex = 3

-- LAYOUT UNTUK KONTEN MENU


local layout = Instance.new("UIListLayout", menu)
layout.Padding = UDim.new(0, 5)
layout.SortOrder = Enum.SortOrder.LayoutOrder
layout.HorizontalAlignment = Enum.HorizontalAlignment.Center
local topPadding = Instance.new("UIPadding", layout)
topPadding.PaddingTop = UDim.new(0, 40) -- Beri ruang untuk judul di atas

layout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
menu.CanvasSize = UDim2.new(0, 0, 0, layout.AbsoluteContentSize.Y +
topPadding.PaddingTop.Offset + 10)
end)

-- KONEKSI FUNGSI GUI


logoToggle.MouseButton1Click:Connect(function()
menu.Visible = not menu.Visible
end)

makeDraggable(logoToggle, logoToggle) -- Logo bisa digeser


makeDraggable(titleBar, menu) -- Judul menggeser menu

-- LOOP ANIMASI RGB


RunService.Heartbeat:Connect(function()
local hue = tick() % 6 / 6
local rgbColor = Color3.fromHSV(hue, 0.8, 1)

if logoToggle and logoToggle.Parent then


logoToggle.TextColor3 = rgbColor
logoStroke.Color = rgbColor
end
if menu and menu.Parent then
titleBar.TextColor3 = rgbColor
menuStroke.Color = rgbColor
end
end)

-- ================== [ KONTEN MENU ASLI ] ==================

local function updateButtonColor(button, isOn)


if button and button:IsA("TextButton") then
button.BackgroundColor3 = isOn and Color3.fromRGB(0, 150, 70) or
Color3.fromRGB(70, 70, 70)
end
end

-- TOMBOL HANCURKAN GUI


local destroy = Instance.new("TextButton", menu)
destroy.Size = UDim2.new(1, -10, 0, 40)
destroy.Text = "Destroy GUI"
destroy.BackgroundColor3 = Color3.fromRGB(200, 0, 0)
destroy.TextColor3 = Color3.fromRGB(255, 255, 255)
destroy.BorderSizePixel = 0

-- KREDIT
local credit = Instance.new("TextLabel", menu)
credit.Size = UDim2.new(1, -10, 0, 30)
credit.Text = "Created by AR Vnnxzyz"
credit.BackgroundTransparency = 1
credit.TextColor3 = Color3.fromRGB(255, 255, 255)
credit.TextScaled = true
credit.Font = Enum.Font.SourceSans

-- FUNGSI UNTUK MEMBUAT OPSI


local function createOption(name, toggleCallback)
local speed = DEFAULTS[name]
local conn = nil

local frame = Instance.new("Frame", menu)


frame.Size = UDim2.new(1, -10, 0, 80)
frame.BackgroundTransparency = 1
frame.LayoutOrder = 1 -- Urutan Opsi

local button = Instance.new("TextButton", frame)


button.Size = UDim2.new(1, 0, 0, 30)
button.Text = name .. ": OFF"
button.BackgroundColor3 = Color3.fromRGB(70, 70, 70)
button.TextColor3 = Color3.fromRGB(255, 255, 255)
button.BorderSizePixel = 0

local box = Instance.new("TextBox", frame)


box.Size = UDim2.new(0.5, -5, 0, 25)
box.Position = UDim2.new(0, 0, 0, 35)
box.Text = tostring(speed)
box.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
box.TextColor3 = Color3.fromRGB(255, 255, 255)
box.ClearTextOnFocus = false
box.TextScaled = true
box.Font = Enum.Font.SourceSans

local reset = Instance.new("TextButton", frame)


reset.Size = UDim2.new(0.5, -5, 0, 25)
reset.Position = UDim2.new(0.5, 5, 0, 35)
reset.Text = "Reset"
reset.BackgroundColor3 = Color3.fromRGB(80, 80, 80)
reset.TextColor3 = Color3.fromRGB(255, 255, 255)
reset.TextScaled = true
reset.Font = Enum.Font.SourceSans

box.FocusLost:Connect(function()
local v = tonumber(box.Text)
if v then
speed = math.clamp(v, 1, 2000)
box.Text = tostring(speed)
if flags[name] and toggleCallback.OnSpeedChange then
toggleCallback.OnSpeedChange(speed)
end
else
box.Text = tostring(speed)
end
end)

reset.MouseButton1Click:Connect(function()
speed = DEFAULTS[name]
box.Text = tostring(speed)
if flags[name] and toggleCallback.OnSpeedChange then
toggleCallback.OnSpeedChange(speed)
end
end)

button.MouseButton1Click:Connect(function()
flags[name] = not flags[name]
button.Text = name .. ": " .. (flags[name] and "ON" or "OFF")
updateButtonColor(button, flags[name])

if flags[name] then
conn = toggleCallback.OnEnable(speed)
else
if conn then conn:Disconnect(); conn = nil end
if toggleCallback.OnDisable then toggleCallback.OnDisable() end
end
end)
end

-- ================== [ IMPLEMENTASI FITUR ] ==================


-- SpeedMove
createOption("SpeedMove", {
OnEnable = function(speed)
local function apply()
local hum = player.Character and
player.Character:FindFirstChildOfClass("Humanoid")
if hum then hum.WalkSpeed = speed end
end
player.CharacterAdded:Connect(function() task.wait(0.5); if
flags.SpeedMove then apply() end end)
apply()
end,
OnSpeedChange = function(speed)
local hum = player.Character and
player.Character:FindFirstChildOfClass("Humanoid")
if hum then hum.WalkSpeed = speed end
end,
OnDisable = function()
local hum = player.Character and
player.Character:FindFirstChildOfClass("Humanoid")
if hum then hum.WalkSpeed = DEFAULTS.SpeedMove end
end
})

-- Fly
local flyBV, flyGyro, flyConn
local followCursor = false

UserInputService.InputBegan:Connect(function(input, gpe)
if gpe then return end
if input.KeyCode == Enum.KeyCode.KeypadThree then
followCursor = not followCursor
print("[Fly Cursor Mode]:", followCursor and "ON" or "OFF")
end
end)

createOption("Fly", {
OnEnable = function(speed)
local char = player.Character or player.CharacterAdded:Wait()
local seat = char:FindFirstChildWhichIsA("VehicleSeat", true)
local root = seat or char:FindFirstChild("HumanoidRootPart")
if not root then return end

flyBV = Instance.new("BodyVelocity")
flyBV.MaxForce = Vector3.new(1, 1, 1) * 1e9
flyBV.P = 5000
flyBV.Velocity = Vector3.zero
flyBV.Parent = root

flyGyro = Instance.new("BodyGyro")
flyGyro.MaxTorque = Vector3.new(1, 1, 1) * 1e9
flyGyro.P = 5000
flyGyro.CFrame = root.CFrame
flyGyro.Parent = root

local mouse = player:GetMouse()


flyConn = RunService.RenderStepped:Connect(function()
local move = Vector3.zero
if UserInputService:IsKeyDown(Enum.KeyCode.W) then move +=
root.CFrame.LookVector end
if UserInputService:IsKeyDown(Enum.KeyCode.S) then move -=
root.CFrame.LookVector end
if UserInputService:IsKeyDown(Enum.KeyCode.A) then move -=
root.CFrame.RightVector end
if UserInputService:IsKeyDown(Enum.KeyCode.D) then move +=
root.CFrame.RightVector end
if UserInputService:IsKeyDown(Enum.KeyCode.Q) then move +=
Vector3.new(0, 1, 0) end
if UserInputService:IsKeyDown(Enum.KeyCode.E) then move -=
Vector3.new(0, 1, 0) end

flyBV.Velocity = move.Magnitude > 0 and move.Unit * speed or


Vector3.zero

if followCursor and
UserInputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton1) and mouse
and mouse.Hit then
local target = Vector3.new(mouse.Hit.Position.X,
root.Position.Y, mouse.Hit.Position.Z)
flyGyro.CFrame = CFrame.new(root.Position, target)
end
end)

return flyConn
end,
OnDisable = function()
if flyConn then flyConn:Disconnect(); flyConn = nil end
if flyBV then flyBV:Destroy(); flyBV = nil end
if flyGyro then flyGyro:Destroy(); flyGyro = nil end
end,
OnSpeedChange = function(speed)
-- Speed is updated via closure
end
})

-- Swim Speed
createOption("Swim", {
OnEnable = function(speed)
return RunService.Heartbeat:Connect(function()
local hum = player.Character and
player.Character:FindFirstChildOfClass("Humanoid")
if hum then
if hum:GetState() == Enum.HumanoidStateType.Swimming then
hum.WalkSpeed = speed
else
hum.WalkSpeed = flags.SpeedMove and
DEFAULTS.SpeedMove or 16 -- Fallback if speedmove is off
end
end
end)
end,
OnDisable = function()
local hum = player.Character and
player.Character:FindFirstChildOfClass("Humanoid")
if hum then hum.WalkSpeed = flags.SpeedMove and DEFAULTS.SpeedMove or
16 end
end
})

-- ================== [ FITUR TAMBAHAN: MULTIJUMP & MULTIFLOOR ] ==================


local jumpConn, multiFloorHumanoidConn
local multiJumpEnabled = false
local multiFloorEnabled = false
local onlyCharacter = false
local platformInvisible = false
local multiFloorParts = {}

-- === FUNGSI PLATFORM ===


local spawnPlatform -- Deklarasi
function spawnPlatform()
if not multiFloorEnabled then return end -- Blokir jika fitur OFF

local char = player.Character


local hrp = char and char:FindFirstChild("HumanoidRootPart")
if not hrp then return end

-- Hindari duplikasi
for _, part in ipairs(multiFloorParts) do
if (part.Position - hrp.Position).Magnitude < 15 then return end
end

-- Batasi jumlah platform


if #multiFloorParts >= 3 then
local oldest = table.remove(multiFloorParts, 1)
if oldest and oldest:IsDescendantOf(workspace) then
oldest:Destroy()
end
end

local platform = Instance.new("Part")


platform.Name = "MultiFloorPlatform"
platform.Size = Vector3.new(1000, 0.5, 1000)
platform.Anchored = true
platform.CanCollide = true
platform.Material = Enum.Material.SmoothPlastic
platform.Color = Color3.fromRGB(200, 200, 255)
platform.Position = hrp.Position - Vector3.new(0, 3, 0)
platform.Transparency = platformInvisible and 1 or 0.5
platform.Parent = workspace
table.insert(multiFloorParts, platform)

-- Kolisi hanya karakter


if onlyCharacter then
pcall(function()
if not
PhysicsService:IsCollisionGroupRegistered("PlayerOnlyPlatform") then
PhysicsService:CreateCollisionGroup("PlayerOnlyPlatform")

PhysicsService:CollisionGroupSetCollidable("PlayerOnlyPlatform", "Default",
false)
end
PhysicsService:SetPartCollisionGroup(platform,
"PlayerOnlyPlatform")
for _, part in ipairs(player.Character:GetDescendants()) do
if part:IsA("BasePart") then
PhysicsService:SetPartCollisionGroup(part,
"PlayerOnlyPlatform")
end
end
end)
end

-- Hapus jika tidak diinjak


local touched = false
platform.Touched:Connect(function(hit)
if hit and hit.Parent and hit.Parent == player.Character then
touched = true
end
end)

task.delay(3, function()
if not touched and platform and platform.Parent then
platform:Destroy()
for i, p in ipairs(multiFloorParts) do if p == platform then
table.remove(multiFloorParts, i); break; end end
end
end)
end

-- === TOMBOL GUI MULTIJUMP/MULTIFLOOR ===


local multiJumpBtn = Instance.new("TextButton", menu)
multiJumpBtn.Size = UDim2.new(1, -10, 0, 40)
multiJumpBtn.Text = "MultiJump: OFF"
multiJumpBtn.BackgroundColor3 = Color3.fromRGB(70, 70, 70)
multiJumpBtn.TextColor3 = Color3.fromRGB(255, 255, 255)

multiJumpBtn.MouseButton1Click:Connect(function()
multiJumpEnabled = not multiJumpEnabled
multiJumpBtn.Text = "MultiJump: " .. (multiJumpEnabled and "ON" or "OFF")
updateButtonColor(multiJumpBtn, multiJumpEnabled)
if multiJumpEnabled then
jumpConn = UserInputService.JumpRequest:Connect(function()
local char = player.Character
local hum = char and char:FindFirstChildOfClass("Humanoid")
if hum and hum:GetState() == Enum.HumanoidStateType.Freefall then
local hrp = char:FindFirstChild("HumanoidRootPart")
if hrp then hrp.Velocity = Vector3.new(hrp.Velocity.X, 50,
hrp.Velocity.Z) end
spawnPlatform()
end
end)
else
if jumpConn then jumpConn:Disconnect(); jumpConn = nil end
end
end)

local multiFloorBtn = Instance.new("TextButton", menu)


multiFloorBtn.Size = UDim2.new(1, -10, 0, 40)
multiFloorBtn.Text = "MultiFloor: OFF"
multiFloorBtn.BackgroundColor3 = Color3.fromRGB(70, 70, 70)
multiFloorBtn.TextColor3 = Color3.fromRGB(255, 255, 255)

multiFloorBtn.MouseButton1Click:Connect(function()
multiFloorEnabled = not multiFloorEnabled
multiFloorBtn.Text = "MultiFloor: " .. (multiFloorEnabled and "ON" or "OFF")
updateButtonColor(multiFloorBtn, multiFloorEnabled)
if multiFloorEnabled then
local function monitorFall()
local hum = player.Character and
player.Character:FindFirstChildOfClass("Humanoid")
if not hum then return end
if multiFloorHumanoidConn then
multiFloorHumanoidConn:Disconnect() end
multiFloorHumanoidConn = hum.StateChanged:Connect(function(_,
state)
if multiFloorEnabled and state ==
Enum.HumanoidStateType.Freefall then spawnPlatform() end
end)
end
player.CharacterAdded:Connect(monitorFall)
monitorFall()
else
if multiFloorHumanoidConn then multiFloorHumanoidConn:Disconnect();
multiFloorHumanoidConn = nil end
for _, part in ipairs(multiFloorParts) do if part and part.Parent then
part:Destroy() end end
multiFloorParts = {}
end
end)

local onlyCharBtn = Instance.new("TextButton", menu)


onlyCharBtn.Size = UDim2.new(1, -10, 0, 40)
onlyCharBtn.Text = "Platform: For All"
onlyCharBtn.BackgroundColor3 = Color3.fromRGB(70, 70, 70)
onlyCharBtn.TextColor3 = Color3.fromRGB(255, 255, 255)

onlyCharBtn.MouseButton1Click:Connect(function()
onlyCharacter = not onlyCharacter
onlyCharBtn.Text = "Platform: " .. (onlyCharacter and "For Player" or "For
All")
updateButtonColor(onlyCharBtn, onlyCharacter)
end)

local invisBtn = Instance.new("TextButton", menu)


invisBtn.Size = UDim2.new(1, -10, 0, 40)
invisBtn.Text = "InvisPlatform: OFF"
invisBtn.BackgroundColor3 = Color3.fromRGB(70, 70, 70)
invisBtn.TextColor3 = Color3.fromRGB(255, 255, 255)

invisBtn.MouseButton1Click:Connect(function()
platformInvisible = not platformInvisible
invisBtn.Text = "InvisPlatform: " .. (platformInvisible and "ON" or "OFF")
updateButtonColor(invisBtn, platformInvisible)
local targetTransparency = platformInvisible and 1 or 0.5
for _, part in ipairs(multiFloorParts) do
if part and part.Parent then part.Transparency = targetTransparency end
end
end)

-- ================== [ ESP & AIMLOCK ] ==================


local espTeamEnabled, espEnemyEnabled, espNameEnabled, rightClickAimLockEnabled =
false, false, false, false
local espObjects = {}

-- Fungsi utama update ESP


RunService.RenderStepped:Connect(function()
for target, espObj in pairs(espObjects) do
if not (target and target.Parent and target.Character and
target.Character:FindFirstChild("Head")) then
if espObj.Box and espObj.Box.Parent then espObj.Box:Destroy() end
if espObj.Name and espObj.Name.Parent then espObj.Name:Destroy()
end
espObjects[target] = nil
end
end

for _, target in ipairs(Players:GetPlayers()) do


if target ~= player and target.Character and
target.Character:FindFirstChild("Head") then
local head = target.Character.Head
local sameTeam = (player.Team and target.Team == player.Team)

local isEnemy = not sameTeam


local isTeam = sameTeam

local showEspBox = (espEnemyEnabled and isEnemy) or


(espTeamEnabled and isTeam)
local showEspName = espNameEnabled and showEspBox

if not espObjects[target] then espObjects[target] = {} end


local esp = espObjects[target]

-- Handle Box ESP


if showEspBox then
local color = isTeam and Color3.fromRGB(0, 150, 255) or
Color3.fromRGB(255, 0, 0)
if not (esp.Box and esp.Box.Parent) then
local billboard = Instance.new("BillboardGui", head)
billboard.Name = "ESPBox"
billboard.Adornee = head
billboard.AlwaysOnTop = true
billboard.Size = UDim2.new(0, 10, 0, 10)
billboard.StudsOffset = Vector3.new(0, 0.5, 0)
local frame = Instance.new("Frame", billboard)
frame.Size = UDim2.new(1, 0, 1, 0)
frame.BackgroundColor3 = color
frame.BackgroundTransparency = 0.2
frame.BorderSizePixel = 0
esp.Box = billboard
else
esp.Box.Frame.BackgroundColor3 = color
end
elseif esp.Box and esp.Box.Parent then
esp.Box:Destroy()
esp.Box = nil
end

-- Handle Name ESP


if showEspName then
if not (esp.Name and esp.Name.Parent) then
local nameGui = Instance.new("BillboardGui", head)
nameGui.Name = "ESPNameLabel"
nameGui.Adornee = head
nameGui.Size = UDim2.new(0, 100, 0, 12)
nameGui.StudsOffset = Vector3.new(0, 1.3, 0)
nameGui.AlwaysOnTop = true
local text = Instance.new("TextLabel", nameGui)
text.Size = UDim2.fromScale(1, 1)
text.BackgroundTransparency = 1
text.Text = target.Name
text.TextColor3 = Color3.new(1, 1, 1)
text.Font = Enum.Font.SourceSans
text.TextSize = 12
local stroke = Instance.new("UIStroke", text)
stroke.Thickness = 1
stroke.Color = isTeam and Color3.fromRGB(0, 150, 255)
or Color3.fromRGB(255, 0, 0)
esp.Name = nameGui
end
elseif esp.Name and esp.Name.Parent then
esp.Name:Destroy()
esp.Name = nil
end
else
if espObjects[target] then
if espObjects[target].Box then
espObjects[target].Box:Destroy() end
if espObjects[target].Name then
espObjects[target].Name:Destroy() end
espObjects[target] = nil
end
end
end
end)

-- Tombol ESP Enemy


local espEnemyBtn = Instance.new("TextButton", menu)
espEnemyBtn.Size = UDim2.new(1, -10, 0, 40)
espEnemyBtn.Text = "ESP Enemy: OFF"
espEnemyBtn.BackgroundColor3 = Color3.fromRGB(70, 70, 70)
espEnemyBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
espEnemyBtn.MouseButton1Click:Connect(function()
espEnemyEnabled = not espEnemyEnabled
espEnemyBtn.Text = "ESP Enemy: " .. (espEnemyEnabled and "ON" or "OFF")
updateButtonColor(espEnemyBtn, espEnemyEnabled)
end)

-- Tombol ESP Team


local espTeamBtn = Instance.new("TextButton", menu)
espTeamBtn.Size = UDim2.new(1, -10, 0, 40)
espTeamBtn.Text = "ESP Team: OFF"
espTeamBtn.BackgroundColor3 = Color3.fromRGB(70, 70, 70)
espTeamBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
espTeamBtn.MouseButton1Click:Connect(function()
espTeamEnabled = not espTeamEnabled
espTeamBtn.Text = "ESP Team: " .. (espTeamEnabled and "ON" or "OFF")
updateButtonColor(espTeamBtn, espTeamEnabled)
end)

-- Tombol ESP Name


local espNameBtn = Instance.new("TextButton", menu)
espNameBtn.Size = UDim2.new(1, -10, 0, 40)
espNameBtn.Text = "ESP Name: OFF"
espNameBtn.BackgroundColor3 = Color3.fromRGB(70, 70, 70)
espNameBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
espNameBtn.MouseButton1Click:Connect(function()
espNameEnabled = not espNameEnabled
espNameBtn.Text = "ESP Name: " .. (espNameEnabled and "ON" or "OFF")
updateButtonColor(espNameBtn, espNameEnabled)
end)

-- Tombol AimLock
local aimRCBtn = Instance.new("TextButton", menu)
aimRCBtn.Size = UDim2.new(1, -10, 0, 40)
aimRCBtn.Text = "RightClick AimLock: OFF"
aimRCBtn.BackgroundColor3 = Color3.fromRGB(70, 70, 70)
aimRCBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
aimRCBtn.MouseButton1Click:Connect(function()
rightClickAimLockEnabled = not rightClickAimLockEnabled
aimRCBtn.Text = "RightClick AimLock: " .. (rightClickAimLockEnabled and "ON"
or "OFF")
updateButtonColor(aimRCBtn, rightClickAimLockEnabled)
end)

-- Fungsi Aimlock
local function getClosestESPHead()
local mousePos = UserInputService:GetMouseLocation()
local cam = workspace.CurrentCamera
local closestHead, shortestDist = nil, math.huge

for target, _ in pairs(espObjects) do


if target and target.Character and
target.Character:FindFirstChild("Head") then
if espObjects[target] and espObjects[target].Box then -- Hanya
target yang punya ESP box aktif
local head = target.Character.Head
local screenPos, onScreen =
cam:WorldToViewportPoint(head.Position)
if onScreen then
local dist = (Vector2.new(mousePos.X, mousePos.Y) -
Vector2.new(screenPos.X, screenPos.Y)).Magnitude
if dist < shortestDist and dist < 200 then -- Jarak
maksimal dari kursor
shortestDist = dist
closestHead = head
end
end
end
end
end
return closestHead
end

UserInputService.InputBegan:Connect(function(input, processed)
if input.UserInputType == Enum.UserInputType.MouseButton2 and not processed
and rightClickAimLockEnabled then
RunService:BindToRenderStep("RightClickAimLock",
Enum.RenderPriority.Camera.Value + 1, function()
local targetHead = getClosestESPHead()
if targetHead and targetHead:IsDescendantOf(workspace) then
workspace.CurrentCamera.CFrame =
CFrame.lookAt(workspace.CurrentCamera.CFrame.Position, targetHead.Position)
end
end)
end
end)

UserInputService.InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton2 then
RunService:UnbindFromRenderStep("RightClickAimLock")
end
end)

-- ================== [ FUNGSI GUI LANJUTAN ] ==================


-- INTERFACE MODE (UNDETECT)
local showUpState = false
local guiName = gui.Name or ("Gui_" .. HttpService:GenerateGUID(false):gsub("-",
""))
local showUpBtn = Instance.new("TextButton", menu)
showUpBtn.Size = UDim2.new(1, -10, 0, 40)
showUpBtn.Text = "Interface Mode: OFF"
showUpBtn.BackgroundColor3 = Color3.fromRGB(70, 70, 70)
showUpBtn.TextColor3 = Color3.fromRGB(255, 255, 255)

local function toggleSafeGui(state)


showUpState = state
showUpBtn.Text = "Interface Mode: " .. (state and "ON" or "OFF")
updateButtonColor(showUpBtn, state)

pcall(function()
gui.Name = guiName
gui.IgnoreGuiInset = state
gui.DisplayOrder = state and 999999 or 1
gui.Parent = state and CoreGui or player:WaitForChild("PlayerGui")
end)
end
showUpBtn.MouseButton1Click:Connect(function() toggleSafeGui(not showUpState) end)

-- Hancurkan semua koneksi dan objek saat GUI ditutup


destroy.MouseButton1Click:Connect(function()
if jumpConn then jumpConn:Disconnect() end
if multiFloorHumanoidConn then multiFloorHumanoidConn:Disconnect() end
if flyConn then flyConn:Disconnect() end
if flyBV then flyBV:Destroy() end
if flyGyro then flyGyro:Destroy() end
RunService:UnbindFromRenderStep("RightClickAimLock")

for _, part in ipairs(multiFloorParts) do


if part and part.Parent then part:Destroy() end
end
multiFloorParts = {}

for target, espObj in pairs(espObjects) do


if espObj.Box and espObj.Box.Parent then espObj.Box:Destroy() end
if espObj.Name and espObj.Name.Parent then espObj.Name:Destroy() end
end
espObjects = {}

gui:Destroy()
end)

You might also like