RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"when i press e i my keyboard i will start flying and when i press e again i will unfly"
-- local script local player = game.Players.LocalPlayer local flying = false local function fly() if flying then flying = false player.Character:SetStateEnabled(Enum.HumanoidStateType.Flying, false) else flying = true player.Character:SetStateEnabled(Enum.HumanoidStateType.Flying, true) end end game:GetService("UserInputService").InputBegan:Connect(function(inputObject, gameProcessedEvent) if inputObject.KeyCode == Enum.KeyCode.E then fly() end end)