What's new
Heapleak - Scripthub

Get the most out of HeapLeak by creating a free account! Once signed in, you’ll gain full access to restricted content, be able to share your own scripts, and participate in our member-only discussions.

Nfly Gui V1

Version / Update: v1.0.0
Download / Script Link
local Players = game:GetService("Players")
local UIS = game:GetService("UserInputService")
local RS = game:GetService("RunService")
local Workspace = game:GetService("Workspace")

local plr = Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local rootPart = char:WaitForChild("HumanoidRootPart")

local STATE = {
flying = false,
noclip = false,
antiSit = false,
speed = 10,
minimized = false
}

local dirs = {
fwd = 0, bwd = 0,
left = 0, right = 0,
down = 0, up = 0
}

local lastDirs = {
fwd = 0, bwd = 0,
left = 0, right = 0,
down = 0, up = 0
}

local connections = {
noclip = nil,
antiSit = {}
}

local GUI_CONFIG = {
frameSize = Vector2.new(180, 225),
frameSizeMin = Vector2.new(180, 70),
colors = {
main = Color3.fromRGB(230, 210, 240),
header = Color3.fromRGB(200, 180, 220),
title = Color3.fromRGB(210, 190, 230),
activeOn = Color3.fromRGB(120, 220, 120),
activeOff = Color3.fromRGB(80, 60, 90)
}
}

local function createGui()
local gui = Instance.new("ScreenGui")
gui.Name = "NFly"
gui.Parent = game.CoreGui
gui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling

local frame = Instance.new("Frame", gui)
frame.Name = "MainFrame"
frame.BackgroundColor3 = GUI_CONFIG.colors.main
frame.BorderSizePixel = 0
frame.Position = UDim2.new(0.195678264, 0, 0.562977076, 0)
frame.Size = UDim2.new(0, GUI_CONFIG.frameSize.X, 0, GUI_CONFIG.frameSize.Y)

local corner = Instance.new("UICorner", frame)
corner.CornerRadius = UDim.new(0, 6)

return gui, frame
end

local function createTitleBar(parent)
local titleBar = Instance.new("Frame", parent)
titleBar.Name = "TitleBar"
titleBar.BackgroundColor3 = GUI_CONFIG.colors.title
titleBar.BorderSizePixel = 0
titleBar.Size = UDim2.new(1, 0, 0, 35)

local titleCorner = Instance.new("UICorner", titleBar)
titleCorner.CornerRadius = UDim.new(0, 6)

local titleLbl = Instance.new("TextLabel", titleBar)
titleLbl.Name = "Title"
titleLbl.BackgroundTransparency = 1
titleLbl.Size = UDim2.new(1, 0, 1, 0)
titleLbl.Font = Enum.Font.SourceSansBold
titleLbl.Text = "Nfly Gui V1"
titleLbl.TextColor3 = Color3.fromRGB(50, 50, 50)
titleLbl.TextSize = 18
titleLbl.TextXAlignment = Enum.TextXAlignment.Center
titleLbl.TextYAlignment = Enum.TextYAlignment.Center

return titleBar
end

local function createHeader(parent)
local hdr = Instance.new("Frame", parent)
hdr.Name = "Header"
hdr.BackgroundColor3 = GUI_CONFIG.colors.header
hdr.BorderSizePixel = 0
hdr.Position = UDim2.new(0, 0, 0, 35)
hdr.Size = UDim2.new(1, 0, 0, 35)

local closeBtn = Instance.new("TextButton", hdr)
closeBtn.Name = "Close"
closeBtn.BackgroundColor3 = Color3.fromRGB(180, 140, 200)
closeBtn.BorderSizePixel = 0
closeBtn.Position = UDim2.new(0, 0, 0, 0)
closeBtn.Size = UDim2.new(0, 30, 0, 35)
closeBtn.Font = Enum.Font.SourceSansBold
closeBtn.Text = "X"
closeBtn.TextColor3 = Color3.fromRGB(50, 50, 50)
closeBtn.TextSize = 20

