local Fluent = loadstring(game:HttpGet("https://github.com/dawid-scripts/Fluent/releases/latest/download/main.lua"))()
local SaveManager = loadstring(game:HttpGet("https://raw.githubusercontent.com/dawid-scripts/Fluent/master/Addons/SaveManager.lua"))()
local InterfaceManager = loadstring(game:HttpGet("https://raw.githubusercontent.com/dawid-scripts/Fluent/master/Addons/InterfaceManager.lua"))()
local Players = game:GetService("Players")
local Workspace = game:GetService("Workspace")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local LocalPlayer = Players.LocalPlayer
local Window = Fluent:CreateWindow({
Title = "Drop Teleporter",
SubTitle = "by Badxmatt",
TabWidth = 160,
Size = UDim2.fromOffset(580, 520),
Acrylic = false,
Theme = "Dark",
MinimizeKey = Enum.KeyCode.RightControl
})
local Tabs = {
Main = Window:AddTab({ Title = "Main", Icon = "package" }),
Settings = Window:AddTab({ Title = "Settings", Icon = "settings" })
}
local Options = Fluent.Options
local autoTeleportEnabled = false
local savedPosition = nil
local dropToggles = {}
local currentDropSelections = {}
local function getCharacter()
return LocalPlayer.Character
end
local function getHumanoidRootPart()
local character = getCharacter()
if character then
return character:FindFirstChild("HumanoidRootPart")
end
return nil
end
local function teleportTo(position)
local hrp = getHumanoidRootPart()
if hrp then
hrp.CFrame = CFrame.new(position)
end
end
local function getDropNames()
local names = {}
if ReplicatedStorage:FindFirstChild("drops") then
for _, dropModel in next, ReplicatedStorage.drops:GetChildren() do
if dropModel:IsA("Model") then
table.insert(names, dropModel.Name)
end
end
end
table.sort(names)
return names
end
local function findClosestEnabledDrop()
local hrp = getHumanoidRootPart()
if not hrp then return nil end
local closestDrop = nil
local minDistance = math.huge
local hrpPosition = hrp.Position
for dropName, isEnabled in pairs(currentDropSelections) do
if isEnabled then
local dropInWorkspace = Workspace:FindFirstChild(dropName)
if dropInWorkspace and dropInWorkspace:IsA("Model") and dropInWorkspace:FindFirstChild("Hitbox") then
local hitbox = dropInWorkspace.Hitbox
if hitbox and hitbox:IsA("BasePart") then
local distance = (hrpPosition - hitbox.Position).Magnitude
if distance < minDistance then
minDistance = distance
closestDrop = dropInWorkspace
end
end
end
end
end
return closestDrop
end
local mainLoopConnection = nil
local function startMainLoop()
if mainLoopConnection then
mainLoopConnection:Disconnect()
mainLoopConnection = nil
end
mainLoopConnection = RunService.Heartbeat:Connect(function()
if not autoTeleportEnabled then
if mainLoopConnection then
mainLoopConnection:Disconnect()
mainLoopConnection = nil
end
return
end
local targetDrop = findClosestEnabledDrop()
if targetDrop and savedPosition then
teleportTo(targetDrop.Hitbox.Position + Vector3.new(0, 3, 0))
task.wait(Options.TeleportDelay.Value)
if not autoTeleportEnabled then return end
teleportTo(savedPosition)
task.wait(Options.ReturnDelay.Value)
else
task.wait(1)
end
end)
end
do
local section = Tabs.Main:AddSection("Teleportation")
section:AddToggle("AutoTeleportEnabled", {
Title = "Enable Auto Teleport",
Description = "Saves your current position and starts the teleport loop.",
Default = false,
Callback = function(Value)
autoTeleportEnabled = Value
if Value then
local hrp = getHumanoidRootPart()
if hrp then
savedPosition = hrp.Position
Fluent:Notify({
Title = "Position Saved",
Content = "Your return position has been recorded.",
Duration = 3
})
startMainLoop()
else
autoTeleportEnabled = false
Options.AutoTeleportEnabled:SetValue(false)
Fluent:Notify({
Title = "Error",
Content = "Could not find your character to save position.",
Duration = 5
})
end
else
savedPosition = nil
end
end
})
section:AddSlider("TeleportDelay", {
Title = "Delay After Teleport",
Description = "Time to wait at the drop location.",
Default = 0.5,
Min = 0.1,
Max = 5,
Rounding = 1
})
section:AddSlider("ReturnDelay", {
Title = "Delay After Return",
Description = "Time to wait after returning to base.",
Default = 1.0,
Min = 0.1,
Max = 5,
Rounding = 1
})
local dropsSection = Tabs.Main:AddSection("Drop Configuration")
local dropListHolder = {}
local function populateDropToggles()
for _, obj in pairs(dropListHolder) do
obj:Destroy()
end
dropListHolder = {}
currentDropSelections = {}
local dropNames = getDropNames()
for _, dropName in next, dropNames do
local toggle = dropsSection:AddToggle("DropToggle_" .. dropName, {
Title = dropName,
Default = false,
Callback = function(Value)
currentDropSelections[dropName] = Value
end
})
table.insert(dropListHolder, toggle)
currentDropSelections[dropName] = false
end
end
dropsSection:AddButton({
Title = "Refresh Drop List",
Description = "Updates the list of available drops.",
Callback = function()
populateDropToggles()
Fluent:Notify({
Title = "Drop Teleporter",
Content = "Drop list has been refreshed.",
Duration = 3
})
end
})
populateDropToggles()
end
SaveManager:SetLibrary(Fluent)
InterfaceManager:SetLibrary(Fluent)
SaveManager:IgnoreThemeSettings()
InterfaceManager:SetFolder("FluentDropTeleporter")
SaveManager:SetFolder("FluentDropTeleporter/Config")
InterfaceManager:BuildInterfaceSection(Tabs.Settings)
SaveManager:BuildConfigSection(Tabs.Settings)
Window:SelectTab(1)
Fluent:Notify({
Title = "Drop Teleporter",
Content = "Script loaded successfully.",
Duration = 5
})
SaveManager:LoadAutoloadConfig()
Comments