Professional Documents
Culture Documents
PF Easy Fly
PF Easy Fly
-- Made by gamermanaway
-- Game: https://www.roblox.com/games/292439477/Phantom-Forces
--[[
Controls:
F - Toggle On/Off
LeftShift - Faster/Slower
W - Forward
A - Left
S -Backward
D - Right
LeftControl - Down
Space - Up
]]--
UserInputService.InputBegan:Connect(function(Input, ...)
if Input.KeyCode == Enum.KeyCode.F then
if Boolean then
Boolean = false
else
Boolean = true
end
elseif Input.KeyCode == Enum.KeyCode.LeftShift then
Speed = 100
elseif KeyCodeTable[Input.KeyCode] then
MovementTable[KeyCodeTable[Input.KeyCode]] = 1
end
end)
UserInputService.InputEnded:Connect(function(Input, ...)
if Input.KeyCode == Enum.KeyCode.LeftShift then
Speed = 50
elseif KeyCodeTable[Input.KeyCode] then
MovementTable[KeyCodeTable[Input.KeyCode]] = 0
end
end)
RunService.RenderStepped:Connect(function(...)
local Character = LocalPlayer.Character
if Character then
local HumanoidRootPart = Character:FindFirstChild("HumanoidRootPart")
local Mass = GetMass(Character)
if HumanoidRootPart then
local BodyVelocity =
HumanoidRootPart:FindFirstChildOfClass("BodyVelocity")
if BodyVelocity then
if Boolean then
BodyVelocity.MaxForce = Vector3.new(Mass * Speed,
Mass * Speed, Mass * Speed)
BodyVelocity.Velocity =
CurrentCamera.CFrame.LookVector * Speed * (MovementTable[1] - MovementTable[3]) +
CurrentCamera.CFrame.RightVector * Speed * (MovementTable[4] - MovementTable[2]) +
CurrentCamera.CFrame.UpVector * Speed * (MovementTable[6] - MovementTable[5])
else
BodyVelocity.MaxForce = Vector3.new(0, 0, 0)
BodyVelocity.Velocity = Vector3.new(0, 2, 0)
end
end
end
end
end)