local minBtn = Instance.new("TextButton", hdr)
minBtn.Name = "Minimize"
minBtn.BackgroundColor3 = Color3.fromRGB(190, 150, 210)
minBtn.BorderSizePixel = 0
minBtn.Position = UDim2.new(0, 30, 0, 0)
minBtn.Size = UDim2.new(0, 30, 0, 35)
minBtn.Font = Enum.Font.SourceSansBold
minBtn.Text = "-"
minBtn.TextColor3 = Color3.fromRGB(50, 50, 50)
minBtn.TextSize = 20

local noclipBtn = Instance.new("TextButton", hdr)
noclipBtn.Name = "NoclipToggle"
noclipBtn.BackgroundColor3 = GUI_CONFIG.colors.activeOff
noclipBtn.BorderSizePixel = 0
noclipBtn.Position = UDim2.new(0, 60, 0, 0)
noclipBtn.Size = UDim2.new(1, -60, 1, 0)
noclipBtn.Font = Enum.Font.SourceSansBold
noclipBtn.Text = "Noclip: OFF"
noclipBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
noclipBtn.TextSize = 16

return hdr, closeBtn, minBtn, noclipBtn
end

local function createControls(parent)
local controls = {}

controls.toggleBtn = Instance.new("TextButton", parent)
controls.toggleBtn.Name = "ToggleFly"
controls.toggleBtn.BackgroundColor3 = Color3.fromRGB(220, 200, 240)
controls.toggleBtn.BorderSizePixel = 0
controls.toggleBtn.Position = UDim2.new(0, 0, 0, 70)
controls.toggleBtn.Size = UDim2.new(0.5, 0, 0, 50)
controls.toggleBtn.Font = Enum.Font.SourceSansBold
controls.toggleBtn.Text = "Start"
controls.toggleBtn.TextColor3 = Color3.fromRGB(50, 50, 50)
controls.toggleBtn.TextSize = 24

controls.speedBox = Instance.new("TextBox", parent)
controls.speedBox.Name = "SpeedInput"
controls.speedBox.BackgroundColor3 = Color3.fromRGB(240, 220, 250)
controls.speedBox.BorderSizePixel = 0
controls.speedBox.Position = UDim2.new(0.5, 0, 0, 70)
controls.speedBox.Size = UDim2.new(0.5, 0, 0, 50)
controls.speedBox.Font = Enum.Font.SourceSansBold
controls.speedBox.Text = "10"
controls.speedBox.TextColor3 = Color3.fromRGB(50, 50, 50)
controls.speedBox.TextSize = 20
controls.speedBox.ClearTextOnFocus = false

local speedBtns = {
{name = "Inc1", text = "+1", pos = 0, color = Color3.fromRGB(210, 180, 230)},
{name = "Inc10", text = "+10", pos = 0.25, color = Color3.fromRGB(210, 180, 230)},
{name = "Dec1", text = "-1", pos = 0.5, color = Color3.fromRGB(200, 170, 220)},
{name = "Dec10", text = "-10", pos = 0.75, color = Color3.fromRGB(200, 170, 220)}
}

for _, config in ipairs(speedBtns) do
local btn = Instance.new("TextButton", parent)
btn.Name = config.name
btn.BackgroundColor3 = config.color
btn.BorderSizePixel = 0
btn.Position = UDim2.new(config.pos, 0, 0, 120)
btn.Size = UDim2.new(0.25, 0, 0, 35)
btn.Font = Enum.Font.SourceSansBold
btn.Text = config.text
btn.TextColor3 = Color3.fromRGB(50, 50, 50)
btn.TextSize = 20
controls[config.name:lower()] = btn
end

controls.upBtn = Instance.new("TextButton", parent)
controls.upBtn.Name = "Up"
controls.upBtn.BackgroundColor3 = Color3.fromRGB(220, 190, 240)
controls.upBtn.BorderSizePixel = 0
controls.upBtn.Position = UDim2.new(0, 0, 0, 155)
controls.upBtn.Size = UDim2.new(0.5, 0, 0, 35)
controls.upBtn.Font = Enum.Font.SourceSansBold
controls.upBtn.Text = "↑"
controls.upBtn.TextColor3 = Color3.fromRGB(50, 50, 50)
controls.upBtn.TextSize = 28

