Teleport players to arena doesn't work

Basically randomly 2 of 9 players each minute should be teleported on the party “woody”, also player 2 should be 1 inch to the left than player 1

local Debris = game:GetService("Debris")
local Woody = game.Workspace:WaitForChild("Woody")
local teleportDelay = 60
local playerList = {}

-- Add players to playerList
for _, player in pairs(Players:GetPlayers()) do
    table.insert(playerList, player)
end

-- Function to teleport two random players to Woody
local function teleportToWoody()
    local player1 = playerList[math.random(#playerList)]
    local player2 = playerList[math.random(#playerList)]
    while player1 == player2 do
        player2 = playerList[math.random(#playerList)]
    end
    local character1 = player1.Character or player1.CharacterAdded:Wait()
    local character2 = player2.Character or player2.CharacterAdded:Wait()
    character1:MoveTo(Woody.Position)
    character2:MoveTo(Woody.Position)
end

-- Function to respawn players who touch Woody
local function respawnOnTouch(part)
    local character = part.Parent
    local player = Players:GetPlayerFromCharacter(character)
    if not (player == player1 or player == player2) then
        local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
        if humanoidRootPart then
            local spawnLocation = Players.RespawnLocation or game.Workspace.SpawnLocation
            humanoidRootPart.CFrame = spawnLocation.CFrame
        end
    end
end

-- Connect Woody's Touched event to respawnOnTouch function
Woody.Touched:Connect(respawnOnTouch)

-- Teleport two random players to Woody every teleportDelay seconds
while wait(teleportDelay) do
    teleportToWoody()
end

Where do you reference the Players service?

You should try doing some debugging before posting. I can see multiple errors in the code:

  • You are not adding or removing players that enter the game after the first iteration you do on the current players at the top of the code. (This is the main problem of why your code is not working)
  • I don’t know if you’re defining at some point the Players service, but in the code you provided it is not defined.
  • player1 and player 2 in respawnOnTouch function are not defined.

You can also change some functions on your code, removing unnecesary things:

-- playerList
local playerList = Players:GetPlayers()
-- teleportToWoody()
local function teleportToWoody()
    local player1 = playerList[math.random(#playerList)]
    table.remove(playerList, table.find(playerList, player1))
    local player2 = playerList[math.random(#playerList)]

    local character1 = player1.Character or player1.CharacterAdded:Wait()
    local character2 = player2.Character or player2.CharacterAdded:Wait()

    character1:MoveTo(Woody.Position)
    character2:MoveTo(Woody.Position)
end

-- Main loop
local Players = game:GetService("Players")

while task.wait(teleportDelay) do
    playerList = Players:GetPlayers()
    teleportToWoody()
end

Still doesn’t work, does not teleporting or anything.