Float Universal
Key RequiredUniversal

Float Universal

Universal ScriptXTNMODSXTNMODS 119 views 12.3K executesUpdated Aug 4, 2026
Unrated
00
Lua Script•385 lines (11962 chars)
-- FLOAT PLATFORM V3.2 FIXED ALL BUGS - Auto Float
-- Made by R-XTION
-- Điều chỉnh khoảng cách nút (thu gọn hơn)

local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local TweenService = game:GetService("TweenService")
local UserInputService = game:GetService("UserInputService")

local player = Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local hrp = char:WaitForChild("HumanoidRootPart")
local humanoid = char:WaitForChild("Humanoid")

-- GUI Setup
local gui = Instance.new("ScreenGui")
gui.Name = "FloatMenuV32"
gui.ResetOnSpawn = false
gui.Parent = game:GetService("CoreGui")

local frame = Instance.new("Frame")
frame.Size = UDim2.new(0, 280, 0, 230)  -- Chiều cao 230 (vừa phải)
frame.Position = UDim2.new(0.35, 0, 0.35, 0)
frame.BackgroundColor3 = Color3.fromRGB(35, 35, 35)
frame.Active = true
frame.Draggable = true
frame.Parent = gui
frame.Visible = true

local uiCorner = Instance.new("UICorner", frame)
uiCorner.CornerRadius = UDim.new(0, 10)

local uiStroke = Instance.new("UIStroke", frame)
uiStroke.Thickness = 2

-- Nút đóng
local closeBtn = Instance.new("TextButton", frame)
closeBtn.Size = UDim2.new(0, 30, 0, 30)
closeBtn.Position = UDim2.new(1, -35, 0, 5)
closeBtn.Text = "×"
closeBtn.Font = Enum.Font.GothamBold
closeBtn.TextScaled = true
closeBtn.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
closeBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
closeBtn.BorderSizePixel = 0
Instance.new("UICorner", closeBtn).CornerRadius = UDim.new(0, 8)

local title = Instance.new("TextLabel", frame)
title.Size = UDim2.new(1, -40, 0, 30)
title.Position = UDim2.new(0, 5, 0, 0)
title.BackgroundTransparency = 1
title.Text = "FLOATMENU V3.2 FIXED"
title.Font = Enum.Font.GothamBold
title.TextColor3 = Color3.fromRGB(255, 255, 255)
title.TextScaled = true
title.TextXAlignment = Enum.TextXAlignment.Left

local made = Instance.new("TextLabel", frame)
made.Size = UDim2.new(1, 0, 0, 20)
made.Position = UDim2.new(0, 0, 0.14, 0)  -- Dịch xuống 1 chút
made.BackgroundTransparency = 1
made.Text = "Made by R-XTION"
made.Font = Enum.Font.Gotham
made.TextScaled = true
made.TextColor3 = Color3.fromRGB(255, 200, 0)

-- Nút hiện menu
local showBtn = Instance.new("TextButton", gui)
showBtn.Size = UDim2.new(0, 40, 0, 40)
showBtn.Position = UDim2.new(1, -50, 0, 10)
showBtn.Text = "☰"
showBtn.Font = Enum.Font.GothamBold
showBtn.TextScaled = true
showBtn.BackgroundColor3 = Color3.fromRGB(35, 35, 35)
showBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
showBtn.BorderSizePixel = 0
showBtn.Visible = false
showBtn.Active = true
Instance.new("UICorner", showBtn).CornerRadius = UDim.new(0, 10)
Instance.new("UIStroke", showBtn).Thickness = 2

-- Drag cho showBtn
local dragToggle = false
local dragInput
local dragStart
local startPos

showBtn.InputBegan:Connect(function(input)
    if input.UserInputType == Enum.UserInputType.MouseButton1 then
        dragToggle = true
        dragStart = input.Position
        startPos = showBtn.Position
        input.Changed:Connect(function()
            if input.UserInputState == Enum.UserInputState.End then
                dragToggle = false
            end
        end)
    end
end)

showBtn.InputChanged:Connect(function(input)
    if input.UserInputType == Enum.UserInputType.MouseMovement then
        dragInput = input
    end
end)

UserInputService.InputChanged:Connect(function(input)
    if input == dragInput and dragToggle then
        local delta = input.Position - dragStart
        local newX = startPos.X.Scale + (delta.X / UserInputService.ViewSizeX)
        local newY = startPos.Y.Scale + (delta.Y / UserInputService.ViewSizeY)
        
        newX = math.clamp(newX, 0, 1 - showBtn.Size.X.Scale)
        newY = math.clamp(newY, 0, 1 - showBtn.Size.Y.Scale)
        
        showBtn.Position = UDim2.new(newX, 0, newY, 0)
    end
end)

closeBtn.MouseButton1Click:Connect(function()
    frame.Visible = false
    showBtn.Visible = true
end)

showBtn.MouseButton1Click:Connect(function()
    frame.Visible = true
    showBtn.Visible = false
end)

-- Logic float
local savedY = nil
local floating = false
local autoFloating = false
local systemActive = true
local platform
local followConn
local autoFollowConn

local defaultWalkSpeed = humanoid.WalkSpeed
local defaultJumpPower = humanoid.JumpPower

local OFFSET = 3.5
local SIZE = Vector3.new(50, 1, 50)
local TWEEN_TIME = 0.25

local function createPlatform(y)
    if platform and platform.Parent then return platform end
    platform = Instance.new("Part")
    platform.Anchored = true
    platform.CanCollide = true
    platform.Material = Enum.Material.ForceField
    platform.Transparency = 0.4
    platform.Size = SIZE
    platform.CastShadow = false
    platform.Position = Vector3.new(hrp.Position.X, y - OFFSET, hrp.Position.Z)
    platform.Parent = workspace
    return platform
end

local function destroyPlatform()
    if platform then
        platform:Destroy()
        platform = nil
    end
end

local function followPlatform()
    if followConn then return end
    followConn = RunService.RenderStepped:Connect(function()
        if floating and platform and savedY and systemActive then
            platform.Position = Vector3.new(hrp.Position.X, savedY - OFFSET, hrp.Position.Z)
        end
    end)
end

local function autoFollowPlatform()
    if autoFollowConn then return end
    autoFollowConn = RunService.RenderStepped:Connect(function()
        if autoFloating and platform and systemActive then
            local currentY = hrp.Position.Y
            platform.Position = Vector3.new(hrp.Position.X, currentY - OFFSET, hrp.Position.Z)
        end
    end)
end

local function stopFollow()
    if followConn then
        followConn:Disconnect()
        followConn = nil
    end
    if autoFollowConn then
        autoFollowConn:Disconnect()
        autoFollowConn = nil
    end
end

local function killFloatSystem()
    systemActive = false
    stopFollow()
    destroyPlatform()
    floating = false
    autoFloating = false
    
    if humanoid then
        humanoid.WalkSpeed = defaultWalkSpeed or 16
        humanoid.JumpPower = defaultJumpPower or 50
    end
    
    if frame then frame.Visible = false end
    if showBtn then showBtn.Visible = false end
    
    if gui then 
        task.wait(0.1)
        gui:Destroy()
        gui = nil
    end
    
    if player and player.CharacterAdded then
        player.CharacterAdded:Disconnect()
    end
    
    print("FLOAT PLATFORM V3.2 FIXED terminated.")
end

-- Auto Float Button
local autoFloatBtn = Instance.new("TextButton", frame)
autoFloatBtn.Size = UDim2.new(0.9, 0, 0, 28)  -- Giảm chiều cao nút xuống 28
autoFloatBtn.Position = UDim2.new(0.05, 0, 0.26, 0)
autoFloatBtn.Text = "Auto Float"
autoFloatBtn.Font = Enum.Font.GothamSemibold
autoFloatBtn.TextScaled = true
autoFloatBtn.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
autoFloatBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
Instance.new("UICorner", autoFloatBtn).CornerRadius = UDim.new(0, 8)

autoFloatBtn.MouseButton1Click:Connect(function()
    if not systemActive then return end
    if not autoFloating then
        autoFloating = true
        autoFloatBtn.Text = "Auto Float ON"
        autoFloatBtn.BackgroundColor3 = Color3.fromRGB(0, 150, 0)
        
        humanoid.WalkSpeed = defaultWalkSpeed
        humanoid.JumpPower = defaultJumpPower * 1.15
        
        createPlatform(hrp.Position.Y)
        autoFollowPlatform()
        
        if floating then
            floating = false
            floatBtn.Text = "Bật Float (Manual)"
            floatBtn.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
            stopFollow()
        end
    else
        autoFloating = false
        autoFloatBtn.Text = "Auto Float"
        autoFloatBtn.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
        humanoid.JumpPower = defaultJumpPower
        humanoid.WalkSpeed = defaultWalkSpeed
        stopFollow()
        destroyPlatform()
    end
end)