controls.downBtn = Instance.new("TextButton", parent)
controls.downBtn.Name = "Down"
controls.downBtn.BackgroundColor3 = Color3.fromRGB(230, 200, 250)
controls.downBtn.BorderSizePixel = 0
controls.downBtn.Position = UDim2.new(0.5, 0, 0, 155)
controls.downBtn.Size = UDim2.new(0.5, 0, 0, 35)
controls.downBtn.Font = Enum.Font.SourceSansBold
controls.downBtn.Text = "↓"
controls.downBtn.TextColor3 = Color3.fromRGB(50, 50, 50)
controls.downBtn.TextSize = 28

controls.antiSitBtn = Instance.new("TextButton", parent)
controls.antiSitBtn.Name = "AntiSitToggle"
controls.antiSitBtn.BackgroundColor3 = GUI_CONFIG.colors.activeOff
controls.antiSitBtn.BorderSizePixel = 0
controls.antiSitBtn.Position = UDim2.new(0, 0, 0, 190)
controls.antiSitBtn.Size = UDim2.new(1, 0, 0, 35)
controls.antiSitBtn.Font = Enum.Font.SourceSansBold
controls.antiSitBtn.Text = "Anti Sit - Anti Bring: OFF"
controls.antiSitBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
controls.antiSitBtn.TextSize = 14

return controls
end

local function updateSpeed()
return tostring(STATE.speed)
end

local function initFly()
STATE.flying = true
local gyro = Instance.new("BodyGyro")
local velo = Instance.new("BodyVelocity")

gyro.P = 9e4
gyro.MaxTorque = Vector3.new(9e9, 9e9, 9e9)
gyro.CFrame = workspace.CurrentCamera.CFrame
gyro.Parent = rootPart

velo.Velocity = Vector3.zero
velo.MaxForce = Vector3.new(9e9, 9e9, 9e9)
velo.Parent = rootPart

task.spawn(function()
while STATE.flying do
task.wait()
local hum = char:FindFirstChildOfClass("Humanoid")
if hum then hum.PlatformStand = true end

if (dirs.left + dirs.right) ~= 0 or (dirs.fwd + dirs.bwd) ~= 0 or (dirs.down + dirs.up) ~= 0 then
lastDirs = {
fwd = dirs.fwd, bwd = dirs.bwd,
left = dirs.left, right = dirs.right,
down = dirs.down, up = dirs.up
}
end

local cam = workspace.CurrentCamera
local fwdVec = cam.CFrame.LookVector * (dirs.fwd + dirs.bwd)
local rightVec = cam.CFrame.RightVector * (dirs.left + dirs.right)
local upVec = Vector3.new(0, -(dirs.down + dirs.up), 0)

local isMoving = (dirs.left + dirs.right) ~= 0 or
(dirs.fwd + dirs.bwd) ~= 0 or
(dirs.down + dirs.up) ~= 0

velo.Velocity = (fwdVec + rightVec + upVec) * (isMoving and STATE.speed or 0)
gyro.CFrame = cam.CFrame
end

dirs = {fwd = 0, bwd = 0, left = 0, right = 0, down = 0, up = 0}
lastDirs = {fwd = 0, bwd = 0, left = 0, right = 0, down = 0, up = 0}
gyro:Destroy()
velo:Destroy()
local hum = char:FindFirstChildOfClass("Humanoid")
if hum then hum.PlatformStand = false end
end)
end

local function toggleNoclip(btn)
STATE.noclip = not STATE.noclip

if STATE.noclip then
btn.Text = "Noclip: ON"
btn.BackgroundColor3 = GUI_CONFIG.colors.activeOn
btn.TextColor3 = Color3.fromRGB(20, 20, 20)

connections.noclip = RS.Stepped:Connect(function()
pcall(function()
for _, part in pairs(plr.Character:GetDescendants()) do
if part:IsA("BasePart") then
part.CanCollide = false
end
end
end)
end)
else
btn.Text = "Noclip: OFF"
btn.BackgroundColor3 = GUI_CONFIG.colors.activeOff
btn.TextColor3 = Color3.fromRGB(255, 255, 255)

if connections.noclip then
connections.noclip:Disconnect()
connections.noclip = nil
end

