-- Load Arceus-X UI Library
local lib = loadstring(game:HttpGet("https://[Log in to view URL]"))()
lib:SetTitle("Flazed lua | UI Library")
lib:SetIcon("http://[Log in to view URL]")

-- Use a valid variable name for gravity and set initial gravity to 60.
local defaultGravity = 60
workspace.Gravity = defaultGravity

-------------------------------------------------
-- BUTTONS & TOGGLES
-------------------------------------------------

-- Gravity Toggle: When enabled, sets gravity to normal (196.2); when disabled, sets gravity to 60.
lib:AddToggle("Toggle Gravity", function(state)
    if state then
        workspace.Gravity = 196.2
    else
        workspace.Gravity = defaultGravity
    end
end, false)

-- Freeze Toggle: Anchors or unanchors the character's HumanoidRootPart.
lib:AddToggle("Freeze", function(state)
    local localPlayer = game.Players.LocalPlayer
    local character = localPlayer.Character or localPlayer.CharacterAdded:Wait()
    local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
    humanoidRootPart.Anchored = state
    if state then
        print("Character frozen.")
    else
        print("Character unfrozen.")
    end
end, false)

-------------------------------------------------
-- BUTTONS FOR EXTERNAL SCRIPTS
-------------------------------------------------

-- Auto Aim Button: Creates a GUI for targeting/grappling a specified player.
lib:AddButton("Auto Aim", function()
 -- Create GUI
local gui = Instance.new("ScreenGui")
gui.Name = "GrappleScriptGUI"
gui.Parent = game:GetService("CoreGui")

local frame = Instance.new("Frame")
frame.Size = UDim2.new(0, 160, 0, 120)
frame.Position = UDim2.new(0.5, -80, 0.5, -60)
frame.BackgroundTransparency = 0.5
frame.BackgroundColor3 = Color3.new(0, 0, 0)
frame.Parent = gui

local dragBar = Instance.new("Frame")
dragBar.Size = UDim2.new(1, 0, 0, 35)
dragBar.BackgroundColor3 = Color3.new(0.2, 0.2, 0.2)
dragBar.Parent = frame

-- Grapple Script Button
local button = Instance.new("TextButton")
button.Size = UDim2.new(0, 140, 0, 30)
button.Position = UDim2.new(0, 10, 0, 10)
button.Text = "Grapple Script"
button.TextColor3 = Color3.new(1, 1, 1)
button.BackgroundColor3 = Color3.new(0.2, 0.2, 0.2)
button.Parent = frame

-- Player Name Input TextBox
local playerNameBox = Instance.new("TextBox")
playerNameBox.Size = UDim2.new(0, 140, 0, 30)
playerNameBox.Position = UDim2.new(0, 10, 0, 50)
playerNameBox.PlaceholderText = "Enter player name"
playerNameBox.TextColor3 = Color3.new(1, 1, 1)
playerNameBox.BackgroundColor3 = Color3.new(0.2, 0.2, 0.2)
playerNameBox.ClearTextOnFocus = true
playerNameBox.Parent = frame

-- Grapple Button for targeting player
local grappleButton = Instance.new("TextButton")
grappleButton.Size = UDim2.new(0, 140, 0, 30)
grappleButton.Position = UDim2.new(0, 10, 0, 90)
grappleButton.Text = "Flazed AutoGrapple"
grappleButton.TextColor3 = Color3.new(1, 1, 1)
grappleButton.BackgroundColor3 = Color3.new(0.2, 0.2, 0.2)
grappleButton.Parent = frame

-- Variables
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local targetPlayer = nil
local isEnabled = false
local fireRate = 0.10

-- Function to calculate movement prediction with jump and movement adjustments
local function getPredictedPosition(torso)
    local velocity = torso.AssemblyLinearVelocity
    local predictionFactor

    -- Adjust prediction based on vertical velocity (jumping behavior)
    if velocity.Y > 1 then -- Player is jumping
        predictionFactor = 0.33 -- Significant decrease when jumping
    elseif math.abs(velocity.X) > 4 or math.abs(velocity.Z) > 7 then -- Player is moving horizontally
        predictionFactor = 0.2 -- Slight decrease when moving generally
    else
        predictionFactor = 0.01 -- Normal prediction when stationary or on ground
    end

    return torso.Position + (velocity * predictionFactor)
end

-- Function to check for grapple tool
local function hasGrappleTool()
    local character = LocalPlayer.Character
    if character then
        for _, item in pairs(character:GetChildren()) do
            if item:IsA("Tool") and item:FindFirstChild("RemoteEvent") then
                return item
            end
        end
    end
    return nil
end

-- Function to find a player by their name or display name.
local function findPlayerByName(name)
    for _, player in pairs(Players:GetPlayers()) do
        if player.Name:lower():find(name) or player.DisplayName:lower():find(name) then
            return player
        end
    end
    return nil
end

-- Function to fire the grapple.
local function fireGrappleInstantly()
    if not targetPlayer or not targetPlayer.Character then 
        warn("No valid target player!") 
        return 
    end
    
    local rootPart = targetPlayer.Character:FindFirstChild("HumanoidRootPart")
    if not rootPart then 
        warn("Target player does not have HumanoidRootPart!") 
        return 
    end

    local predictedPosition = getPredictedPosition(rootPart)
    local grappleTool = hasGrappleTool()
    
    if grappleTool then 
        grappleTool.RemoteEvent:FireServer(predictedPosition)
        print("Grappled to " .. targetPlayer.Name)
    else 
        print("Grapple tool not equipped!") 
    end 
end

-- Grapple loop function.
local function grappleLoop()
    while isEnabled do 
        fireGrappleInstantly() 
        task.wait(fireRate) 
    end 
end 

-- Toggle grapple logic.
local function toggleGrapple()
    if targetPlayer then 
        isEnabled = not isEnabled 
        
        button.Text = isEnabled and "Grapple Script: ON" or "Grapple Script: OFF"
        
        if isEnabled then task.spawn(grappleLoop) end 
    else 
        warn("Player not found! Double-check the name entered.") 
    end 
end 

-- Main toggle function.
local function toggleLoop()
    local playerName = playerNameBox.Text:lower()

    if playerName and playerName ~= "" then 
        targetPlayer = findPlayerByName(playerName) 
        toggleGrapple() 
    else 
        warn("Please enter a valid player name!") 
    end 
end 

-- Button click events.
button.MouseButton1Click:Connect(toggleLoop)
grappleButton.MouseButton1Click:Connect(fireGrappleInstantly)

-- Draggable functionality for the GUI (Mobile Support)
local dragging, dragInput, dragStart, startPos

dragBar.InputBegan:Connect(function(input)
    if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
        dragging = true
        dragStart = input.Position
        startPos = frame.Position
        input.Consumed = true
    end
end)

dragBar.InputChanged:Connect(function(input)
    if dragging then
        if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
            local delta = input.Position - dragStart
            frame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X,
                                        startPos.Y.Scale, startPos.Y.Offset + delta.Y)
        end
    end
end)

dragBar.InputEnded:Connect(function(input)
    if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
        dragging = false
          end
   end)
end)


-------------------------------------------------
-- DISPLAY THE UI
-------------------------------------------------
lib:Display()

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: