Fly made by chatgpt
Key RequiredUniversal

Fly made by chatgpt

Universal Scriptpacanhelagpacanhelag 595 views 279 executesUpdated Apr 10, 2026
Unrated
00
Lua Script•55 lines (1547 chars)
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local root = character:WaitForChild("HumanoidRootPart")

local flying = false
local speed = 50

local bodyVelocity
local bodyGyro

-- Ativar/Desativar com tecla F
local UserInputService = game:GetService("UserInputService")

UserInputService.InputBegan:Connect(function(input, gameProcessed)
	if gameProcessed then return end
	
	if input.KeyCode == Enum.KeyCode.F then
		flying = not flying
		
		if flying then
			-- Criar forças
			bodyVelocity = Instance.new("BodyVelocity")
			bodyVelocity.MaxForce = Vector3.new(1,1,1) * 100000
			bodyVelocity.Velocity = Vector3.new(0,0,0)
			bodyVelocity.Parent = root
			
			bodyGyro = Instance.new("BodyGyro")
			bodyGyro.MaxTorque = Vector3.new(1,1,1) * 100000
			bodyGyro.CFrame = root.CFrame
			bodyGyro.Parent = root
			
			humanoid.PlatformStand = true
		else
			-- Remover forças
			if bodyVelocity then bodyVelocity:Destroy() end
			if bodyGyro then bodyGyro:Destroy() end
			
			humanoid.PlatformStand = false
		end
	end
end)

-- Movimento
local RunService = game:GetService("RunService")

RunService.RenderStepped:Connect(function()
	if flying and bodyVelocity and bodyGyro then
		local camera = workspace.CurrentCamera
		local moveDirection = humanoid.MoveDirection
		
		bodyVelocity.Velocity = (camera.CFrame.LookVector * moveDirection.Z + camera.CFrame.RightVector * moveDirection.X) * speed
		bodyGyro.CFrame = camera.CFrame
	end
end)

Features & Information

Ia

Community Comments (1)

pacanhelagpacanhelagApr 10, 2026

Need keyboard

More Scripts for Universal Scripts