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.

SIMPLE FLY

Version / Update: v1.0.0
Download / Script Link
-- SIMPLE FLY BY dika48663

local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")

local LocalPlayer = Players.LocalPlayer
local Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")

local flying = false
local flySpeed = 100 --Set up it to for yourself
local maxFlySpeed = 1000 --Set up it to for yourself
local speedIncrement = 0.4 --Set up it to for yourself
local originalGravity = workspace.Gravity

LocalPlayer.CharacterAdded:Connect(function(newCharacter)
Character = newCharacter
Humanoid = Character:WaitForChild("Humanoid")
HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
end)

local function randomizeValue(value, range)
return value + (value * (math.random(-range, range) / 100))
end

local function fly()
while flying do
local MoveDirection = Vector3.new()
local cameraCFrame = workspace.CurrentCamera.CFrame

MoveDirection = MoveDirection + (UserInputService:IsKeyDown(Enum.KeyCode.W) and cameraCFrame.LookVector or Vector3.new())
MoveDirection = MoveDirection - (UserInputService:IsKeyDown(Enum.KeyCode.S) and cameraCFrame.LookVector or Vector3.new())
MoveDirection = MoveDirection - (UserInputService:IsKeyDown(Enum.KeyCode.A) and cameraCFrame.RightVector or Vector3.new())
MoveDirection = MoveDirection + (UserInputService:IsKeyDown(Enum.KeyCode.D) and cameraCFrame.RightVector or Vector3.new())
MoveDirection = MoveDirection + (UserInputService:IsKeyDown(Enum.KeyCode.Space) and Vector3.new(0, 1, 0) or Vector3.new())
MoveDirection = MoveDirection - (UserInputService:IsKeyDown(Enum.KeyCode.LeftShift) and Vector3.new(0, 1, 0) or Vector3.new())

if MoveDirection.Magnitude > 0 then
flySpeed = math.min(flySpeed + speedIncrement, maxFlySpeed)
MoveDirection = MoveDirection.Unit * math.min(randomizeValue(flySpeed, 10), maxFlySpeed)
HumanoidRootPart.Velocity = MoveDirection * 0.5
else
HumanoidRootPart.Velocity = Vector3.new(0, 0, 0)
end

RunService.RenderStepped:Wait()
end
end

UserInputService.InputBegan:Connect(function(input, gameProcessed)
if not gameProcessed and input.KeyCode == Enum.KeyCode.F then
flying = not flying
if flying then
workspace.Gravity = 0
fly()
else
flySpeed = 100
HumanoidRootPart.Velocity = Vector3.new(0, 0, 0)
workspace.Gravity = originalGravity
end
end
end)
[ View More ]
fc0d500a-16e7-46c5-8b04-ea65a153bdf6.webp


PRESS F TO FLY AND STOP FLY
 
Back
Top