Smooth Fly Script
Smooth Fly Script
local Settings = {
Speed = 5,
SprintSpeed = 30,
ToggleKey = Enum.KeyCode.LeftAlt,
SprintKey = Enum.KeyCode.LeftControl,
ForwardKey = Enum.KeyCode.W,
LeftKey = Enum.KeyCode.A,
BackwardKey = Enum.KeyCode.S,
RightKey = Enum.KeyCode.D,
UpKey = Enum.KeyCode.E,
DownKey = Enum.KeyCode.Q,
pcall(function()
game.Players.LocalPlayer.DevCameraOcclusionMode =
Enum.DevCameraOcclusionMode.Invisicam
end)
function Lerp(a, b, t)
return a + (b - a) * t
end
game:GetService("UserInputService").InputBegan:connect(function(inputObject,
gameProcessedEvent)
end)
game:GetService("UserInputService").InputEnded:connect(function(inputObject,
gameProcessedEvent)
end)
RunService.RenderStepped:Connect(function()
if Toggled and game.Players.LocalPlayer.Character and
game.Players.LocalPlayer.Character:FindFirstChild("HumanoidRootPart") then
for i,v in pairs(game.Players.LocalPlayer.Character:GetDescendants())
do
if v:IsA("BasePart") then
v.Velocity = Vector3.new(0,0,0)
end
end
local RootPart = game.Players.LocalPlayer.Character.HumanoidRootPart
if LastPos then
Distance.Text = math.floor((LastPos-
RootPart.Position).Magnitude+.5)
if (LastPos-RootPart.Position).Magnitude >= 350 then
Distance.TextColor3 = Color3.new(1,0,0)
else
Distance.TextColor3 = Color3.new(1,1,1)
end
else
Distance.TextColor3 = Color3.new(1,1,1)
Distance.Text = 0
end
InterpolatedDir = InterpolatedDir:Lerp((Direction * (Sprinting and
Settings.SprintSpeed or Settings.Speed)),.2)
InterpolatedTilt = Lerp(InterpolatedTilt ,Tilt* (Sprinting and 2 or
1),Tilt == 0 and .2 or .1)
RootPart.CFrame =
RootPart.CFrame:Lerp(CFrame.new(RootPart.Position,RootPart.Position +
Mouse.UnitRay.Direction) * CFrame.Angles(0,math.rad(00),0) *
CFrame.new(InterpolatedDir) * CFrame.Angles(math.rad(InterpolatedTilt),0,0),.2)
else
Distance.TextColor3 = Color3.new(1,1,1)
Distance.Text = 0
end
end)