pcall(function()
for _, part in pairs(plr.Character:GetDescendants()) do
if part:IsA("BasePart") then
part.CanCollide = true
end
end
end)
end
end

local function neutralizeSeat(seat)
if seat:IsA("Seat") or seat:IsA("VehicleSeat") then
seat.Disabled = true
seat.CanTouch = false
seat:SetAttribute("Neutralized", true)
end
end

local function toggleAntiSit(btn)
STATE.antiSit = not STATE.antiSit

if STATE.antiSit then
btn.Text = "Anti Sit - Anti Bring: ON"
btn.BackgroundColor3 = GUI_CONFIG.colors.activeOn
btn.TextColor3 = Color3.fromRGB(20, 20, 20)

for _, obj in ipairs(Workspace:GetDescendants()) do
neutralizeSeat(obj)
end

connections.antiSit.descendant = Workspace.DescendantAdded:Connect(function(obj)
if STATE.antiSit and (obj:IsA("Seat") or obj:IsA("VehicleSeat")) then
task.wait(0.1)
neutralizeSeat(obj)
end
end)

connections.antiSit.character = plr.CharacterAdded:Connect(function(newChar)
if STATE.antiSit then
local humanoid = newChar:WaitForChild("Humanoid")
connections.antiSit.sit = humanoid:GetPropertyChangedSignal("Sit"):Connect(function()
if STATE.antiSit and humanoid.Sit then
humanoid.Sit = false
end
end)
end
end)

if char then
local humanoid = char:FindFirstChildOfClass("Humanoid")
if humanoid then
connections.antiSit.sit = humanoid:GetPropertyChangedSignal("Sit"):Connect(function()
if STATE.antiSit and humanoid.Sit then
humanoid.Sit = false
end
end)
end
end
else
btn.Text = "Anti Sit - Anti Bring: OFF"
btn.BackgroundColor3 = GUI_CONFIG.colors.activeOff
btn.TextColor3 = Color3.fromRGB(255, 255, 255)

for _, conn in pairs(connections.antiSit) do
if conn then conn:Disconnect() end
end
connections.antiSit = {}

for _, obj in ipairs(Workspace:GetDescendants()) do
if (obj:IsA("Seat") or obj:IsA("VehicleSeat")) and obj:GetAttribute("Neutralized") then
obj.Disabled = false
obj.CanTouch = true
obj:SetAttribute("Neutralized", nil)
end
end
end
end

local function setupInputHandlers()
UIS.InputBegan:Connect(function(inp, proc)
if proc then return end
local kc = inp.KeyCode

if kc == Enum.KeyCode.W then dirs.fwd = 1
elseif kc == Enum.KeyCode.S then dirs.bwd = -1
elseif kc == Enum.KeyCode.A then dirs.left = -1
elseif kc == Enum.KeyCode.D then dirs.right = 1
elseif kc == Enum.KeyCode.Q then dirs.down = 1
elseif kc == Enum.KeyCode.E then dirs.up = -1
end
end)

UIS.InputEnded:Connect(function(inp, proc)
if proc then return end
local kc = inp.KeyCode

if kc == Enum.KeyCode.W then dirs.fwd = 0
elseif kc == Enum.KeyCode.S then dirs.bwd = 0
elseif kc == Enum.KeyCode.A then dirs.left = 0
elseif kc == Enum.KeyCode.D then dirs.right = 0
elseif kc == Enum.KeyCode.Q then dirs.down = 0
elseif kc == Enum.KeyCode.E then dirs.up = 0
end
end)
end

local function setupDragging(titleBar, hdr, frame)
local dragActive, dragPos, startPos

local function updatePos(input)
local delta = input.Position - dragPos
frame.Position = UDim2.new(
startPos.X.Scale, startPos.X.Offset + delta.X,
startPos.Y.Scale, startPos.Y.Offset + delta.Y
)
end

local function handleInput(element)
element.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 or
input.UserInputType == Enum.UserInputType.Touch then
dragActive = true
dragPos = input.Position
startPos = frame.Position
input.Changed:Connect(function()
if input.UserInputState == Enum.UserInputState.End then
dragActive = false
end
end)
end
end)

