ADVERTISEMENTREMOVE ADS
SIMPLE FLY
46,561 views
Universal script•
1 month ago

Script Preview
Description
PRESS F TO FLY AND STOP FLY
ADVERTISEMENTREMOVE ADS
64 Lines • 2.73 KiB
-- 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)
ADVERTISEMENTREMOVE ADS
ADVERTISEMENTREMOVE ADS






Comments