local runs = game:GetService("RunService")
local Ip = game:GetService("Players").LocalPlayer
local character = Ip.Character or Ip.CharacterAdded:Wait()
local tweens = game:GetService("TweenService")
local humanoidRootPart = character and character:FindFirstChild("HumanoidRootPart")

-- Anti-fall functionality
local function setAntiFall(antiFall)
    if character and character:FindFirstChild("Humanoid") then
        local humanoid = character.Humanoid
        if antiFall and humanoid:GetState() == Enum.HumanoidStateType.Freefall then
            humanoidRootPart.Velocity = Vector3.new(0, 0, 0)  --change to -0.01 if error
        else
            humanoidRootPart.Velocity = Vector3.new(0, 0, 0) -- Reset velocity when not anti-falling
        end
    end
end

local function tween(v, speed)
    if character and humanoidRootPart then
        local cf = CFrame.new(v)
        local distance = (humanoidRootPart.Position - v).Magnitude
        local time = distance / speed
        local tweeninfo = TweenInfo.new(time, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
        local start_tween = tweens:Create(humanoidRootPart, tweeninfo, { CFrame = cf })

        start_tween:Play()
        
        -- Enable anti-fall while tweening
        local heartbeatConnection
        heartbeatConnection = runs.Heartbeat:Connect(function()
            setAntiFall(true) -- Enable anti-fall during tweening
        end)

        -- Wait for the tween to complete
        start_tween.Completed:Wait()

        -- Disable anti-fall after tween completion
        setAntiFall(false)

        -- Disconnect the heartbeat connection
        heartbeatConnection:Disconnect()
        
        return start_tween
    end
end

local speed = 300
-------
--window
-------

local Fluent = loadstring(game:HttpGet("https://[Log in to view URL]"))()
local SaveManager = loadstring(game:HttpGet("https://[Log in to view URL]"))()
local InterfaceManager = loadstring(game:HttpGet("https://[Log in to view URL]"))()

local Window = Fluent:CreateWindow({
    Title = "Khang Gay Hub | New GUI",
    SubTitle = "by huh",
    TabWidth = 160,
    Size = UDim2.fromOffset(580, 460),
    Acrylic = false, -- The blur may be detectable, setting this to false disables blur entirely
    Theme = "Dark",
    MinimizeKey = Enum.KeyCode.LeftControl -- Used when theres no MinimizeKeybind
})

local Tabs = {
    Island = Window:AddTab({ Title = "Island", Icon = "tree-palm" })
}

local Options = Fluent.Options

do
   Tabs.Island:AddButton({
        Title = "Tween to MidTown",
        Description = "",
        Callback = function()
            tween(Vector3.new(-791.885742, 70.3121414, 1605.35486), speed)  -- Pass a Vector3 for position
        end
    })
end


SaveManager:SetLibrary(Fluent)
InterfaceManager:SetLibrary(Fluent)

-- Ignore keys that are used by ThemeManager.
-- (we dont want configs to save themes, do we?)
SaveManager:IgnoreThemeSettings()

-- You can add indexes of elements the save manager should ignore
SaveManager:SetIgnoreIndexes({})

-- use case for doing it this way:
-- a script hub could have themes in a global folder
-- and game configs in a separate folder per game
InterfaceManager:SetFolder("FluentScriptHub")
SaveManager:SetFolder("FluentScriptHub/specific-game")

InterfaceManager:BuildInterfaceSection(Tabs.Settings)
SaveManager:BuildConfigSection(Tabs.Settings)


Window:SelectTab(1)

Fluent:Notify({
    Title = "Fluent",
    Content = "The script has been loaded.",
    Duration = 8
})

-- You can use the SaveManager:LoadAutoloadConfig() to load a config
-- which has been marked to be one that auto loads!
SaveManager:LoadAutoloadConfig()

Embed on website

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