element.InputChanged:Connect(function(input)
if dragActive and (input.UserInputType == Enum.UserInputType.MouseMovement or
input.UserInputType == Enum.UserInputType.Touch) then
updatePos(input)
end
end)
end

handleInput(titleBar)
handleInput(hdr)
end

local function setupButtonHandlers(controls, frame, gui)
controls.toggleBtn.MouseButton1Click:Connect(function()
if not STATE.flying then
char = plr.Character or plr.CharacterAdded:Wait()
rootPart = char:WaitForChild("HumanoidRootPart")
initFly()
controls.toggleBtn.Text = "Stop"
else
STATE.flying = false
controls.toggleBtn.Text = "Start"
end
end)

controls.inc1.MouseButton1Click:Connect(function()
STATE.speed = math.min(STATE.speed + 1, 10000)
controls.speedBox.Text = updateSpeed()
end)

controls.inc10.MouseButton1Click:Connect(function()
STATE.speed = math.min(STATE.speed + 10, 10000)
controls.speedBox.Text = updateSpeed()
end)

controls.dec1.MouseButton1Click:Connect(function()
STATE.speed = math.max(STATE.speed - 1, 10)
controls.speedBox.Text = updateSpeed()
end)

controls.dec10.MouseButton1Click:Connect(function()
STATE.speed = math.max(STATE.speed - 10, 10)
controls.speedBox.Text = updateSpeed()
end)

controls.upBtn.MouseButton1Down:Connect(function() dirs.up = -1 end)
controls.upBtn.MouseButton1Up:Connect(function() dirs.up = 0 end)

controls.downBtn.MouseButton1Down:Connect(function() dirs.down = 1 end)
controls.downBtn.MouseButton1Up:Connect(function() dirs.down = 0 end)

controls.speedBox.FocusLost:Connect(function(enter)
if enter then
local num = tonumber(controls.speedBox.Text)
if num then
STATE.speed = math.clamp(num, 10, 10000)
controls.speedBox.Text = updateSpeed()
else
controls.speedBox.Text = updateSpeed()
end
end
end)
end

local function setupWindowControls(closeBtn, minBtn, controls, frame, gui)
closeBtn.MouseButton1Click:Connect(function()
gui.Enabled = false
end)

minBtn.MouseButton1Click:Connect(function()
STATE.minimized = not STATE.minimized

controls.toggleBtn.Visible = not STATE.minimized
controls.speedBox.Visible = not STATE.minimized
controls.inc1.Visible = not STATE.minimized
controls.inc10.Visible = not STATE.minimized
controls.dec1.Visible = not STATE.minimized
controls.dec10.Visible = not STATE.minimized
controls.upBtn.Visible = not STATE.minimized
controls.downBtn.Visible = not STATE.minimized
controls.antiSitBtn.Visible = not STATE.minimized

frame.Size = STATE.minimized and
UDim2.new(0, GUI_CONFIG.frameSizeMin.X, 0, GUI_CONFIG.frameSizeMin.Y) or
UDim2.new(0, GUI_CONFIG.frameSize.X, 0, GUI_CONFIG.frameSize.Y)
end)
end

local function init()
local gui, frame = createGui()
local titleBar = createTitleBar(frame)
local hdr, closeBtn, minBtn, noclipBtn = createHeader(frame)
local controls = createControls(frame)

setupInputHandlers()
setupDragging(titleBar, hdr, frame)
setupButtonHandlers(controls, frame, gui)
setupWindowControls(closeBtn, minBtn, controls, frame, gui)

noclipBtn.MouseButton1Click:Connect(function()
toggleNoclip(noclipBtn)
end)

controls.antiSitBtn.MouseButton1Click:Connect(function()
toggleAntiSit(controls.antiSitBtn)
end)

controls.speedBox.Text = updateSpeed()
end

init()
[ View More ]
58580819-b8ef-43eb-9402-5bf24aa9f655.webp


- Pc & Mobile - Moveable Gui - Open Source - No key - Free - Noclip - Fly - Anti bring - Anti sit - English - Fly feature using the Flygui v4
 
Works on mobile
  1. Yes
Back
Top