
Key Required

--<----------Swiftbara Hub Welcome-------->--
-- ui hint
local gui = Instance.new("ScreenGui")
gui.Name = "FlightHintUI"
gui.ResetOnSpawn = false
gui.Parent = game:GetService("CoreGui")
local text = Instance.new("TextLabel")
text.Size = UDim2.new(0, 800, 0, 30)
text.Position = UDim2.new(0.5, -400, 0, -30)
text.BackgroundTransparency = 1
text.TextScaled = false
text.TextSize = 18
text.Font = Enum.Font.GothamMedium
text.TextStrokeTransparency = 0.6
text.Text = "F = Flight | N = Noclip | X = Stop | +/- = Increase / Decrease Speed"
text.Parent = gui
-- rgb effect
task.spawn(function()
local t = 0
while gui.Parent do
t += 0.03
text.TextColor3 = Color3.fromHSV(t % 1, 1, 1)
task.wait(0.1)
end
end)
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local UIS = game:GetService("UserInputService")
local lp = Players.LocalPlayer
local char = lp.Character or lp.CharacterAdded:Wait()
local hum = char:WaitForChild("Humanoid")
local root = char:WaitForChild("HumanoidRootPart")
-- settings
local flying = false
local flySpeed = 50
local flyConn
local noclip = false
local noclipConn
local oldCollide = {}
-- keys
local keys = {
fly = Enum.KeyCode.F,
noclip = Enum.KeyCode.N,
speedUp = Enum.KeyCode.Equals,
speedDown = Enum.KeyCode.Minus,
reset = Enum.KeyCode.R,
stop = Enum.KeyCode.X
}
-- noclip
local function setNoclip(state)
noclip = state
if not state then
if noclipConn then
noclipConn:Disconnect()
noclipConn = nil
end
for p, v in pairs(oldCollide) do
if p and p.Parent then
p.CanCollide = v
end
end
oldCollide = {}
return
end
oldCollide = {}
for _, v in ipairs(char:GetDescendants()) do
if v:IsA("BasePart") then
oldCollide[v] = v.CanCollide
v.CanCollide = false
end
end
noclipConn = RunService.Stepped:Connect(function()
if not noclip then return end
for _, v in ipairs(char:GetDescendants()) do
if v:IsA("BasePart") then
v.CanCollide = false
end
end
end)
end
-- network ownership (reduce lag/desync)
local function ownRoot()
pcall(function()
if root:GetNetworkOwner() ~= lp then
root:SetNetworkOwner(lp)
end
end)
end
-- movement
local function flyStep()
if not flying or not root then return end
ownRoot()
local cam = workspace.CurrentCamera
local dir = Vector3.zero
if UIS:IsKeyDown(Enum.KeyCode.W) then dir += cam.CFrame.LookVector end
if UIS:IsKeyDown(Enum.KeyCode.S) then dir -= cam.CFrame.LookVector end
if UIS:IsKeyDown(Enum.KeyCode.A) then dir -= cam.CFrame.RightVector end
if UIS:IsKeyDown(Enum.KeyCode.D) then dir += cam.CFrame.RightVector end
if UIS:IsKeyDown(Enum.KeyCode.Space) then dir += Vector3.new(0,1,0) end
if UIS:IsKeyDown(Enum.KeyCode.E) then dir -= Vector3.new(0,1,0) end
if dir.Magnitude > 0 then
dir = dir.Unit
root.CFrame = root.CFrame + (dir * flySpeed * 0.03)
end
end
-- flight toggle
local function enableFly()
if flying then return end
flying = true
flyConn = RunService.Heartbeat:Connect(flyStep)
end
local function disableFly()
if not flying then return end
flying = false
if flyConn then
flyConn:Disconnect()
flyConn = nil
end
hum:ChangeState(Enum.HumanoidStateType.Running)
end
-- emergency
local function hardStop()
disableFly()
setNoclip(false)
if root then
root.Velocity = Vector3.zero
end
end
-- input
UIS.InputBegan:Connect(function(i, gpe)
if gpe then return end
if i.KeyCode == keys.fly then
if flying then disableFly() else enableFly() end
elseif i.KeyCode == keys.noclip then
setNoclip(not noclip)
elseif i.KeyCode == keys.speedUp then
flySpeed = math.clamp(flySpeed + 10, 10, 200)
elseif i.KeyCode == keys.speedDown then
flySpeed = math.clamp(flySpeed - 10, 10, 200)
elseif i.KeyCode == keys.reset then
flySpeed = 50
elseif i.KeyCode == keys.stop then
hardStop()
end
end)
-- respawn fix
lp.CharacterAdded:Connect(function(c)
char = c
hum = c:WaitForChild("Humanoid")
root = c:WaitForChild("HumanoidRootPart")
task.wait(0.3)
if flying then enableFly() end
if noclip then setNoclip(true) end
end)
-- auto start
task.wait(1)
enableFly()
print("flight loaded | F fly | N noclip | X stop")No comments yet for this script.



