Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local OrionLib = loadstring(game:HttpGet(('https://raw.githubusercontent.com/shlexware/Orion/main/source')))()
- local Window = OrionLib:MakeWindow({Name = "Helicopter Controls", HidePremium = false})
- local Tab = Window:MakeTab({
- Name = "Helicopter Mode",
- Icon = "rbxassetid://4483345998"
- })
- local function createRotor(character)
- local rotor = Instance.new("Part")
- rotor.Size = Vector3.new(15, 0.5, 1)
- rotor.BrickColor = BrickColor.new("Really black")
- rotor.Material = Enum.Material.Metal
- rotor.CanCollide = false
- rotor.CFrame = character.HumanoidRootPart.CFrame * CFrame.new(0, 3, 0)
- local weld = Instance.new("WeldConstraint")
- weld.Part0 = rotor
- weld.Part1 = character.HumanoidRootPart
- weld.Parent = rotor
- rotor.Parent = character
- local spin = Instance.new("BodyAngularVelocity")
- spin.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
- spin.AngularVelocity = Vector3.new(0, 20, 0)
- spin.Parent = rotor
- return rotor
- end
- local function enableFlight(character)
- local bodyVelocity = Instance.new("BodyVelocity")
- bodyVelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
- bodyVelocity.Velocity = Vector3.new(0, 0, 0)
- bodyVelocity.Name = "HelicopterForce"
- bodyVelocity.Parent = character.HumanoidRootPart
- return bodyVelocity
- end
- local rotor = nil
- local flying = false
- local bodyVelocity = nil
- Tab:AddButton({
- Name = "Transform into Helicopter",
- Callback = function()
- local player = game.Players.LocalPlayer
- local character = player.Character
- if character and not rotor then
- rotor = createRotor(character)
- bodyVelocity = enableFlight(character)
- flying = true
- -- Flight controls
- game:GetService("RunService").RenderStepped:Connect(function()
- if flying and character and bodyVelocity then
- local humanoidRootPart = character.HumanoidRootPart
- local moveDirection = Vector3.new(0, 0, 0)
- -- Controls
- if game:GetService("UserInputService"):IsKeyDown(Enum.KeyCode.W) then
- moveDirection = moveDirection + humanoidRootPart.CFrame.LookVector
- end
- if game:GetService("UserInputService"):IsKeyDown(Enum.KeyCode.S) then
- moveDirection = moveDirection - humanoidRootPart.CFrame.LookVector
- end
- if game:GetService("UserInputService"):IsKeyDown(Enum.KeyCode.Space) then
- moveDirection = moveDirection + Vector3.new(0, 1, 0)
- end
- if game:GetService("UserInputService"):IsKeyDown(Enum.KeyCode.LeftControl) then
- moveDirection = moveDirection - Vector3.new(0, 1, 0)
- end
- bodyVelocity.Velocity = moveDirection * 50
- end
- end)
- end
- end
- })
- Tab:AddButton({
- Name = "Stop Helicopter Mode",
- Callback = function()
- if rotor then
- rotor:Destroy()
- rotor = nil
- end
- if bodyVelocity then
- bodyVelocity:Destroy()
- bodyVelocity = nil
- end
- flying = false
- end
- })
- OrionLib:Init()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement