local lastDupeTime = 0
local cooldown = 180

local function teleportTo(position, destroyAfter)
    teleport(position.X, position.Y, position.Z, destroyAfter)
end

MainTab:CreateButton({
    Name = "Safe Dupe",
    Callback = function()
        local currentTime = os.time()
        local timeElapsed = currentTime - lastDupeTime

        if timeElapsed < cooldown then
            local timeLeft = math.ceil(cooldown - timeElapsed)
            Rayfield:Notify({
                Title = "Dupe Gun",
                Content = "Please wait " .. timeLeft .. " seconds!",
                Duration = 3,
                Image = 4483345998,
            })
            return
        end

        lastDupeTime = currentTime

        Rayfield:Notify({
            Title = "Dupe Gun",
            Content = "Duping...",
            Duration = 5,
            Image = 4483345998,
        })

        local replicatedStorage = game:GetService("ReplicatedStorage")
        local players = game:GetService("Players")
        local workspace = game:GetService("Workspace")
        local inventory = replicatedStorage:WaitForChild("Inventory")
        local backpackRemote = replicatedStorage:WaitForChild("BackpackRemote")

        local function getCharacter()
            return players.LocalPlayer.Character
        end

        if getCharacter() and getCharacter():FindFirstChildOfClass("Tool") then
            local step = 0
            local toolName
            local safe
            local originalCFrame

            while true do
                if step == 4 then
                    task.wait(0.5)
                    teleportTo(originalCFrame.Position, true)
                    Rayfield:Notify({
                        Title = "Dupe Gun",
                        Content = "Gun Duped",
                        Duration = 5,
                        Image = 4483345998,
                    })
                    break
                elseif step == 2 then
                    task.spawn(function()
                        backpackRemote:InvokeServer("Store", toolName)
                    end)
                    task.spawn(function()
                        inventory:FireServer("Change", toolName, "Backpack", safe)
                    end)
                    task.wait(1.5)
                    step = 3
                elseif step == 3 then
                    teleportTo(originalCFrame.Position)
                    task.wait(1)
                    backpackRemote:InvokeServer("Grab", toolName)
                    step = 4
                elseif step == 0 then
                    toolName = getCharacter():FindFirstChildOfClass("Tool").Name
                    getCharacter():FindFirstChildOfClass("Humanoid"):UnequipTools()
                    safe = workspace["1# Map"]["2 Crosswalks"].Safes:FindFirstChild("Safe")
                    step = 1
                elseif step == 1 then
                    originalCFrame = getCharacter():FindFirstChild("HumanoidRootPart").CFrame
                    teleportTo(safe:FindFirstChildWhichIsA("BasePart").Position)
                    task.wait(0.5)
                    step = 2
                end
            end
        else
            Rayfield:Notify({
                Title = "Dupe Gun",
                Content = "No Tool Found!",
                Duration = 5,
                Image = 4483345998,
            })
        end
    end
})

Embed on website

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