--// Create GUI Elements local ScreenGui = Instance.new("ScreenGui") local FloatButton = Instance.new("TextButton") local DragFrame = Instance.new("Frame") --// Set GUI Properties ScreenGui.Name = "FloatGui" ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui") DragFrame.Name = "DragFrame" DragFrame.Parent = ScreenGui DragFrame.BackgroundColor3 = Color3.fromRGB(50, 50, 50) DragFrame.BorderSizePixel = 0 DragFrame.Size = UDim2.new(0, 200, 0, 80) DragFrame.Position = UDim2.new(0.4, 0, 0.4, 0) DragFrame.Active = true DragFrame.Draggable = true FloatButton.Name = "FloatButton" FloatButton.Parent = DragFrame FloatButton.BackgroundColor3 = Color3.fromRGB(100, 100, 255) FloatButton.Size = UDim2.new(1, 0, 0.5, 0) FloatButton.Position = UDim2.new(0, 0, 0, 0) FloatButton.Font = Enum.Font.SourceSans FloatButton.Text = "Float: OFF" FloatButton.TextColor3 = Color3.fromRGB(255, 255, 255) FloatButton.TextSize = 20 --// Variables local isFloating = false local player = game.Players.LocalPlayer local character = player.Character or player.CharacterAdded:Wait() local humanoidRootPart = character:WaitForChild("HumanoidRootPart") local floatForce local rotateConnection --// Toggle Float Function local function toggleFloat() isFloating = not isFloating FloatButton.Text = isFloating and "Float: ON" or "Float: OFF" if isFloating then -- Create a BodyVelocity to make the player ascend floatForce = Instance.new("BodyVelocity") floatForce.MaxForce = Vector3.new(0, math.huge, 0) floatForce.Velocity = Vector3.new(0, 5, 0) -- Ascend speed floatForce.Parent = humanoidRootPart -- Rotate the character while ascending rotateConnection = game:GetService("RunService").RenderStepped:Connect(function() humanoidRootPart.CFrame = humanoidRootPart.CFrame * CFrame.Angles(0, math.rad(2), 0) end) else -- Stop floating by removing the BodyVelocity if floatForce then floatForce:Destroy() floatForce = nil end -- Stop rotating if rotateConnection then rotateConnection:Disconnect() rotateConnection = nil end end end --// Connect Buttons FloatButton.MouseButton1Click:Connect(toggleFloat)