Op float script
Key RequiredUniversal

Op float script

Universal Scriptkongy9087kongy9087 5.5K views 447 executesUpdated Aug 1, 2025
Unrated
00
Lua Script•105 lines (2974 chars)
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local rootPart = character:WaitForChild("HumanoidRootPart")

local isFloating = false
local floatTime = 93939939939399393838 -- long float
local delayBeforeFloat = 0.2
local heartbeatConnection = nil

-- GUI Setup
local function createFloatGui()
	local gui = Instance.new("ScreenGui")
	gui.Name = "FloatGui"
	gui.ResetOnSpawn = false
	gui.Parent = player:WaitForChild("PlayerGui")

	-- Float Toggle Button
	local floatButton = Instance.new("TextButton")
	floatButton.Name = "FloatToggleButton"
	floatButton.Text = "FLOAT: OFF"
	floatButton.Size = UDim2.new(0, 140, 0, 50)
	floatButton.Position = UDim2.new(1, -160, 0.5, -30) -- Right center
	floatButton.AnchorPoint = Vector2.new(0, 0)
	floatButton.BackgroundColor3 = Color3.fromRGB(30, 144, 255)
	floatButton.TextColor3 = Color3.new(1, 1, 1)
	floatButton.TextScaled = true
	floatButton.Parent = gui

	-- Float Up Button
	local floatUp = Instance.new("TextButton")
	floatUp.Name = "FloatUpButton"
	floatUp.Text = "FLOAT UP"
	floatUp.Size = UDim2.new(0, 140, 0, 50)
	floatUp.Position = UDim2.new(1, -160, 0.5, 30) -- Below float toggle
	floatUp.AnchorPoint = Vector2.new(0, 0)
	floatUp.BackgroundColor3 = Color3.fromRGB(60, 179, 113)
	floatUp.TextColor3 = Color3.new(1, 1, 1)
	floatUp.TextScaled = true
	floatUp.Parent = gui

	return floatButton, floatUp
end

local floatButton, floatUpButton = createFloatGui()

-- Stop floating
local function stopFloating()
	isFloating = false
	if heartbeatConnection then
		heartbeatConnection:Disconnect()
		heartbeatConnection = nil
	end
end

-- Start floating
local function startFloating()
	isFloating = true
	local elapsed = 0

	heartbeatConnection = RunService.Heartbeat:Connect(function(delta)
		elapsed += delta
		if elapsed < floatTime and isFloating then
			local velocity = rootPart.Velocity
			rootPart.Velocity = Vector3.new(velocity.X, 0, velocity.Z)
		else
			stopFloating()
			floatButton.Text = "FLOAT: OFF"
		end
	end)
end

-- Detect jump to auto-start float (if already enabled)
humanoid.Jumping:Connect(function()
	if isFloating then return end
	repeat wait() until humanoid:GetState() == Enum.HumanoidStateType.Freefall
	wait(delayBeforeFloat)

	if isFloating then
		startFloating()
	end
end)

-- Toggle Float On/Off
floatButton.MouseButton1Click:Connect(function()
	if isFloating then
		stopFloating()
		floatButton.Text = "FLOAT: OFF"
	else
		if humanoid:GetState() == Enum.HumanoidStateType.Freefall then
			isFloating = true
			startFloating()
			floatButton.Text = "FLOAT: ON"
		end
	end
end)

-- Float Up Boost
floatUpButton.MouseButton1Click:Connect(function()
	if humanoid:GetState() == Enum.HumanoidStateType.Freefall then
		rootPart.Velocity = Vector3.new(rootPart.Velocity.X, 50, rootPart.Velocity.Z)
	end
end)

Features & Information

(You can customize the float time if you want this is an edit) Hi this script let's you float but fall slowly I think that's what float means and you need to jump for it to work and I think you need to re execute it if you die and before you say "made by ai you suck" It is ok so if you say it I will delete this script from you guys ok?

Community Comments (1)

Williams_aftonWilliams_aftonDec 7, 2025

Make it to gui

More Scripts for Universal Scripts