local Character = Player.Character local HumanoidRootPart = Character.HumanoidRootPart local counter = 0 local flying = false local Speed = 1
local bp = Instance.new("BodyPosition", HumanoidRootPart) bp.MaxForce = Vector3.new() bp.D = 10 bp.P = 10000
local bg = Instance.new("BodyGyro", HumanoidRootPart) bg.MaxTorque = Vector3.new() bg.D = 10
-- fly the char function Fly() flying = true bp.MaxForce = Vector3.new(400000,400000,400000) bg.MaxTorque = Vector3.new(400000,400000,400000) while flying do RS.RenderStepped:wait() bp.Position = HumanoidRootPart.Position +((HumanoidRootPart.Position - Camera.CFrame.p).unit * Speed) bg.CFrame = CFrame.new(Camera.CFrame.p, HumanoidRootPart.Position) end end
function endFlying() bp.MaxForce = Vector3.new() bg.MaxTorque = Vector3.new() flying = false end