lua teleport

-- Step 1: Define a function to teleport the player
function teleportPlayer(x, y)
    -- Step 2: Get the player entity
    local player = game.players.getLocalPlayer()

    -- Step 3: Check if the player entity exists
    if player then
        -- Step 4: Set the player's position to the specified coordinates
        player.teleport({x = x, y = y})
    end
end

-- Step 5: Example usage of the teleport function
teleportPlayer(100, 200)