-- Save Button
local saveBtn = Instance.new("TextButton", frame)
saveBtn.Size = UDim2.new(0.9, 0, 0, 28)
saveBtn.Position = UDim2.new(0.05, 0, 0.43, 0)
saveBtn.Text = "Lưu tọa độ"
saveBtn.Font = Enum.Font.GothamSemibold
saveBtn.TextScaled = true
saveBtn.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
saveBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
Instance.new("UICorner", saveBtn).CornerRadius = UDim.new(0, 8)

saveBtn.MouseButton1Click:Connect(function()
    if not systemActive then return end
    savedY = hrp.Position.Y
    saveBtn.Text = "Đã lưu!"
    task.delay(1, function() if saveBtn then saveBtn.Text = "Lưu tọa độ" end end)

    if floating and platform then
        local tween = TweenService:Create(
            platform,
            TweenInfo.new(TWEEN_TIME, Enum.EasingStyle.Quad, Enum.EasingDirection.Out),
            {Position = Vector3.new(platform.Position.X, savedY - OFFSET, platform.Position.Z)}
        )
        tween:Play()
    end
end)

-- Manual Float Button
local floatBtn = Instance.new("TextButton", frame)
floatBtn.Size = UDim2.new(0.9, 0, 0, 28)
floatBtn.Position = UDim2.new(0.05, 0, 0.60, 0)
floatBtn.Text = "Bật Float (Manual)"
floatBtn.Font = Enum.Font.GothamSemibold
floatBtn.TextScaled = true
floatBtn.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
floatBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
Instance.new("UICorner", floatBtn).CornerRadius = UDim.new(0, 8)

floatBtn.MouseButton1Click:Connect(function()
    if not systemActive then return end
    if not savedY then
        floatBtn.Text = "Chưa lưu!"
        task.delay(1, function() if floatBtn then floatBtn.Text = "Bật Float (Manual)" end end)
        return
    end

    if not floating then
        floating = true
        floatBtn.Text = "Đang Float..."
        floatBtn.BackgroundColor3 = Color3.fromRGB(0, 150, 0)
        humanoid.WalkSpeed = defaultWalkSpeed
        humanoid.JumpPower = defaultJumpPower
        
        createPlatform(savedY)
        followPlatform()
        
        if autoFloating then
            autoFloating = false
            autoFloatBtn.Text = "Auto Float"
            autoFloatBtn.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
            stopFollow()
        end
    else
        floating = false
        floatBtn.Text = "Bật Float (Manual)"
        floatBtn.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
        stopFollow()
        destroyPlatform()
        humanoid.WalkSpeed = defaultWalkSpeed
        humanoid.JumpPower = defaultJumpPower
    end
end)

-- Kill Button
local killBtn = Instance.new("TextButton", frame)
killBtn.Size = UDim2.new(0.9, 0, 0, 28)
killBtn.Position = UDim2.new(0.05, 0, 0.77, 0)
killBtn.Text = "Tắt"
killBtn.Font = Enum.Font.GothamSemibold
killBtn.TextScaled = true
killBtn.BackgroundColor3 = Color3.fromRGB(180, 0, 0)
killBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
Instance.new("UICorner", killBtn).CornerRadius = UDim.new(0, 8)

killBtn.MouseButton1Click:Connect(function()
    killFloatSystem()
end)

-- Rainbow effects với systemActive check
task.spawn(function()
    while systemActive and task.wait(0.1) do
        local t = tick() * 0.2
        if made then made.TextColor3 = Color3.fromHSV(t % 1, 1, 1) end
    end
end)

task.spawn(function()
    while systemActive and task.wait(0.03) do
        local t = tick() * 0.15
        if uiStroke then uiStroke.Color = Color3.fromHSV(t % 1, 1, 1) end
    end
end)

-- Character respawn handler
player.CharacterAdded:Connect(function(c)
    if not systemActive then return end
    char = c
    hrp = c:WaitForChild("HumanoidRootPart")
    humanoid = c:WaitForChild("Humanoid")
    defaultWalkSpeed = humanoid.WalkSpeed
    defaultJumpPower = humanoid.JumpPower
    floating = false
    autoFloating = false
    stopFollow()
    destroyPlatform()
    autoFloatBtn.Text = "Auto Float"
    autoFloatBtn.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
    floatBtn.Text = "Bật Float (Manual)"
    floatBtn.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
end)

Features & Information

Float all game

Community Comments (0)

No comments yet for this script.

More Scripts for Universal Scripts